3232
3333directory 'target/classes'
3434
35- file 'target/classpath.rb' do
36- sh 'mvn org.jruby.plugins:jruby-rake-plugin:classpath -Djruby.classpath.scope=test'
37- end
38- GENERATED << 'target/classpath.rb'
39-
4035desc "Compile classes"
41- task :compile => [ :'target/classes' ] do |t |
42- sh 'mvn compile'
43- end
36+ task ( :compile => 'target/classes' ) { sh 'mvn compile' }
4437
4538directory 'target/test-classes'
4639
4740desc "Compile test classes"
48- task :test_compile => [ 'target/test-classes' ] do |t |
49- sh 'mvn test-compile'
41+ task ( :test_compile => 'target/test-classes' ) { sh 'mvn test-compile' }
42+
43+ desc "Copy .jar dependencies for (local) testing"
44+ task ( :test_jars ) { sh 'mvn test-compile -P jars' }
45+
46+ task ( :test_prepare => [ 'target/classes' , 'target/test-classes' ] ) do
47+ sh 'mvn compile test-compile -P jars'
5048end
5149
5250desc "Unpack the rack gem"
@@ -104,7 +102,7 @@ namespace :resources do
104102 task :test => :test_resources
105103end
106104
107- task :speconly => [ 'target/classpath.rb' , :resources , :test_resources ] do
105+ task :speconly => [ :resources , :test_resources ] do
108106 if ENV [ 'SKIP_SPECS' ] . to_s == 'true'
109107 puts "Skipping specs due to SKIP_SPECS=#{ ENV [ 'SKIP_SPECS' ] } "
110108 else
@@ -117,7 +115,7 @@ task :speconly => ['target/classpath.rb', :resources, :test_resources] do
117115end
118116
119117desc "Run specs"
120- task :spec => [ :compile , :test_compile , :speconly ]
118+ task :spec => [ :test_prepare , :speconly ]
121119task :test => :spec
122120
123121POM_FILE = 'pom.xml'
@@ -132,14 +130,6 @@ GEM_VERSION =
132130
133131JAR_VERSION = GEM_VERSION . sub ( /\. (\D +\w *)/ , '-\1' ) # 1.1.1.SNAPSHOT -> 1.1.1-SNAPSHOT
134132
135- desc "Print the (Maven) class-path"
136- task :classpath => 'target/classpath.rb' do
137- require './target/classpath'
138- classpath = Maven . classpath
139- classpath = classpath . reject { |p | p =~ /target\/ (test-)?classes$/ }
140- puts *classpath
141- end
142-
143133file ( target_jruby_rack = 'target/gem/lib/jruby-rack.rb' ) do |t |
144134 mkdir_p File . dirname ( t . name )
145135 File . open ( t . name , "wb" ) do |f |
0 commit comments