Skip to content

Commit fdaa9da

Browse files
committed
re-arrange release steps
1 parent f14d0c8 commit fdaa9da

File tree

2 files changed

+38
-36
lines changed

2 files changed

+38
-36
lines changed

Rakefile

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,31 @@ end
2424
GENERATED = FileList.new
2525

2626
namespace :clean do
27-
desc "Remove generated files"
27+
desc "Remove generated files (only)"
2828
task :generated do
2929
GENERATED.each { |fn| rm_r fn rescue nil }
3030
end
31+
desc "Remove lib/*.jar (test) dependencies"
32+
task :lib do
33+
rm_r 'target/lib' rescue nil
34+
end
3135
end
3236

3337
directory 'target/classes'
3438

3539
desc "Compile classes"
36-
task(:compile => 'target/classes') { sh 'mvn compile' }
40+
task(:compile => 'target/classes') { sh 'mvn compile -Dmdep.skip=true' }
3741

3842
directory 'target/test-classes'
3943

4044
desc "Compile test classes"
41-
task(:test_compile => 'target/test-classes') { sh 'mvn test-compile' }
45+
task(:test_compile => 'target/test-classes') { sh 'mvn test-compile -Dmdep.skip=true' }
4246

4347
desc "Copy .jar dependencies for (local) testing"
44-
task(:test_jars) { sh 'mvn test-compile -P jars' }
48+
task(:test_jars) { sh 'mvn test-compile' }
4549

4650
task(:test_prepare => ['target/classes', 'target/test-classes']) do
47-
sh 'mvn compile test-compile -P jars'
51+
sh 'mvn test-compile'
4852
end
4953

5054
desc "Unpack the rack gem"
@@ -92,7 +96,7 @@ task :test_resources => ["target/test-classes"]
9296
namespace :resources do
9397
desc "Copy (and generate) resources"
9498
task :copy => :resources do
95-
sh 'mvn process-resources'
99+
sh 'mvn process-resources -Dmdep.skip=true'
96100
end
97101
desc "Generate test resources"
98102
task :test => :test_resources
@@ -215,17 +219,24 @@ task :release_checks do
215219
"Please run `mvn install' to bring the two files in sync."
216220
end
217221

218-
puts "Release looks ready to go!"
222+
puts "release #{GEM_VERSION} looks ready to go ..."
219223
end
220224

221225
desc "Release the gem to rubygems and jar to repository.codehaus.org"
222226
task :release => [:release_checks, :clean] do
227+
args = ''
228+
args << "-Dgpg.keyname=#{ENV['GPG_KEYNAME']} " if ENV['GPG_KEYNAME']
229+
230+
sh "mvn -Prelease #{args} -DupdateReleaseInfo=true clean deploy"
231+
223232
sh "git tag #{GEM_VERSION}"
224-
sh "mvn deploy -DupdateReleaseInfo=true"
225-
sh "rake gem SKIP_SPECS=true" # already run specs with mvn
233+
234+
ENV['SKIP_SPECS'] = 'true'; Rake::Task['gem'].invoke
226235
sh "gem push target/jruby-rack-#{GEM_VERSION}.gem"
236+
227237
git_branch = `git branch | sed -n '/\* /s///p'`.chomp
228238
sh "git push --tags #{ENV['GIT_REMOTE'] || 'origin'} #{git_branch}"
239+
229240
puts "released JRuby-Rack #{GEM_VERSION} update next SNAPSHOT version using `rake update_version`"
230241
end
231242

pom.xml

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,24 @@
202202
<artifactId>maven-help-plugin</artifactId>
203203
<version>2.2</version>
204204
</plugin>
205+
<plugin>
206+
<groupId>org.apache.maven.plugins</groupId>
207+
<artifactId>maven-dependency-plugin</artifactId>
208+
<version>2.9</version>
209+
<executions>
210+
<execution>
211+
<phase>process-sources</phase>
212+
<goals>
213+
<goal>copy-dependencies</goal>
214+
</goals>
215+
<!-- .jars for tests to pick up, skipped with -Dmdep.skip=true -->
216+
<configuration>
217+
<outputDirectory>${project.build.directory}/lib</outputDirectory>
218+
<excludeGroupIds>org.jruby,rubygems</excludeGroupIds>
219+
</configuration>
220+
</execution>
221+
</executions>
222+
</plugin>
205223
<plugin>
206224
<groupId>de.saumya.mojo</groupId>
207225
<artifactId>gem-maven-plugin</artifactId>
@@ -273,33 +291,6 @@
273291
</build>
274292

275293
<profiles>
276-
<profile>
277-
<id>jars</id>
278-
<activation>
279-
<activeByDefault>true</activeByDefault>
280-
</activation>
281-
<build>
282-
<plugins>
283-
<plugin>
284-
<groupId>org.apache.maven.plugins</groupId>
285-
<artifactId>maven-dependency-plugin</artifactId>
286-
<version>2.8</version>
287-
<executions>
288-
<execution>
289-
<phase>process-sources</phase>
290-
<goals>
291-
<goal>copy-dependencies</goal>
292-
</goals>
293-
<configuration>
294-
<outputDirectory>${project.build.directory}/lib</outputDirectory>
295-
<excludeGroupIds>org.jruby</excludeGroupIds>
296-
</configuration>
297-
</execution>
298-
</executions>
299-
</plugin>
300-
</plugins>
301-
</build>
302-
</profile>
303294
<profile>
304295
<id>release</id>
305296
<activation>

0 commit comments

Comments
 (0)