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.
- checksums.yaml +4 -4
- data/CHANGELOG +36 -0
- data/README.rdoc +2 -2
- data/Rakefile +1 -1
- data/addon/buildr/gwt.rb +4 -7
- data/addon/buildr/jetty.rb +1 -1
- data/buildr.buildfile +2 -3
- data/buildr.gemspec +2 -1
- data/doc/_layouts/default.html +1 -1
- data/doc/artifacts.textile +2 -2
- data/doc/download.textile +30 -6
- data/doc/index.textile +28 -37
- data/doc/installing.textile +2 -2
- data/doc/projects.textile +1 -1
- data/doc/quick_start.textile +3 -3
- data/lib/buildr/core/generate.rb +2 -2
- data/lib/buildr/core/project.rb +2 -2
- data/lib/buildr/core/transports.rb +1 -1
- data/lib/buildr/ide/idea.rb +38 -16
- data/lib/buildr/java/custom_pom.rb +0 -5
- data/lib/buildr/java/doc.rb +2 -0
- data/lib/buildr/java/tests.rb +4 -4
- data/lib/buildr/kotlin/compiler.rb +3 -3
- data/lib/buildr/kotlin/org/apache/buildr/KotlinMessageCollector.java +4 -4
- data/lib/buildr/packaging/archive.rb +5 -5
- data/lib/buildr/packaging/artifact.rb +16 -0
- data/lib/buildr/packaging/artifact_namespace.rb +8 -7
- data/lib/buildr/packaging/artifact_search.rb +1 -1
- data/lib/buildr/packaging/gems.rb +0 -1
- data/lib/buildr/packaging/tar.rb +5 -5
- data/lib/buildr/version.rb +1 -1
- data/rakelib/release.rake +2 -2
- data/rakelib/rspec.rake +1 -0
- data/rakelib/stage.rake +2 -2
- data/spec/core/build_spec.rb +2 -2
- data/spec/core/checks_spec.rb +1 -1
- data/spec/core/compile_spec.rb +2 -2
- data/spec/core/shell_spec.rb +1 -1
- data/spec/core/transport_spec.rb +1 -0
- data/spec/ide/eclipse_spec.rb +1 -1
- data/spec/ide/idea_spec.rb +1 -1
- data/spec/java/custom_pom_spec.rb +0 -7
- data/spec/java/ecj_spec.rb +2 -2
- data/spec/java/packaging_spec.rb +3 -3
- data/spec/java/test_coverage_helper.rb +1 -1
- data/spec/kotlin/compiler_spec.rb +12 -12
- data/spec/packaging/archive_spec.rb +3 -3
- data/spec/packaging/artifact_spec.rb +5 -12
- data/spec/packaging/packaging_helper.rb +1 -1
- data/spec/packaging/packaging_spec.rb +0 -5
- data/spec/sandbox.rb +1 -1
- data/spec/scala/compiler_spec.rb +7 -7
- metadata +17 -3
data/lib/buildr/java/tests.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
312
|
+
unless exclude_args.empty?
|
313
313
|
cmd_args << '-excludegroups' << exclude_args.join(',')
|
314
314
|
end
|
315
315
|
groups_args = options[:groups] || []
|
316
|
-
|
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
|
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
|
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
|
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
|
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
|
-
|
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 ||= "
|
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
|
data/lib/buildr/packaging/tar.rb
CHANGED
@@ -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
|
data/lib/buildr/version.rb
CHANGED
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
|
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.
|
data/spec/core/build_spec.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helpers'))
|
18
18
|
|
19
|
-
|
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
|
-
|
390
|
+
RSpec.shared_examples 'a release process' do
|
391
391
|
|
392
392
|
describe '#make' do
|
393
393
|
before do
|
data/spec/core/checks_spec.rb
CHANGED
data/spec/core/compile_spec.rb
CHANGED
@@ -141,7 +141,7 @@ describe Buildr::CompileTask, '#compiler' do
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
-
it 'should allow
|
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
|
-
|
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
|
data/spec/core/shell_spec.rb
CHANGED
data/spec/core/transport_spec.rb
CHANGED
@@ -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
|
|
data/spec/ide/eclipse_spec.rb
CHANGED
@@ -382,7 +382,7 @@ MANIFEST
|
|
382
382
|
write 'src/test/java/Test.java'
|
383
383
|
end
|
384
384
|
|
385
|
-
|
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|
|
data/spec/ide/idea_spec.rb
CHANGED
@@ -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 << '
|
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')
|
data/spec/java/ecj_spec.rb
CHANGED
@@ -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 << "
|
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 << "
|
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)
|
data/spec/java/packaging_spec.rb
CHANGED
@@ -53,7 +53,7 @@ describe Project, '#manifest' do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
|
56
|
-
|
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
|
-
|
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
|
-
|
1261
|
+
RSpec.shared_examples 'package_with_' do
|
1262
1262
|
|
1263
1263
|
def prepare(options = {})
|
1264
1264
|
packager = "package_with_#{@packaging}"
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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/',
|
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( '
|
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/'),
|
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 =
|
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 =
|
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 }
|
@@ -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>
|