buildr 1.4.14 → 1.4.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +24 -0
  3. data/_buildr +0 -0
  4. data/_jbuildr +0 -0
  5. data/addon/buildr/bnd.rb +1 -1
  6. data/addon/buildr/git_auto_version.rb +1 -1
  7. data/addon/buildr/gpg.rb +1 -1
  8. data/addon/buildr/jaxb_xjc.rb +4 -2
  9. data/addon/buildr/package_as_nsis.rb +1 -1
  10. data/addon/buildr/sonar.rb +1 -1
  11. data/addon/buildr/top_level_generate_dir.rb +1 -1
  12. data/bin/buildr +0 -0
  13. data/buildr.gemspec +3 -1
  14. data/doc/download.textile +12 -0
  15. data/doc/index.textile +21 -0
  16. data/doc/packaging.textile +8 -0
  17. data/doc/scripts/buildr-git.rb +0 -0
  18. data/doc/scripts/gitflow.rb +0 -0
  19. data/doc/scripts/install-jruby.sh +0 -0
  20. data/doc/scripts/install-linux.sh +0 -0
  21. data/doc/scripts/install-osx.sh +0 -0
  22. data/doc/settings_profiles.textile +1 -0
  23. data/lib/buildr/core/application.rb +12 -0
  24. data/lib/buildr/core/assets.rb +7 -7
  25. data/lib/buildr/core/compile.rb +1 -1
  26. data/lib/buildr/core/console.rb +1 -1
  27. data/lib/buildr/core/progressbar.rb +1 -1
  28. data/lib/buildr/core/util.rb +1 -1
  29. data/lib/buildr/ide/idea.rb +10 -2
  30. data/lib/buildr/java/ecj.rb +1 -1
  31. data/lib/buildr/java/external.rb +1 -1
  32. data/lib/buildr/java/packaging.rb +4 -7
  33. data/lib/buildr/java/tests.rb +1 -1
  34. data/lib/buildr/packaging/archive.rb +2 -1
  35. data/lib/buildr/packaging/artifact.rb +51 -1
  36. data/lib/buildr/packaging/test_jar.rb +1 -1
  37. data/lib/buildr/version.rb +1 -1
  38. data/rakelib/doc.rake +7 -5
  39. data/rakelib/release.rake +11 -4
  40. data/rakelib/stage.rake +2 -2
  41. data/spec/addon/bnd_spec.rb +1 -1
  42. data/spec/addon/jaxb_xjc_spec.rb +4 -4
  43. data/spec/core/cc_spec.rb +2 -1
  44. data/spec/core/common_spec.rb +4 -4
  45. data/spec/core/compile_spec.rb +5 -5
  46. data/spec/core/console_spec.rb +2 -2
  47. data/spec/core/extension_spec.rb +0 -0
  48. data/spec/core/test_spec.rb +2 -2
  49. data/spec/core/transport_spec.rb +21 -19
  50. data/spec/ide/idea_spec.rb +25 -0
  51. data/spec/java/commands_spec.rb +1 -1
  52. data/spec/java/compiler_spec.rb +16 -0
  53. data/spec/java/ecj_spec.rb +2 -10
  54. data/spec/java/emma_spec.rb +1 -1
  55. data/spec/java/external_spec.rb +2 -1
  56. data/spec/java/java_spec.rb +1 -1
  57. data/spec/java/packaging_spec.rb +4 -5
  58. data/spec/java/pom_spec.rb +1 -1
  59. data/spec/java/test_coverage_helper.rb +2 -2
  60. data/spec/packaging/archive_spec.rb +22 -3
  61. data/spec/packaging/artifact_spec.rb +85 -1
  62. data/spec/sandbox.rb +1 -1
  63. data/spec/xpath_matchers.rb +1 -1
  64. metadata +4 -4
@@ -121,4 +121,4 @@ describe Buildr::Emma do
121
121
  end
122
122
  end
123
123
 
124
- end
124
+ end
@@ -26,7 +26,8 @@ describe Buildr::Compiler::ExternalJavac do
26
26
  Buildr::Compiler.send :compilers=, COMPILERS_WITHOUT_JAVAC
27
27
  end
28
28
 
29
- describe "should compile a Java project just in the same way javac does" do
29
+ # Fails sometimes under windows?
30
+ describe "should compile a Java project just in the same way javac does", :retry => 4 do
30
31
  javac_spec = File.read(File.join(File.dirname(__FILE__), "compiler_spec.rb"))
31
32
  javac_spec = javac_spec.match(Regexp.escape("require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))\n")).post_match
32
33
  javac_spec.gsub!("javac", "externaljavac")
@@ -22,7 +22,7 @@ unless RUBY_PLATFORM =~ /java/
22
22
  before do
23
23
  @old_home, ENV['JAVA_HOME'] = ENV['JAVA_HOME'], nil
24
24
  @old_env_java = Object.module_eval { remove_const :ENV_JAVA }
25
- RbConfig::CONFIG.should_receive(:[]).with('host_os').and_return('darwin0.9')
25
+ RbConfig::CONFIG.should_receive(:[]).at_least(:once).with('host_os').and_return('darwin0.9')
26
26
  end
27
27
 
28
28
  it 'should point to default JVM' do
@@ -550,8 +550,7 @@ describe Packaging, 'war' do
550
550
  inspect_war { |files| files.should include('test.html') }
551
551
  end
552
552
 
553
- it 'should accept files from :classes option' do
554
- write 'src/main/java/Test.java', 'class Test {}'
553
+ it 'should accept files from :classes option', :retry => (Buildr::Util.win_os? ? 4 : 1) do
555
554
  write 'classes/test'
556
555
  define('foo', :version=>'1.0') { package(:war).with(:classes=>'classes') }
557
556
  inspect_war { |files| files.should include('WEB-INF/classes/test') }
@@ -1228,11 +1227,11 @@ describe Packaging, 'test_jar' do
1228
1227
  it_should_behave_like 'packaging'
1229
1228
  before { @packaging, @package_type = :test_jar, :jar }
1230
1229
 
1231
- it 'should create package of type :jar and classifier \'test-jar\'' do
1230
+ it 'should create package of type :jar and classifier \'tests\'' do
1232
1231
  define 'foo', :version=>'1.0' do
1233
1232
  package(:test_jar).type.should eql(:jar)
1234
- package(:test_jar).classifier.should eql('test-jar')
1235
- package(:test_jar).name.should match(/foo-1.0-test-jar.jar$/)
1233
+ package(:test_jar).classifier.should eql('tests')
1234
+ package(:test_jar).name.should match(/foo-1.0-tests.jar$/)
1236
1235
  end
1237
1236
  end
1238
1237
 
@@ -122,4 +122,4 @@ XML
122
122
  specs = {"a.version"=>"1.1", "b.version"=>"1.1", "project.groupId"=>"group", "pom.groupId"=>"group", "groupId"=>"group", "project.artifactId"=>"app", "pom.artifactId"=>"app", "artifactId"=>"app"}
123
123
  pom.properties.should eql(specs)
124
124
  end
125
- end
125
+ end
@@ -128,7 +128,7 @@ shared_examples_for 'test coverage tool' do
128
128
  mkpath instrumented_dir.to_s
129
129
  File.utime(a_long_time_ago, a_long_time_ago, instrumented_dir.to_s)
130
130
  task("foo:#{toolname}:instrument").invoke
131
- instrumented_dir.timestamp.should be_close(Time.now, 2)
131
+ instrumented_dir.timestamp.should be_within(2).of(Time.now)
132
132
  end
133
133
 
134
134
  it 'should not touch instrumented directory if nothing instrumented' do
@@ -137,7 +137,7 @@ shared_examples_for 'test coverage tool' do
137
137
  mkpath instrumented_dir.to_s
138
138
  [project('foo').compile.target, instrumented_dir].map(&:to_s).each { |dir| File.utime(a_long_time_ago, a_long_time_ago, dir) }
139
139
  task("foo:#{toolname}:instrument").invoke
140
- instrumented_dir.timestamp.should be_close(a_long_time_ago, 2)
140
+ instrumented_dir.timestamp.should be_within(2).of(a_long_time_ago)
141
141
  end
142
142
  end
143
143
 
@@ -345,7 +345,7 @@ shared_examples_for 'ArchiveTask' do
345
345
  # all included files newer.
346
346
  File.utime Time.now - 100, Time.now - 100, @archive
347
347
  archive(@archive).include(@files).invoke
348
- File.stat(@archive).mtime.should be_close(Time.now, 10)
348
+ File.stat(@archive).mtime.should be_within(10).of(Time.now)
349
349
  end
350
350
 
351
351
  it 'should update if a file in a subdir is more recent' do
@@ -369,7 +369,7 @@ shared_examples_for 'ArchiveTask' do
369
369
  # By touching all files in the past, there's nothing new to update.
370
370
  (@files + [@archive]).each { |f| File.utime Time.now - 100, Time.now - 100, f }
371
371
  archive(@archive).include(@files).invoke
372
- File.stat(@archive).mtime.should be_close(Time.now - 100, 10)
372
+ File.stat(@archive).mtime.should be_within(10).of(Time.now - 100)
373
373
  end
374
374
 
375
375
  it 'should update if one of the files is recent' do
@@ -392,6 +392,25 @@ shared_examples_for 'ArchiveTask' do
392
392
  archive(@archive).include(@files)
393
393
  lambda { archive(@archive).with :option=>true }.should raise_error
394
394
  end
395
+
396
+ it 'should invoke paths supplied in from parameters' do
397
+ included_file = File.expand_path("somefile.myext")
398
+ write included_file, content_for(included_file)
399
+ archive2_filename = File.expand_path("somebug.zip")
400
+ a2 = zip(archive2_filename).
401
+ include(included_file, :as => 'folder1/somefile1.ext').
402
+ include(included_file, :as => 'folder2/somefile2.ext').
403
+ invoke
404
+ a = archive(@archive)
405
+ f1 = unzip('target/folder1' => archive2_filename).from_path("folder1/*").root
406
+ f2 = unzip('target/folder2' => archive2_filename).from_path("folder2/*").root
407
+ a.include(:from => f1)
408
+ a.include(:from => f2)
409
+ a.invoke
410
+ contents = inspect_archive
411
+ contents["folder1/somefile1.ext"].should_not be_nil
412
+ contents["folder2/somefile2.ext"].should_not be_nil
413
+ end
395
414
  end
396
415
 
397
416
  describe TarTask do
@@ -590,7 +609,7 @@ describe Unzip do
590
609
  File.utime(Time.now - 10, Time.now - 10, @target)
591
610
  unzip(@target=>@zip).target.invoke
592
611
  end
593
- File.stat(@target).mtime.should be_close(Time.now, 2)
612
+ File.stat(@target).mtime.should be_within(2).of(Time.now)
594
613
  end
595
614
 
596
615
  it 'should expand files' do
@@ -510,6 +510,51 @@ describe Repositories, 'release_to' do
510
510
  end
511
511
  end
512
512
 
513
+ describe Repositories, 'snapshot_to' do
514
+ it 'should accept URL as first argument' do
515
+ repositories.snapshot_to = 'http://buildr.apache.org/repository/noexist'
516
+ repositories.snapshot_to.should == { :url=>'http://buildr.apache.org/repository/noexist' }
517
+ end
518
+
519
+ it 'should accept hash with options' do
520
+ repositories.snapshot_to = { :url=>'http://buildr.apache.org/repository/noexist', :username=>'john' }
521
+ repositories.snapshot_to.should == { :url=>'http://buildr.apache.org/repository/noexist', :username=>'john' }
522
+ end
523
+
524
+ it 'should allow the hash to be manipulated' do
525
+ repositories.snapshot_to = 'http://buildr.apache.org/repository/noexist'
526
+ repositories.snapshot_to.should == { :url=>'http://buildr.apache.org/repository/noexist' }
527
+ repositories.snapshot_to[:username] = 'john'
528
+ repositories.snapshot_to.should == { :url=>'http://buildr.apache.org/repository/noexist', :username=>'john' }
529
+ end
530
+
531
+ it 'should load URL from settings file' do
532
+ write 'home/.buildr/settings.yaml', <<-YAML
533
+ repositories:
534
+ snapshot_to: http://john:secret@buildr.apache.org/repository/noexist
535
+ YAML
536
+ repositories.snapshot_to.should == { :url=>'http://john:secret@buildr.apache.org/repository/noexist' }
537
+ end
538
+
539
+ it 'should load URL from build settings file' do
540
+ write 'build.yaml', <<-YAML
541
+ repositories:
542
+ snapshot_to: http://john:secret@buildr.apache.org/repository/noexist
543
+ YAML
544
+ repositories.snapshot_to.should == { :url=>'http://john:secret@buildr.apache.org/repository/noexist' }
545
+ end
546
+
547
+ it 'should load URL, username and password from settings file' do
548
+ write 'home/.buildr/settings.yaml', <<-YAML
549
+ repositories:
550
+ snapshot_to:
551
+ url: http://buildr.apache.org/repository/noexist
552
+ username: john
553
+ password: secret
554
+ YAML
555
+ repositories.snapshot_to.should == { :url=>'http://buildr.apache.org/repository/noexist', :username=>'john', :password=>'secret' }
556
+ end
557
+ end
513
558
 
514
559
  describe Buildr, '#artifact' do
515
560
  before do
@@ -885,7 +930,7 @@ describe ActsAsArtifact, '#upload' do
885
930
  lambda { artifact.upload }.should raise_error(Exception, /where to upload/)
886
931
  end
887
932
 
888
- it 'should accept repositories.upload setting' do
933
+ it 'should accept repositories.release_to setting' do
889
934
  artifact = artifact('com.example:library:jar:2.0')
890
935
  # Prevent artifact from downloading anything.
891
936
  write repositories.locate(artifact)
@@ -896,6 +941,45 @@ describe ActsAsArtifact, '#upload' do
896
941
  lambda { artifact.upload }.should_not raise_error
897
942
  end
898
943
 
944
+ it 'should use repositories.release_to setting even for snapshots when snapshot_to is not set' do
945
+ artifact = artifact('com.example:library:jar:2.0-SNAPSHOT')
946
+ # Prevent artifact from downloading anything.
947
+ write repositories.locate(artifact)
948
+ write repositories.locate(artifact.pom)
949
+ URI.should_receive(:upload).once.
950
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/com/example/library/2.0-SNAPSHOT/library-2.0-SNAPSHOT.pom'), artifact.pom.to_s, anything)
951
+ URI.should_receive(:upload).once.
952
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/base/com/example/library/2.0-SNAPSHOT/library-2.0-SNAPSHOT.jar'), artifact.to_s, anything)
953
+ repositories.release_to = 'sftp://buildr.apache.org/repository/noexist/base'
954
+ artifact.upload
955
+ lambda { artifact.upload }.should_not raise_error
956
+ end
957
+
958
+ it 'should use repositories.snapshot_to setting when snapshot_to is set' do
959
+ artifact = artifact('com.example:library:jar:2.0-SNAPSHOT')
960
+ # Prevent artifact from downloading anything.
961
+ write repositories.locate(artifact)
962
+ write repositories.locate(artifact.pom)
963
+ URI.should_receive(:upload).once.
964
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/snapshot/com/example/library/2.0-SNAPSHOT/library-2.0-SNAPSHOT.pom'), artifact.pom.to_s, anything)
965
+ URI.should_receive(:upload).once.
966
+ with(URI.parse('sftp://buildr.apache.org/repository/noexist/snapshot/com/example/library/2.0-SNAPSHOT/library-2.0-SNAPSHOT.jar'), artifact.to_s, anything)
967
+ repositories.release_to = 'sftp://buildr.apache.org/repository/noexist/base'
968
+ repositories.snapshot_to = 'sftp://buildr.apache.org/repository/noexist/snapshot'
969
+ artifact.upload
970
+ lambda { artifact.upload }.should_not raise_error
971
+ end
972
+
973
+ it 'should complain when only a snapshot repo is set but the artifact is not a snapshot' do
974
+ artifact = artifact('com.example:library:jar:2.0')
975
+ # Prevent artifact from downloading anything.
976
+ write repositories.locate(artifact)
977
+ write repositories.locate(artifact.pom)
978
+ repositories.snapshot_to = 'sftp://buildr.apache.org/repository/noexist/snapshot'
979
+ lambda { artifact.upload }.should raise_error(Exception, /where to upload/)
980
+ end
981
+
982
+
899
983
  end
900
984
 
901
985
 
@@ -162,7 +162,7 @@ module Sandbox
162
162
  # since we don't want to remotely download artifacts into the sandbox over and over
163
163
  Buildr.repositories.instance_eval do
164
164
  @remote = ["file://" + @local]
165
- @local = @release_to = nil
165
+ @local = @release_to = @snapshot_to = nil
166
166
  end
167
167
  Buildr.options.proxy.http = nil
168
168
 
@@ -118,4 +118,4 @@ module RSpec
118
118
  end
119
119
 
120
120
  end
121
- end
121
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.14
4
+ version: 1.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apache Buildr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-10 00:00:00.000000000 Z
11
+ date: 2013-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -282,14 +282,14 @@ dependencies:
282
282
  requirements:
283
283
  - - '='
284
284
  - !ruby/object:Gem::Version
285
- version: 1.2.1
285
+ version: 0.11.2
286
286
  type: :development
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
289
289
  requirements:
290
290
  - - '='
291
291
  - !ruby/object:Gem::Version
292
- version: 1.2.1
292
+ version: 0.11.2
293
293
  - !ruby/object:Gem::Dependency
294
294
  name: RedCloth
295
295
  requirement: !ruby/object:Gem::Requirement