buildr 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +68 -11
- data/_buildr +2 -0
- data/addon/buildr/hibernate.rb +8 -5
- data/addon/buildr/jetty.rb +1 -1
- data/addon/buildr/openjpa.rb +0 -2
- data/addon/buildr/xmlbeans.rb +1 -1
- data/buildr.gemspec +13 -9
- data/doc/_layouts/default.html +3 -1
- data/doc/contributing.textile +10 -2
- data/doc/css/default.css +6 -6
- data/doc/download.textile +7 -7
- data/doc/languages.textile +2 -2
- data/doc/more_stuff.textile +41 -33
- data/doc/packaging.textile +6 -3
- data/doc/releasing.textile +116 -0
- data/doc/scripts/install-linux.sh +7 -6
- data/doc/testing.textile +14 -0
- data/lib/buildr.rb +2 -2
- data/lib/buildr/core.rb +0 -6
- data/lib/buildr/core/application.rb +25 -2
- data/lib/buildr/core/build.rb +66 -15
- data/lib/buildr/core/compile.rb +10 -1
- data/lib/buildr/core/filter.rb +1 -1
- data/lib/buildr/core/progressbar.rb +8 -3
- data/lib/buildr/core/test.rb +57 -6
- data/lib/buildr/core/transports.rb +18 -13
- data/lib/buildr/core/util.rb +19 -3
- data/lib/buildr/groovy/compiler.rb +2 -2
- data/lib/buildr/ide/eclipse.rb +32 -12
- data/lib/buildr/java/ant.rb +3 -3
- data/lib/buildr/java/bdd.rb +1 -2
- data/lib/buildr/java/cobertura.rb +10 -9
- data/lib/buildr/java/commands.rb +22 -21
- data/lib/buildr/java/compiler.rb +2 -2
- data/lib/buildr/java/doc.rb +1 -1
- data/lib/buildr/java/ecj.rb +71 -0
- data/lib/buildr/java/emma.rb +1 -1
- data/lib/buildr/java/external.rb +9 -9
- data/lib/buildr/java/jruby.rb +5 -0
- data/lib/buildr/java/packaging.rb +4 -3
- data/lib/buildr/java/rjb.rb +4 -6
- data/lib/buildr/java/tests.rb +9 -4
- data/lib/buildr/packaging/archive.rb +7 -3
- data/lib/buildr/packaging/artifact.rb +153 -38
- data/lib/buildr/packaging/gems.rb +2 -3
- data/lib/buildr/packaging/package.rb +19 -12
- data/lib/buildr/packaging/tar.rb +1 -1
- data/lib/buildr/packaging/ziptask.rb +1 -1
- data/lib/buildr/scala/bdd.rb +7 -3
- data/lib/buildr/scala/compiler.rb +2 -2
- data/lib/buildr/scala/doc.rb +3 -3
- data/lib/buildr/scala/tests.rb +7 -3
- data/lib/buildr/version.rb +18 -0
- data/rakelib/all-in-one.rake +1 -1
- data/rakelib/doc.rake +13 -3
- data/rakelib/metrics.rake +39 -0
- data/spec/core/application_spec.rb +13 -12
- data/spec/core/build_spec.rb +166 -7
- data/spec/core/cc_spec.rb +1 -1
- data/spec/core/checks_spec.rb +1 -1
- data/spec/core/common_spec.rb +10 -1
- data/spec/core/compile_spec.rb +1 -1
- data/spec/core/extension_spec.rb +1 -1
- data/spec/core/generate_spec.rb +1 -1
- data/spec/core/project_spec.rb +1 -1
- data/spec/core/test_spec.rb +124 -11
- data/spec/core/transport_spec.rb +10 -3
- data/spec/core/util_spec.rb +18 -2
- data/spec/groovy/bdd_spec.rb +1 -1
- data/spec/groovy/compiler_spec.rb +3 -3
- data/spec/ide/eclipse_spec.rb +63 -1
- data/spec/ide/idea7x_spec.rb +1 -1
- data/spec/java/ant_spec.rb +1 -1
- data/spec/java/bdd_spec.rb +1 -1
- data/spec/java/cobertura_spec.rb +29 -2
- data/spec/java/commands_spec.rb +61 -2
- data/spec/java/compiler_spec.rb +3 -3
- data/spec/java/ecj_spec.rb +115 -0
- data/spec/java/emma_spec.rb +1 -1
- data/spec/java/external_spec.rb +10 -8
- data/spec/java/java_spec.rb +14 -6
- data/spec/java/packaging_spec.rb +41 -15
- data/spec/java/test_coverage_helper.rb +1 -1
- data/spec/java/tests_spec.rb +1 -1
- data/spec/packaging/archive_spec.rb +12 -1
- data/spec/packaging/artifact_namespace_spec.rb +1 -1
- data/spec/packaging/artifact_spec.rb +197 -7
- data/spec/packaging/packaging_spec.rb +12 -12
- data/spec/sandbox.rb +8 -3
- data/spec/scala/bdd_spec.rb +3 -3
- data/spec/scala/compiler_spec.rb +7 -7
- data/spec/scala/scala.rb +3 -3
- data/spec/scala/tests_spec.rb +3 -3
- data/spec/spec_helpers.rb +11 -1
- data/spec/version_requirement_spec.rb +1 -1
- metadata +212 -81
- data/rakelib/jekylltask.rb +0 -120
data/spec/java/tests_spec.rb
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# the License.
|
15
15
|
|
16
16
|
|
17
|
-
require File.join(File.dirname(__FILE__), '
|
17
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
|
18
18
|
|
19
19
|
|
20
20
|
describe 'ArchiveTask', :shared=>true do
|
@@ -205,6 +205,13 @@ describe 'ArchiveTask', :shared=>true do
|
|
205
205
|
archive(@archive).include(@dir, :as=>'.').invoke
|
206
206
|
inspect_archive { |archive| archive.keys.should_not include(".") }
|
207
207
|
end
|
208
|
+
|
209
|
+
it 'should archive directories into specified alias, even if it has the same name' do
|
210
|
+
archive(@archive).include(@dir, :as=>File.basename(@dir)).invoke
|
211
|
+
inspect_archive { |archive|
|
212
|
+
archive.keys.should_not include "#{File.basename(@dir)}"
|
213
|
+
}
|
214
|
+
end
|
208
215
|
|
209
216
|
it 'should archive file into specified name/path' do
|
210
217
|
archive(@archive).include(@files.first, :as=>'test/sample', :path=>'path').invoke
|
@@ -578,6 +585,10 @@ describe Unzip do
|
|
578
585
|
Rake::Task.clear ; rm_rf @target
|
579
586
|
unzip(@target=>@zip).include('test/**/*').target.invoke
|
580
587
|
FileList[File.join(@target, 'test/path/*')].size.should be(2)
|
588
|
+
|
589
|
+
Rake::Task.clear ; rm_rf @target
|
590
|
+
unzip(@target=>@zip).include('test/*').target.invoke
|
591
|
+
FileList[File.join(@target, 'test/path/*')].size.should be(2)
|
581
592
|
end
|
582
593
|
end
|
583
594
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
-
require File.join(File.dirname(__FILE__), '
|
16
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
|
17
17
|
|
18
18
|
describe Buildr::ArtifactNamespace do
|
19
19
|
|
@@ -13,9 +13,8 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
-
|
17
|
-
require
|
18
|
-
|
16
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
|
17
|
+
require 'fileutils'
|
19
18
|
|
20
19
|
describe Artifact do
|
21
20
|
before do
|
@@ -25,6 +24,7 @@ describe Artifact do
|
|
25
24
|
@snapshot = artifact(@spec.merge({ :version=>'2.1-SNAPSHOT' }))
|
26
25
|
end
|
27
26
|
|
27
|
+
|
28
28
|
it 'should act as one' do
|
29
29
|
@artifact.should respond_to(:to_spec)
|
30
30
|
end
|
@@ -79,6 +79,10 @@ describe Artifact do
|
|
79
79
|
@artifact.sources_artifact.to_hash.should == @artifact.to_hash.merge(:classifier=>'sources')
|
80
80
|
end
|
81
81
|
|
82
|
+
it 'should have associated javadoc artifact' do
|
83
|
+
@artifact.javadoc_artifact.to_hash.should == @artifact.to_hash.merge(:classifier=>'javadoc')
|
84
|
+
end
|
85
|
+
|
82
86
|
it 'should download file if file does not exist' do
|
83
87
|
lambda { @artifact.invoke }.should raise_error(Exception, /No remote repositories/)
|
84
88
|
lambda { @classified.invoke }.should raise_error(Exception, /No remote repositories/)
|
@@ -129,6 +133,14 @@ describe Artifact do
|
|
129
133
|
Artifact.list.should include(@classified.to_spec)
|
130
134
|
Artifact.list.should include('foo:foo:jar:1.0')
|
131
135
|
end
|
136
|
+
|
137
|
+
it 'should accept user-defined string content' do
|
138
|
+
a = artifact(@spec)
|
139
|
+
a.content 'foo'
|
140
|
+
install a
|
141
|
+
lambda { install.invoke }.should change { File.exist?(a.to_s) && File.exist?(repositories.locate(a)) }.to(true)
|
142
|
+
read(repositories.locate(a)).should eql('foo')
|
143
|
+
end
|
132
144
|
end
|
133
145
|
|
134
146
|
|
@@ -282,11 +294,63 @@ describe Repositories, 'remote' do
|
|
282
294
|
and_return { fail URI::NotFoundError }
|
283
295
|
URI.should_receive(:download).twice.with(uri(/2.1-SNAPSHOT\/maven-metadata.xml$/), duck_type(:write)).
|
284
296
|
and_return { |uri, target, options| target.write(metadata) }
|
285
|
-
URI.should_receive(:download).twice.with(uri(/2.1-SNAPSHOT\/library-2.1-20071012.190008-8.(jar|pom)$/), /2.1-SNAPSHOT\/library-2.1-SNAPSHOT.(jar|pom)$/).
|
297
|
+
URI.should_receive(:download).twice.with(uri(/2.1-SNAPSHOT\/library-2.1-20071012.190008-8.(jar|pom)$/), /2.1-SNAPSHOT\/library-2.1-SNAPSHOT.(jar|pom).(\d){1,}$/).
|
286
298
|
and_return { |uri, target, options| write target }
|
287
299
|
lambda { artifact('com.example:library:jar:2.1-SNAPSHOT').invoke }.
|
288
300
|
should change { File.exist?(File.join(repositories.local, 'com/example/library/2.1-SNAPSHOT/library-2.1-SNAPSHOT.jar')) }.to(true)
|
289
301
|
end
|
302
|
+
|
303
|
+
it 'should fail resolving m2-style deployed snapshots if a timestamp is missing' do
|
304
|
+
metadata = <<-XML
|
305
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
306
|
+
<metadata>
|
307
|
+
<groupId>com.example</groupId>
|
308
|
+
<artifactId>library</artifactId>
|
309
|
+
<version>2.1-SNAPSHOT</version>
|
310
|
+
<versioning>
|
311
|
+
<snapshot>
|
312
|
+
<buildNumber>8</buildNumber>
|
313
|
+
</snapshot>
|
314
|
+
<lastUpdated>20071012190008</lastUpdated>
|
315
|
+
</versioning>
|
316
|
+
</metadata>
|
317
|
+
XML
|
318
|
+
repositories.remote = 'http://example.com'
|
319
|
+
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/library-2.1-SNAPSHOT.(jar|pom)$/), anything()).
|
320
|
+
and_return { fail URI::NotFoundError }
|
321
|
+
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/maven-metadata.xml$/), duck_type(:write)).
|
322
|
+
and_return { |uri, target, options| target.write(metadata) }
|
323
|
+
lambda {
|
324
|
+
lambda { artifact('com.example:library:jar:2.1-SNAPSHOT').invoke }.should raise_error(RuntimeError, /Failed to download/)
|
325
|
+
}.should show_error "No timestamp provided for the snapshot com.example:library:jar:2.1-SNAPSHOT"
|
326
|
+
File.exist?(File.join(repositories.local, 'com/example/library/2.1-SNAPSHOT/library-2.1-SNAPSHOT.jar')).should be_false
|
327
|
+
end
|
328
|
+
|
329
|
+
it 'should fail resolving m2-style deployed snapshots if a build number is missing' do
|
330
|
+
metadata = <<-XML
|
331
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
332
|
+
<metadata>
|
333
|
+
<groupId>com.example</groupId>
|
334
|
+
<artifactId>library</artifactId>
|
335
|
+
<version>2.1-SNAPSHOT</version>
|
336
|
+
<versioning>
|
337
|
+
<snapshot>
|
338
|
+
<timestamp>20071012.190008</timestamp>
|
339
|
+
</snapshot>
|
340
|
+
<lastUpdated>20071012190008</lastUpdated>
|
341
|
+
</versioning>
|
342
|
+
</metadata>
|
343
|
+
XML
|
344
|
+
repositories.remote = 'http://example.com'
|
345
|
+
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/library-2.1-SNAPSHOT.(jar|pom)$/), anything()).
|
346
|
+
and_return { fail URI::NotFoundError }
|
347
|
+
URI.should_receive(:download).once.with(uri(/2.1-SNAPSHOT\/maven-metadata.xml$/), duck_type(:write)).
|
348
|
+
and_return { |uri, target, options| target.write(metadata) }
|
349
|
+
lambda {
|
350
|
+
lambda { artifact('com.example:library:jar:2.1-SNAPSHOT').invoke }.should raise_error(RuntimeError, /Failed to download/)
|
351
|
+
}.should show_error "No build number provided for the snapshot com.example:library:jar:2.1-SNAPSHOT"
|
352
|
+
File.exist?(File.join(repositories.local, 'com/example/library/2.1-SNAPSHOT/library-2.1-SNAPSHOT.jar')).should be_false
|
353
|
+
end
|
290
354
|
|
291
355
|
it 'should handle missing maven metadata by reporting the artifact unavailable' do
|
292
356
|
repositories.remote = 'http://example.com'
|
@@ -401,7 +465,11 @@ end
|
|
401
465
|
|
402
466
|
|
403
467
|
describe Buildr, '#artifact' do
|
404
|
-
before
|
468
|
+
before do
|
469
|
+
@spec = { :group=>'com.example', :id=>'library', :type=>'jar', :version=>'2.0' }
|
470
|
+
@snapshot_spec = 'group:id:jar:1.0-SNAPSHOT'
|
471
|
+
write @file = 'testartifact.jar'
|
472
|
+
end
|
405
473
|
|
406
474
|
it 'should accept hash specification' do
|
407
475
|
artifact(:group=>'com.example', :id=>'library', :type=>'jar', :version=>'2.0').should respond_to(:invoke)
|
@@ -488,6 +556,57 @@ describe Buildr, '#artifact' do
|
|
488
556
|
Buildr.application.send(:load_artifact_ns)
|
489
557
|
artifact(:j2ee).to_s.pathmap('%f').should == 'geronimo-spec-j2ee-1.4-rc4.jar'
|
490
558
|
end
|
559
|
+
|
560
|
+
it 'should try to download snapshot artifact' do
|
561
|
+
run_with_repo
|
562
|
+
snapshot = artifact(@snapshot_spec)
|
563
|
+
|
564
|
+
URI.should_receive(:download).at_least(:twice).and_return { |uri, target, options| write target }
|
565
|
+
FileUtils.should_receive(:mv).at_least(:twice)
|
566
|
+
snapshot.invoke
|
567
|
+
end
|
568
|
+
|
569
|
+
it 'should not try to update snapshot in offline mode if it exists' do
|
570
|
+
run_with_repo
|
571
|
+
snapshot = artifact(@snapshot_spec)
|
572
|
+
write snapshot.to_s
|
573
|
+
Buildr.application.options.work_offline = true
|
574
|
+
URI.should_receive(:download).exactly(0).times
|
575
|
+
snapshot.invoke
|
576
|
+
end
|
577
|
+
|
578
|
+
it 'should download snapshot even in offline mode if it doesn''t exist' do
|
579
|
+
run_with_repo
|
580
|
+
snapshot = artifact(@snapshot_spec)
|
581
|
+
Buildr.application.options.work_offline = true
|
582
|
+
URI.should_receive(:download).exactly(2).times
|
583
|
+
snapshot.invoke
|
584
|
+
end
|
585
|
+
|
586
|
+
it 'should update snapshots if --update-snapshots' do
|
587
|
+
run_with_repo
|
588
|
+
snapshot = artifact(@snapshot_spec)
|
589
|
+
Buildr.application.options.update_snapshots = true
|
590
|
+
|
591
|
+
URI.should_receive(:download).at_least(:twice).and_return { |uri, target, options| write target }
|
592
|
+
FileUtils.should_receive(:mv).at_least(:twice)
|
593
|
+
snapshot.invoke
|
594
|
+
end
|
595
|
+
|
596
|
+
it 'should update snapshot if it''s older than 24 hours' do
|
597
|
+
run_with_repo
|
598
|
+
snapshot = artifact(@snapshot_spec)
|
599
|
+
write snapshot.to_s
|
600
|
+
time = Time.at((Time.now - (60 * 60 * 24) - 10 ).to_i)
|
601
|
+
File.utime(time, time, snapshot.to_s)
|
602
|
+
URI.should_receive(:download).at_least(:once).and_return { |uri, target, options| write target }
|
603
|
+
snapshot.invoke
|
604
|
+
end
|
605
|
+
|
606
|
+
def run_with_repo
|
607
|
+
repositories.remote = 'http://example.com'
|
608
|
+
end
|
609
|
+
|
491
610
|
end
|
492
611
|
|
493
612
|
|
@@ -578,6 +697,7 @@ describe Buildr, '#install' do
|
|
578
697
|
before do
|
579
698
|
@spec = 'group:id:jar:1.0'
|
580
699
|
write @file = 'test.jar'
|
700
|
+
@snapshot_spec = 'group:id:jar:1.0-SNAPSHOT'
|
581
701
|
end
|
582
702
|
|
583
703
|
it 'should return the install task' do
|
@@ -600,13 +720,44 @@ describe Buildr, '#install' do
|
|
600
720
|
write artifact(@spec).to_s # install a version of the artifact
|
601
721
|
old_mtime = File.mtime(artifact(@spec).to_s)
|
602
722
|
sleep 1; write @file # make sure the "from" file has newer modification time
|
603
|
-
lambda { install.invoke }.should change {
|
723
|
+
lambda { install.invoke }.should change { modified?(old_mtime, @spec) }.to(true)
|
724
|
+
end
|
725
|
+
|
726
|
+
it 'should re-install snapshot artifact when "from" is newer' do
|
727
|
+
install artifact(@snapshot_spec).from(@file)
|
728
|
+
write artifact(@snapshot_spec).to_s # install a version of the artifact
|
729
|
+
old_mtime = File.mtime(artifact(@snapshot_spec).to_s)
|
730
|
+
sleep 1; write @file # make sure the "from" file has newer modification time
|
731
|
+
lambda { install.invoke }.should change { modified?(old_mtime, @snapshot_spec) }.to(true)
|
732
|
+
end
|
733
|
+
|
734
|
+
it 'should download snapshot to temporary location' do
|
735
|
+
repositories.remote = 'http://example.com'
|
736
|
+
snapshot = artifact(@snapshot_spec)
|
737
|
+
same_time = Time.new
|
738
|
+
download_file = "#{Dir.tmpdir}/#{File.basename(snapshot.name)}#{same_time.to_i}"
|
739
|
+
|
740
|
+
Time.should_receive(:new).twice.and_return(same_time)
|
741
|
+
URI.should_receive(:download).at_least(:twice).and_return { |uri, target, options| write target }
|
742
|
+
FileUtils.should_receive(:mv).at_least(:twice)
|
743
|
+
snapshot.invoke
|
604
744
|
end
|
605
745
|
|
606
746
|
it 'should install POM alongside artifact' do
|
747
|
+
pom = artifact(@spec).pom
|
748
|
+
write @file
|
749
|
+
install artifact(@spec).from(@file)
|
750
|
+
lambda { install.invoke }.should change { File.exist?(repositories.locate(pom)) }.to(true)
|
751
|
+
end
|
752
|
+
|
753
|
+
it 'should reinstall POM alongside artifact' do
|
754
|
+
pom = artifact(@spec).pom
|
607
755
|
write @file
|
756
|
+
write repositories.locate(pom)
|
757
|
+
sleep 1
|
758
|
+
|
608
759
|
install artifact(@spec).from(@file)
|
609
|
-
lambda { install.invoke }.should change { File.
|
760
|
+
lambda { install.invoke }.should change { File.mtime(repositories.locate(pom)) }
|
610
761
|
end
|
611
762
|
end
|
612
763
|
|
@@ -743,6 +894,41 @@ describe Rake::Task, ' artifacts:sources' do
|
|
743
894
|
end
|
744
895
|
end
|
745
896
|
|
897
|
+
describe Rake::Task, ' artifacts:javadoc' do
|
898
|
+
|
899
|
+
before do
|
900
|
+
task('artifacts:javadoc').clear
|
901
|
+
repositories.remote = 'http://example.com'
|
902
|
+
end
|
903
|
+
|
904
|
+
it 'should download javadoc for all specified artifacts' do
|
905
|
+
artifact 'group:id:jar:1.0'
|
906
|
+
URI.should_receive(:download).any_number_of_times.and_return { |uri, target| write target }
|
907
|
+
lambda { task('artifacts:javadoc').invoke }.should change { File.exist?('home/.m2/repository/group/id/1.0/id-1.0-javadoc.jar') }.to(true)
|
908
|
+
end
|
909
|
+
|
910
|
+
it "should not try to download javadoc for the project's artifacts" do
|
911
|
+
define('foo', :version=>'1.0') { package(:jar) }
|
912
|
+
URI.should_not_receive(:download)
|
913
|
+
task('artifacts:javadoc').invoke
|
914
|
+
end
|
915
|
+
|
916
|
+
describe 'when the javadoc artifact does not exist' do
|
917
|
+
|
918
|
+
before do
|
919
|
+
artifact 'group:id:jar:1.0'
|
920
|
+
URI.should_receive(:download).any_number_of_times.and_raise(URI::NotFoundError)
|
921
|
+
end
|
922
|
+
|
923
|
+
it 'should not fail' do
|
924
|
+
lambda { task('artifacts:javadoc').invoke }.should_not raise_error
|
925
|
+
end
|
926
|
+
|
927
|
+
it 'should inform the user' do
|
928
|
+
lambda { task('artifacts:javadoc').invoke }.should show_info('Failed to download group:id:jar:javadoc:1.0. Skipping it.')
|
929
|
+
end
|
930
|
+
end
|
931
|
+
end
|
746
932
|
|
747
933
|
describe Buildr, '#transitive' do
|
748
934
|
before do
|
@@ -858,3 +1044,7 @@ XML
|
|
858
1044
|
transitive(@transitive).should eql(artifacts(@transitive, @complex, @simple - [@provided]))
|
859
1045
|
end
|
860
1046
|
end
|
1047
|
+
|
1048
|
+
def modified?(old_mtime, spec)
|
1049
|
+
File.exist?(artifact(spec).to_s) && old_mtime < File.mtime(artifact(spec).to_s)
|
1050
|
+
end
|
@@ -14,8 +14,8 @@
|
|
14
14
|
# the License.
|
15
15
|
|
16
16
|
|
17
|
-
require File.join(File.dirname(__FILE__), '
|
18
|
-
require File.join(File.dirname(__FILE__), 'packaging_helper')
|
17
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
|
18
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'packaging_helper'))
|
19
19
|
|
20
20
|
|
21
21
|
describe Project, '#group' do
|
@@ -263,7 +263,7 @@ describe Project, '#package' do
|
|
263
263
|
end
|
264
264
|
project('foo').packages.uniq.size.should be(5)
|
265
265
|
end
|
266
|
-
|
266
|
+
|
267
267
|
it 'should create different tasks for package with different ids' do
|
268
268
|
define 'foo', :version=>'1.0' do
|
269
269
|
package(:jar, :id=>'bar')
|
@@ -271,7 +271,7 @@ describe Project, '#package' do
|
|
271
271
|
end
|
272
272
|
project('foo').packages.uniq.size.should be(2)
|
273
273
|
end
|
274
|
-
|
274
|
+
|
275
275
|
it 'should create different tasks for package with classifier' do
|
276
276
|
define 'foo', :version=>'1.0' do
|
277
277
|
package(:jar)
|
@@ -347,10 +347,10 @@ describe Project, '#package' do
|
|
347
347
|
end
|
348
348
|
end
|
349
349
|
|
350
|
-
it 'should create a POM artifact in
|
350
|
+
it 'should create a POM artifact in target directory' do
|
351
351
|
define 'foo', :version=>'1.0' do
|
352
352
|
package.pom.should be(artifact('foo:foo:pom:1.0'))
|
353
|
-
|
353
|
+
package.pom.to_s.should point_to_path('target/foo-1.0.pom')
|
354
354
|
end
|
355
355
|
end
|
356
356
|
|
@@ -662,15 +662,15 @@ describe Rake::Task, ' upload' do
|
|
662
662
|
read(upload).should eql(read(package))
|
663
663
|
end
|
664
664
|
end
|
665
|
-
|
665
|
+
|
666
666
|
it 'should not upload twice the pom when artifacts are uploaded from a project' do
|
667
667
|
write 'src/main/java/Foo.java', 'public class Foo {}'
|
668
668
|
repositories.release_to = 'sftp://example.com/base'
|
669
|
-
define 'foo' do
|
670
|
-
project.group = "attached"
|
671
|
-
project.version = "1.0"
|
672
|
-
package(:jar)
|
673
|
-
package(:sources)
|
669
|
+
define 'foo' do
|
670
|
+
project.group = "attached"
|
671
|
+
project.version = "1.0"
|
672
|
+
package(:jar)
|
673
|
+
package(:sources)
|
674
674
|
end
|
675
675
|
URI.should_receive(:upload).exactly(:once).
|
676
676
|
with(URI.parse('sftp://example.com/base/attached/foo/1.0/foo-1.0-sources.jar'), project("foo").package(:sources).to_s, anything)
|
data/spec/sandbox.rb
CHANGED
@@ -21,15 +21,20 @@ Buildr.application.instance_eval { @rakefile = File.expand_path('buildfile') }
|
|
21
21
|
repositories.remote << 'http://repo1.maven.org/maven2'
|
22
22
|
repositories.remote << 'http://scala-tools.org/repo-releases'
|
23
23
|
|
24
|
-
# Force Scala 2.
|
25
|
-
Buildr.settings.build['scala.version'] = "2.
|
24
|
+
# Force Scala 2.8.0 for specs; don't want to rely on SCALA_HOME
|
25
|
+
Buildr.settings.build['scala.version'] = "2.8.0"
|
26
26
|
|
27
27
|
# Add a 'require' here only for optional extensions, not for extensions that should be loaded by default.
|
28
28
|
require 'buildr/groovy'
|
29
29
|
require 'buildr/scala'
|
30
30
|
|
31
31
|
Java.load # Anything added to the classpath.
|
32
|
-
artifacts(
|
32
|
+
artifacts(
|
33
|
+
TestFramework.frameworks.map(&:dependencies).flatten,
|
34
|
+
JUnit.ant_taskdef,
|
35
|
+
Buildr::Groovy::Groovyc.dependencies,
|
36
|
+
Buildr::Scala::Specs.dependencies
|
37
|
+
).each do |path|
|
33
38
|
file(path).invoke
|
34
39
|
end
|
35
40
|
|
data/spec/scala/bdd_spec.rb
CHANGED
@@ -14,13 +14,13 @@
|
|
14
14
|
# the License.
|
15
15
|
|
16
16
|
|
17
|
-
require File.join(File.dirname(__FILE__), '
|
17
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
|
18
18
|
|
19
19
|
describe Buildr::Scala::Specs do
|
20
20
|
|
21
21
|
before(:each) do
|
22
|
-
# Force Scala 2.
|
23
|
-
Buildr.settings.build['scala.version'] = "2.
|
22
|
+
# Force Scala 2.8.0 for specs; don't want to rely on SCALA_HOME
|
23
|
+
Buildr.settings.build['scala.version'] = "2.8.0"
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'should be the default when tests in src/spec/scala' do
|
data/spec/scala/compiler_spec.rb
CHANGED
@@ -14,16 +14,16 @@
|
|
14
14
|
# the License.
|
15
15
|
|
16
16
|
|
17
|
-
require File.join(File.dirname(__FILE__), '
|
17
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
|
18
18
|
|
19
19
|
# need to test both with and without SCALA_HOME
|
20
20
|
share_as :ScalacCompiler do
|
21
|
-
|
21
|
+
|
22
22
|
before(:each) do
|
23
|
-
# Force Scala 2.
|
24
|
-
Buildr.settings.build['scala.version'] = "2.
|
23
|
+
# Force Scala 2.8.0 for specs; don't want to rely on SCALA_HOME
|
24
|
+
Buildr.settings.build['scala.version'] = "2.8.0"
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
it 'should identify itself from source directories' do
|
28
28
|
write 'src/main/scala/com/example/Test.scala', 'package com.example; class Test { val i = 1 }'
|
29
29
|
define('foo').compile.compiler.should eql(:scalac)
|
@@ -176,8 +176,8 @@ describe 'scalac compiler options' do
|
|
176
176
|
scalac_args.should_not include('-verbose')
|
177
177
|
end
|
178
178
|
|
179
|
-
it 'should use -verbose argument when running with --trace option' do
|
180
|
-
|
179
|
+
it 'should use -verbose argument when running with --trace=scalac option' do
|
180
|
+
Buildr.application.options.trace_categories = [:scalac]
|
181
181
|
scalac_args.should include('-verbose')
|
182
182
|
end
|
183
183
|
|