|
24 | 24 | GENERATED = FileList.new
|
25 | 25 |
|
26 | 26 | namespace :clean do
|
27 |
| - desc "Remove generated files" |
| 27 | + desc "Remove generated files (only)" |
28 | 28 | task :generated do
|
29 | 29 | GENERATED.each { |fn| rm_r fn rescue nil }
|
30 | 30 | end
|
| 31 | + desc "Remove lib/*.jar (test) dependencies" |
| 32 | + task :lib do |
| 33 | + rm_r 'target/lib' rescue nil |
| 34 | + end |
31 | 35 | end
|
32 | 36 |
|
33 | 37 | directory 'target/classes'
|
34 | 38 |
|
35 | 39 | desc "Compile classes"
|
36 |
| -task(:compile => 'target/classes') { sh 'mvn compile' } |
| 40 | +task(:compile => 'target/classes') { sh 'mvn compile -Dmdep.skip=true' } |
37 | 41 |
|
38 | 42 | directory 'target/test-classes'
|
39 | 43 |
|
40 | 44 | 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' } |
42 | 46 |
|
43 | 47 | 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' } |
45 | 49 |
|
46 | 50 | task(:test_prepare => ['target/classes', 'target/test-classes']) do
|
47 |
| - sh 'mvn compile test-compile -P jars' |
| 51 | + sh 'mvn test-compile' |
48 | 52 | end
|
49 | 53 |
|
50 | 54 | desc "Unpack the rack gem"
|
@@ -92,7 +96,7 @@ task :test_resources => ["target/test-classes"]
|
92 | 96 | namespace :resources do
|
93 | 97 | desc "Copy (and generate) resources"
|
94 | 98 | task :copy => :resources do
|
95 |
| - sh 'mvn process-resources' |
| 99 | + sh 'mvn process-resources -Dmdep.skip=true' |
96 | 100 | end
|
97 | 101 | desc "Generate test resources"
|
98 | 102 | task :test => :test_resources
|
@@ -215,17 +219,24 @@ task :release_checks do
|
215 | 219 | "Please run `mvn install' to bring the two files in sync."
|
216 | 220 | end
|
217 | 221 |
|
218 |
| - puts "Release looks ready to go!" |
| 222 | + puts "release #{GEM_VERSION} looks ready to go ..." |
219 | 223 | end
|
220 | 224 |
|
221 | 225 | desc "Release the gem to rubygems and jar to repository.codehaus.org"
|
222 | 226 | 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 | + |
223 | 232 | 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 |
226 | 235 | sh "gem push target/jruby-rack-#{GEM_VERSION}.gem"
|
| 236 | + |
227 | 237 | git_branch = `git branch | sed -n '/\* /s///p'`.chomp
|
228 | 238 | sh "git push --tags #{ENV['GIT_REMOTE'] || 'origin'} #{git_branch}"
|
| 239 | + |
229 | 240 | puts "released JRuby-Rack #{GEM_VERSION} update next SNAPSHOT version using `rake update_version`"
|
230 | 241 | end
|
231 | 242 |
|
|
0 commit comments