buildr 1.5.6 → 1.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +36 -0
  3. data/README.rdoc +2 -2
  4. data/Rakefile +1 -1
  5. data/addon/buildr/gwt.rb +4 -7
  6. data/addon/buildr/jetty.rb +1 -1
  7. data/buildr.buildfile +2 -3
  8. data/buildr.gemspec +2 -1
  9. data/doc/_layouts/default.html +1 -1
  10. data/doc/artifacts.textile +2 -2
  11. data/doc/download.textile +30 -6
  12. data/doc/index.textile +28 -37
  13. data/doc/installing.textile +2 -2
  14. data/doc/projects.textile +1 -1
  15. data/doc/quick_start.textile +3 -3
  16. data/lib/buildr/core/generate.rb +2 -2
  17. data/lib/buildr/core/project.rb +2 -2
  18. data/lib/buildr/core/transports.rb +1 -1
  19. data/lib/buildr/ide/idea.rb +38 -16
  20. data/lib/buildr/java/custom_pom.rb +0 -5
  21. data/lib/buildr/java/doc.rb +2 -0
  22. data/lib/buildr/java/tests.rb +4 -4
  23. data/lib/buildr/kotlin/compiler.rb +3 -3
  24. data/lib/buildr/kotlin/org/apache/buildr/KotlinMessageCollector.java +4 -4
  25. data/lib/buildr/packaging/archive.rb +5 -5
  26. data/lib/buildr/packaging/artifact.rb +16 -0
  27. data/lib/buildr/packaging/artifact_namespace.rb +8 -7
  28. data/lib/buildr/packaging/artifact_search.rb +1 -1
  29. data/lib/buildr/packaging/gems.rb +0 -1
  30. data/lib/buildr/packaging/tar.rb +5 -5
  31. data/lib/buildr/version.rb +1 -1
  32. data/rakelib/release.rake +2 -2
  33. data/rakelib/rspec.rake +1 -0
  34. data/rakelib/stage.rake +2 -2
  35. data/spec/core/build_spec.rb +2 -2
  36. data/spec/core/checks_spec.rb +1 -1
  37. data/spec/core/compile_spec.rb +2 -2
  38. data/spec/core/shell_spec.rb +1 -1
  39. data/spec/core/transport_spec.rb +1 -0
  40. data/spec/ide/eclipse_spec.rb +1 -1
  41. data/spec/ide/idea_spec.rb +1 -1
  42. data/spec/java/custom_pom_spec.rb +0 -7
  43. data/spec/java/ecj_spec.rb +2 -2
  44. data/spec/java/packaging_spec.rb +3 -3
  45. data/spec/java/test_coverage_helper.rb +1 -1
  46. data/spec/kotlin/compiler_spec.rb +12 -12
  47. data/spec/packaging/archive_spec.rb +3 -3
  48. data/spec/packaging/artifact_spec.rb +5 -12
  49. data/spec/packaging/packaging_helper.rb +1 -1
  50. data/spec/packaging/packaging_spec.rb +0 -5
  51. data/spec/sandbox.rb +1 -1
  52. data/spec/scala/compiler_spec.rb +7 -7
  53. metadata +17 -3
@@ -292,7 +292,7 @@ module Buildr #:nodoc:
292
292
 
293
293
  def dependencies
294
294
  return ["org.testng:testng:jar:jdk15:#{version}"] + JMock.dependencies if version < '6.0'
295
- ["org.testng:testng:jar:#{version}",'com.beust:jcommander:jar:1.27'] + JMock.dependencies
295
+ %W(org.testng:testng:jar:#{version} com.beust:jcommander:jar:1.27) + JMock.dependencies
296
296
  end
297
297
  end
298
298
 
@@ -309,11 +309,11 @@ module Buildr #:nodoc:
309
309
  cmd_args << '-log' << '2'
310
310
  cmd_args << '-d' << task.report_to.to_s
311
311
  exclude_args = options[:excludegroups] || []
312
- if !exclude_args.empty?
312
+ unless exclude_args.empty?
313
313
  cmd_args << '-excludegroups' << exclude_args.join(',')
314
314
  end
315
315
  groups_args = options[:groups] || []
316
- if !groups_args.empty?
316
+ unless groups_args.empty?
317
317
  cmd_args << '-groups' << groups_args.join(',')
318
318
  end
319
319
  # run all tests in the same suite
@@ -376,7 +376,7 @@ module Buildr #:nodoc:
376
376
  def dependencies #:nodoc:
377
377
  unless @dependencies
378
378
  @dependencies = TestFramework::Java.dependencies
379
- @dependencies += @frameworks.map { |f| f.dependencies }.flatten
379
+ @dependencies += @frameworks.map(&:dependencies).flatten
380
380
  end
381
381
  @dependencies
382
382
  end
@@ -140,15 +140,15 @@ module Buildr::Kotlin
140
140
  hash[option] = options[option]
141
141
  hash
142
142
  end
143
-
143
+
144
144
  options[:debug] = Buildr.options.debug || trace?(:kotlinc) if options[:debug].nil?
145
145
  options[:warnings] = verbose if options[:warnings].nil?
146
146
  options[:optimize] = false if options[:optimize].nil?
147
147
  options[:noStdlib] = true if options[:noStdlib].nil?
148
148
  @java = Javac.new(project, options[:javac])
149
149
  end
150
-
151
-
150
+
151
+
152
152
 
153
153
  def compile(sources, target, dependencies) #:nodoc:
154
154
  check_options(options, OPTIONS)
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation;
23
23
 
24
24
 
25
25
  public class KotlinMessageCollector implements MessageCollector {
26
-
26
+
27
27
  public void report(CompilerMessageSeverity severity, String message, CompilerMessageLocation location) {
28
28
  switch(severity) {
29
29
  case ERROR:
@@ -35,12 +35,12 @@ public class KotlinMessageCollector implements MessageCollector {
35
35
  break;
36
36
  }
37
37
  }
38
-
38
+
39
39
  public boolean hasErrors() {
40
40
  return false;
41
41
  }
42
-
42
+
43
43
  public void clear() {
44
44
  // not implemented
45
45
  }
46
- }
46
+ }
@@ -267,12 +267,12 @@ module Buildr #:nodoc:
267
267
  @expanders.each { |expander| expander.exclude(*files) }
268
268
  self
269
269
  end
270
-
270
+
271
271
  def concatenate(*files)
272
272
  @expanders.each { |expander| expander.concatenate(*files) }
273
273
  self
274
274
  end
275
-
275
+
276
276
  def transform(*files, &block)
277
277
  @expanders.each { |expander| expander.transform(*files, &block) }
278
278
  self
@@ -301,12 +301,12 @@ module Buildr #:nodoc:
301
301
  @excludes |= files
302
302
  self
303
303
  end
304
-
304
+
305
305
  def concatenate(*files)
306
306
  @concatenates |= files
307
307
  self
308
308
  end
309
-
309
+
310
310
  def transform(*files, &block)
311
311
  @transforms[[files].flatten] = block
312
312
  self
@@ -325,7 +325,7 @@ module Buildr #:nodoc:
325
325
  elsif @transforms.each_pair.detect do |transform, transform_block|\
326
326
  if transform.any? { |pattern| File.fnmatch(pattern, entry.name) }
327
327
  file_map[dest] << ZipEntryData.new(source, entry)
328
-
328
+
329
329
  transform_map[dest] = transform_block
330
330
  true
331
331
  end
@@ -21,6 +21,9 @@ module Buildr #:nodoc:
21
21
  desc "Download all artifacts' sources"
22
22
  task 'artifacts:sources'
23
23
 
24
+ desc "Download all artifacts' external annotations"
25
+ task 'artifacts:annotations'
26
+
24
27
  desc "Download all artifacts' javadoc"
25
28
  task 'artifacts:javadoc'
26
29
 
@@ -142,6 +145,18 @@ module Buildr #:nodoc:
142
145
  javadoc_task
143
146
  end
144
147
 
148
+ # :call-seq:
149
+ # annotations_artifact => Artifact
150
+ #
151
+ # Convenience method that returns an annotations artifact. The annotations artifact is used by
152
+ # Intellij IDEA as a source of external annotations.
153
+ def annotations_artifact
154
+ annotations_spec = to_spec_hash.merge(:classifier=>'annotations')
155
+ annotations_task = OptionalArtifact.define_task(Buildr.repositories.locate(annotations_spec))
156
+ annotations_task.send :apply_spec, annotations_spec
157
+ annotations_task
158
+ end
159
+
145
160
  # :call-seq:
146
161
  # pom_xml => string
147
162
  #
@@ -948,6 +963,7 @@ module Buildr #:nodoc:
948
963
  unless spec[:type] == :pom
949
964
  Rake::Task['artifacts:sources'].enhance [task.sources_artifact]
950
965
  Rake::Task['artifacts:javadoc'].enhance [task.javadoc_artifact]
966
+ Rake::Task['artifacts:annotations'].enhance [task.annotations_artifact]
951
967
  end
952
968
  end
953
969
  task.enhance &block
@@ -130,7 +130,7 @@ module Buildr #:nodoc:
130
130
  # Sometimes users would need to change the default artifact versions used by some
131
131
  # module, for example, the XMLBeans compiler needs this, because of compatibility
132
132
  # issues. Another example would be to select the groovy version to use on all our
133
- # projects so that Buildr modules requiring groovy jars can use user prefered versions.
133
+ # projects so that Buildr modules requiring groovy jars can use user preferred versions.
134
134
  #
135
135
  # To meet this goal, an ArtifactNamespace allows to specify ArtifactRequirement objects.
136
136
  # In fact the only difference with the examples you have already seen is that requirements
@@ -194,7 +194,7 @@ module Buildr #:nodoc:
194
194
  #
195
195
  # A more advanced example using ArtifactRequirement listeners is included
196
196
  # in the artifact_namespace_spec.rb description for 'Extension using ArtifactNamespace'
197
- # That's it for addon writers, now, users can select their prefered version with
197
+ # That's it for addon writers, now, users can select their preferred version with
198
198
  # something like:
199
199
  #
200
200
  # require 'buildr/xmlbeans'
@@ -413,7 +413,7 @@ module Buildr #:nodoc:
413
413
  # The last part consist of a VersionRequirement.
414
414
  # -> ( >2 & <4)
415
415
  #
416
- # VersionRequirement supports RubyGem's comparision operators
416
+ # VersionRequirement supports RubyGem's comparison operators
417
417
  # in adition to parens, logical and, logical or and negation.
418
418
  # See the docs for VersionRequirement for more info on operators.
419
419
  def initialize(spec)
@@ -720,10 +720,10 @@ module Buildr #:nodoc:
720
720
  previous = get(unvers, false) || get(name, false)
721
721
  if previous # have previous on current namespace
722
722
  if previous.requirement # we must satisfy the requirement
723
- unless unvers # we only have the version
724
- satisfied = previous.requirement.satisfied_by?(artifact.version)
725
- else
723
+ if unvers
726
724
  satisfied = previous.satisfied_by?(artifact)
725
+ else # we only have the version
726
+ satisfied = previous.requirement.satisfied_by?(artifact.version)
727
727
  end
728
728
  raise "Unsatisfied dependency #{previous} " +
729
729
  "not satisfied by #{artifact}" unless satisfied
@@ -961,6 +961,7 @@ module Buildr #:nodoc:
961
961
 
962
962
  private
963
963
  def get(name, include_parents = true, include_subs = true, include_self = true) #:nodoc:
964
+ artifact = nil
964
965
  if include_subs && name.to_s[/_/] # try sub namespaces first
965
966
  sub, parts = self, name.to_s.split('_')
966
967
  sub_name = parts.shift.to_sym
@@ -980,7 +981,7 @@ module Buildr #:nodoc:
980
981
  artifact = registry.parent.get(name, true)
981
982
  end
982
983
  end
983
- artifact = artifact.call if artifact.respond_to?(:call)
984
+ artifact = artifact.call if artifact && artifact.respond_to?(:call)
984
985
  artifact
985
986
  end
986
987
 
@@ -96,7 +96,7 @@ module Buildr #:nodoc:
96
96
 
97
97
  def remote_versions(art, base, from = :metadata, fallback = true)
98
98
  path = (art[:group].split(/\./) + [art[:id]]).flatten.join('/')
99
- base ||= "http://mirrors.ibiblio.org/pub/mirrors/maven2"
99
+ base ||= "https://repo1.maven.org/maven2"
100
100
  uris = {:metadata => "#{base}/#{path}/maven-metadata.xml"}
101
101
  uris[:listing] = "#{base}/#{path}/" if base =~ /^https?:/
102
102
  xml = nil
@@ -65,7 +65,6 @@ module Buildr #:nodoc:
65
65
  spec.name = id
66
66
  spec.version = version.gsub('-','.') # RubyGems doesn't like '-' in version numbers
67
67
  spec.summary = full_comment
68
- spec.has_rdoc = true
69
68
  spec.rdoc_options << '--title' << comment
70
69
  spec.require_path = 'lib'
71
70
  end
@@ -99,7 +99,7 @@ module Buildr #:nodoc:
99
99
  tar.mkdir(path, options.merge(:mode=>stat.mode, :mtime=>stat.mtime, :uid=>stat.uid, :gid=>stat.gid))
100
100
  else
101
101
  contents = [contents].flatten
102
-
102
+
103
103
  combined_options = options
104
104
  if File.exists?(contents.first.to_s)
105
105
  stat = File.stat(contents.first.to_s)
@@ -107,8 +107,8 @@ module Buildr #:nodoc:
107
107
  elsif contents.first.respond_to?(:mode)
108
108
  combined_options = combined_options.merge(:mode => contents.first.mode)
109
109
  end
110
-
111
-
110
+
111
+
112
112
  tar.add_file path, combined_options do |os, opts|
113
113
  [contents].flatten.each do |content|
114
114
  if content.respond_to?(:call)
@@ -120,7 +120,7 @@ module Buildr #:nodoc:
120
120
  content.call os
121
121
  end
122
122
  else
123
- File.open content.to_s, 'rb' do |is|
123
+ File.open content.to_s, 'rb' do |is|
124
124
  if transform
125
125
  output = StringIO.new
126
126
  while data = is.read(4096)
@@ -140,7 +140,7 @@ module Buildr #:nodoc:
140
140
  end
141
141
  end
142
142
  end
143
-
143
+
144
144
  end
145
145
  end
146
146
  end
@@ -14,5 +14,5 @@
14
14
  # the License.
15
15
 
16
16
  module Buildr #:nodoc:
17
- VERSION = '1.5.6'.freeze
17
+ VERSION = '1.5.8'.freeze
18
18
  end
data/rakelib/release.rake CHANGED
@@ -13,7 +13,7 @@
13
13
  # License for the specific language governing permissions and limitations under
14
14
  # the License.
15
15
 
16
- RC_VERSION = ENV['RC_VERSION'] || ''
16
+ RC_VERSION = ENV['RC_VERSION'] || '' unless defined?(RC_VERSION)
17
17
 
18
18
  desc 'Release the next version of buildr from existing staged repository'
19
19
  task 'release' do
@@ -132,7 +132,7 @@ DOAP
132
132
  lambda do
133
133
  changes = File.read("_release/#{spec.version}/CHANGES")[/.*?\n(.*)/m, 1]
134
134
  email = <<-EMAIL
135
- To: users@buildr.apache.org, announce@apache.org
135
+ To: users@buildr.apache.org
136
136
  Subject: [ANNOUNCE] Apache Buildr #{spec.version} released
137
137
 
138
138
  #{spec.description}
data/rakelib/rspec.rake CHANGED
@@ -36,6 +36,7 @@ RSpec::Core::RakeTask.new :spec => ['_reports', :compile] do |task|
36
36
  ENV['USE_FSC'] = 'no'
37
37
  files = FileList['spec/**/*_spec.rb']
38
38
  files = files.delete_if {|f| f =~ /^spec\/groovy\//} if RUBY_PLATFORM[/java/]
39
+ task.rspec_path = 'bundle exec rspec'
39
40
  task.rspec_files = files
40
41
  task.rspec_opts = %w{--order random:123 --format html --out _reports/specs.html --backtrace}
41
42
  end
data/rakelib/stage.rake CHANGED
@@ -18,8 +18,8 @@ require 'digest/sha1'
18
18
 
19
19
  gpg_cmd = 'gpg2'
20
20
 
21
- STAGE_DATE = ENV['STAGE_DATE'] || Time.now.strftime('%Y-%m-%d')
22
- RC_VERSION = ENV['RC_VERSION'] || ''
21
+ STAGE_DATE = ENV['STAGE_DATE'] || Time.now.strftime('%Y-%m-%d') unless defined?(STAGE_DATE)
22
+ RC_VERSION = ENV['RC_VERSION'] || '' unless defined?(RC_VERSION)
23
23
 
24
24
  task 'prepare' do
25
25
  # Update source files to next release number.
@@ -16,7 +16,7 @@
16
16
 
17
17
  require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
18
18
 
19
- shared_examples_for 'local task' do
19
+ RSpec.shared_examples 'local task' do
20
20
  it "should execute task for project in current directory" do
21
21
  define 'foobar'
22
22
  lambda { @task.invoke }.should run_task("foobar:#{@task.name}")
@@ -387,7 +387,7 @@ describe Release do
387
387
  end
388
388
 
389
389
 
390
- shared_examples_for 'a release process' do
390
+ RSpec.shared_examples 'a release process' do
391
391
 
392
392
  describe '#make' do
393
393
  before do
@@ -343,7 +343,7 @@ end
343
343
 
344
344
  describe Buildr::Checks::Expectation do
345
345
 
346
- shared_examples_for 'all archive types' do
346
+ RSpec.shared_examples 'all archive types' do
347
347
 
348
348
  before do
349
349
  archive = @archive
@@ -141,7 +141,7 @@ describe Buildr::CompileTask, '#compiler' do
141
141
  end
142
142
  end
143
143
 
144
- it 'should allow supressing compilation' do
144
+ it 'should allow suppressing compilation' do
145
145
  write 'src/main/java/package/Test.java', 'class Test {}'
146
146
  define 'foo' do
147
147
  compile.sources.clear
@@ -428,7 +428,7 @@ describe Buildr::CompileTask, '#invoke' do
428
428
  end
429
429
 
430
430
 
431
- shared_examples_for 'accessor task' do
431
+ RSpec.shared_examples 'accessor task' do
432
432
  it 'should return a task' do
433
433
  define('foo').send(@task_name).should be_kind_of(Rake::Task)
434
434
  end
@@ -102,7 +102,7 @@ describe Project, '.shell' do
102
102
  end
103
103
  end
104
104
 
105
- shared_examples_for "shell provider" do
105
+ RSpec.shared_examples "shell provider" do
106
106
 
107
107
  it 'should have launch method accepting shell task' do
108
108
  @instance.method(:launch).should_not be_nil
@@ -375,6 +375,7 @@ describe URI::HTTP, '#write' do
375
375
  @uri = URI('http://john:secret@host.domain/foo/bar/baz.jar')
376
376
  @http = double('Net::HTTP')
377
377
  @http.stub(:request).and_return(Net::HTTPOK.new(nil, nil, nil))
378
+ @http.should_receive(:read_timeout=).with(500)
378
379
  Net::HTTP.stub(:new).and_return(@http)
379
380
  end
380
381
 
@@ -382,7 +382,7 @@ MANIFEST
382
382
  write 'src/test/java/Test.java'
383
383
  end
384
384
 
385
- shared_examples_for 'source' do
385
+ RSpec.shared_examples 'source' do
386
386
  it 'should ignore CVS and SVN files' do
387
387
  define('foo')
388
388
  classpath_sources('excluding').each do |excluding_attribute|
@@ -1419,7 +1419,7 @@ describe Buildr::IntellijIdea do
1419
1419
  touch 'foo/src/main/java/foo/Foo.java' # needed so that buildr will treat as a java project
1420
1420
  artifact('group:id:jar:1.0') { |t| write t.to_s }
1421
1421
  define "root" do
1422
- repositories.remote << 'http://mirrors.ibiblio.org/pub/mirrors/maven2/'
1422
+ repositories.remote << 'https://repo1.maven.org/maven2'
1423
1423
  project.version = "2.5.2"
1424
1424
  define 'foo' do
1425
1425
  resources.from _(:source, :main, :resources)
@@ -98,13 +98,6 @@ describe Buildr::CustomPom do
98
98
  #$stderr.puts @pom_xml.to_s
99
99
  end
100
100
 
101
- it 'has correct static metadata' do
102
- @pom_xml.should match_xpath('/project/modelVersion', '4.0.0')
103
- @pom_xml.should match_xpath('/project/parent/groupId', 'org.sonatype.oss')
104
- @pom_xml.should match_xpath('/project/parent/artifactId', 'oss-parent')
105
- @pom_xml.should match_xpath('/project/parent/version', '8')
106
- end
107
-
108
101
  it 'has correct project level metadata' do
109
102
  @pom_xml.should match_xpath('/project/groupId', 'org.myproject')
110
103
  @pom_xml.should match_xpath('/project/artifactId', 'foo')
@@ -77,7 +77,7 @@ describe 'ecj compiler' do
77
77
  end
78
78
 
79
79
  it 'should include tools.jar dependency' do
80
- repositories.remote << "http://repo1.maven.org/maven2/"
80
+ repositories.remote << "https://repo1.maven.org/maven2/"
81
81
  write 'src/main/java/UseJarSigner.java', <<-JAVA
82
82
  import sun.tools.jar.Manifest;
83
83
  public class UseJarSigner { }
@@ -229,7 +229,7 @@ describe 'ecj compiler options' do
229
229
  end
230
230
 
231
231
  it 'should complain about options it doesn\'t know' do
232
- repositories.remote << "http://repo1.maven.org/maven2/"
232
+ repositories.remote << "https://repo1.maven.org/maven2/"
233
233
  write 'source/Test.java', 'class Test {}'
234
234
  compile_task.using(:unknown=>'option')
235
235
  lambda { compile_task.from('source').invoke }.should raise_error(ArgumentError, /no such option/i)
@@ -53,7 +53,7 @@ describe Project, '#manifest' do
53
53
  end
54
54
 
55
55
 
56
- shared_examples_for 'package with manifest' do
56
+ RSpec.shared_examples 'package with manifest' do
57
57
  before do
58
58
  @long_line = 'No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE).'
59
59
  end
@@ -347,7 +347,7 @@ describe Project, '#meta_inf' do
347
347
  end
348
348
 
349
349
 
350
- shared_examples_for 'package with meta_inf' do
350
+ RSpec.shared_examples 'package with meta_inf' do
351
351
 
352
352
  def package_with_meta_inf(meta_inf = nil)
353
353
  packaging = @packaging
@@ -1258,7 +1258,7 @@ describe Packaging, 'test_jar' do
1258
1258
  end
1259
1259
  end
1260
1260
 
1261
- shared_examples_for 'package_with_' do
1261
+ RSpec.shared_examples 'package_with_' do
1262
1262
 
1263
1263
  def prepare(options = {})
1264
1264
  packager = "package_with_#{@packaging}"
@@ -53,7 +53,7 @@ module TestCoverageHelper
53
53
  end
54
54
  end
55
55
 
56
- shared_examples_for 'test coverage tool' do
56
+ RSpec.shared_examples 'test coverage tool' do
57
57
  include TestCoverageHelper
58
58
 
59
59
  def toolname
@@ -17,7 +17,7 @@
17
17
  require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
18
18
 
19
19
  # need to test both with and without KOTLIN_HOME
20
- share_as :KotlincCompiler do
20
+ RSpec.shared_examples 'KotlincCompiler' do
21
21
 
22
22
  it 'should identify itself from source directories' do
23
23
  write 'src/main/kotlin/com/example/Test.kt', "package com.example\n class Test { }"
@@ -110,7 +110,7 @@ share_as :KotlincCompiler do
110
110
  end
111
111
  end
112
112
 
113
- share_as :KotlincCompiler_CommonOptions do
113
+ RSpec.shared_examples 'KotlincCompiler_CommonOptions' do
114
114
 
115
115
  it 'should set warnings option to false by default' do
116
116
  compile_task.options.warnings.should be_false
@@ -182,7 +182,7 @@ share_as :KotlincCompiler_CommonOptions do
182
182
  compile_task.using(:optimize=>false)
183
183
  kotlinc_args.noOptimize.should be_true
184
184
  end
185
-
185
+
186
186
  it 'should set noStdlib option to true by default' do
187
187
  compile_task.options.noStdlib.should be_true
188
188
  kotlinc_args.noStdlib.should be_true
@@ -200,7 +200,7 @@ share_as :KotlincCompiler_CommonOptions do
200
200
 
201
201
  it 'should not set other option by default' do
202
202
  compile_task.options.other.should be_nil
203
- end
203
+ end
204
204
 
205
205
  it 'should complain about options it doesn\'t know' do
206
206
  write 'source/Test.kt', 'class Test {}'
@@ -235,13 +235,13 @@ if Java.java.lang.System.getProperty("java.runtime.version") >= "1.8"
235
235
  it 'requires present KOTLIN_HOME' do
236
236
  ENV['KOTLIN_HOME'].should_not be_nil
237
237
  end
238
-
238
+
239
239
  def compile_task
240
240
  @compile_task ||= define('foo').compile.using(:kotlinc)
241
241
  end
242
242
 
243
- it_should_behave_like KotlincCompiler
244
- it_should_behave_like KotlincCompiler_CommonOptions
243
+ it_should_behave_like 'KotlincCompiler'
244
+ it_should_behave_like 'KotlincCompiler_CommonOptions'
245
245
  end
246
246
  end
247
247
 
@@ -255,20 +255,20 @@ if Java.java.lang.System.getProperty("java.runtime.version") >= "1.8"
255
255
  it 'requires absent KOTLIN_HOME' do
256
256
  ENV['KOTLIN_HOME'].should be_nil
257
257
  end
258
-
258
+
259
259
  def compile_task
260
260
  @compile_task ||= define('foo').compile.using(:kotlinc)
261
261
  end
262
-
262
+
263
263
  def kotlinc_args
264
264
  compile_task.instance_eval { @compiler }.send(:kotlinc_args)
265
265
  end
266
266
 
267
- it_should_behave_like KotlincCompiler
268
- it_should_behave_like KotlincCompiler_CommonOptions
267
+ it_should_behave_like 'KotlincCompiler'
268
+ it_should_behave_like 'KotlincCompiler_CommonOptions'
269
269
 
270
270
  after :all do
271
271
  ENV['KOTLIN_HOME'] = old_home
272
272
  end
273
273
  end
274
- end
274
+ end
@@ -60,7 +60,7 @@ module ArchiveTaskHelpers
60
60
  end
61
61
  end
62
62
 
63
- shared_examples_for 'ArchiveTask' do
63
+ RSpec.shared_examples 'ArchiveTask' do
64
64
  include ArchiveTaskHelpers
65
65
 
66
66
  before(:each) do
@@ -306,7 +306,7 @@ shared_examples_for 'ArchiveTask' do
306
306
  inspect_archive.should be_empty
307
307
  end
308
308
  end
309
-
309
+
310
310
  it 'should merge archives, concatenate file contents' do
311
311
  @files = %w{foo1 foo2}.map { |folder| File.join(@dir, folder) }.
312
312
  map do |dir|
@@ -320,7 +320,7 @@ shared_examples_for 'ArchiveTask' do
320
320
  archive['test1.txt'].should eql(content_for('test1.txt') * @files.size)
321
321
  end
322
322
  end
323
-
323
+
324
324
  it 'should merge archives, transforming file contents' do
325
325
  @files = %w{foo1 foo2}.map { |folder| File.join(@dir, folder) }.
326
326
  map do |dir|
@@ -215,15 +215,15 @@ describe Repositories, 'remote_uri' do
215
215
  @local = @remote = @release_to = nil
216
216
  end
217
217
 
218
- @repos = [ 'https://oss.sonatype.org/', 'http://www.ibiblio.org/maven2', { :url => 'http://repo1.maven.org/maven2', :username => 'user', :password => 'password' } ]
218
+ @repos = [ 'https://oss.sonatype.org/', { :url => 'https://repo1.maven.org/maven2', :username => 'user', :password => 'password' } ]
219
219
  end
220
220
 
221
221
  it 'should convert remote to array of uri' do
222
- uri = URI.parse( 'http://repo1.maven.org/maven2' )
222
+ uri = URI.parse( 'https://repo1.maven.org/maven2' )
223
223
  uri.user = 'user'
224
224
  uri.password = 'password'
225
225
 
226
- uris = [ URI.parse( 'https://oss.sonatype.org/'), URI.parse( 'http://www.ibiblio.org/maven2' ), uri ]
226
+ uris = [ URI.parse( 'https://oss.sonatype.org/'), uri ]
227
227
 
228
228
  repositories.remote = @repos
229
229
  repositories.remote_uri.should eql(uris)
@@ -236,7 +236,7 @@ describe Repositories, 'mirrors' do
236
236
  @local = @remote = @release_to = @mirrors = nil
237
237
  end
238
238
 
239
- @repos = [ 'http://www.ibiblio.org/maven2', 'http://repo1.maven.org/maven2' ]
239
+ @repos = %w(http://www.ibiblio.org/maven2 https://repo1.maven.org/maven2)
240
240
  end
241
241
 
242
242
  it 'should be empty initially' do
@@ -310,7 +310,7 @@ describe Repositories, 'remote' do
310
310
  @local = @remote = @release_to = nil
311
311
  end
312
312
 
313
- @repos = [ 'http://www.ibiblio.org/maven2', 'http://repo1.maven.org/maven2' ]
313
+ @repos = %w(http://www.ibiblio.org/maven2 https://repo1.maven.org/maven2)
314
314
  end
315
315
 
316
316
  it 'should be empty initially' do
@@ -1214,13 +1214,6 @@ end
1214
1214
  describe Buildr, '#transitive' do
1215
1215
  before do
1216
1216
  repositories.remote = 'http://buildr.apache.org/repository/noexist'
1217
- write artifact('org.sonatype.oss:oss-parent:pom:8').pom.to_s, <<-XML
1218
- <project>
1219
- <artifactId>oss-parent</artifactId>
1220
- <groupId>org.sonatype.oss</groupId>
1221
- <version>8</version>
1222
- </project>
1223
- XML
1224
1217
 
1225
1218
  @simple = %w(saxon:saxon:jar:8.4 saxon:saxon-dom:jar:8.4 saxon:saxon-xpath:jar:8.4)
1226
1219
  @simple.map { |spec| artifact(spec).pom }.each { |task| write task.name, task.pom_xml.call }
@@ -14,7 +14,7 @@
14
14
  # the License.
15
15
 
16
16
 
17
- shared_examples_for 'packaging' do
17
+ RSpec.shared_examples 'packaging' do
18
18
  it 'should create artifact of proper type' do
19
19
  packaging = @packaging
20
20
  package_type = @package_type || @packaging
@@ -363,11 +363,6 @@ describe Project, '#package' do
363
363
  <?xml version="1.0" encoding="UTF-8"?>
364
364
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
365
365
  <modelVersion>4.0.0</modelVersion>
366
- <parent>
367
- <groupId>org.sonatype.oss</groupId>
368
- <artifactId>oss-parent</artifactId>
369
- <version>8</version>
370
- </parent>
371
366
  <groupId>bar</groupId>
372
367
  <artifactId>foo</artifactId>
373
368
  <version>1.0</version>