maven-tools 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/maven/tools/dsl/gem_support.rb +1 -1
- data/lib/maven/tools/dsl/jarfile_lock.rb +1 -1
- data/lib/maven/tools/dsl/jars_lock.rb +1 -1
- data/lib/maven/tools/dsl.rb +4 -4
- data/lib/maven/tools/gemfile_lock.rb +1 -1
- data/lib/maven/tools/jarfile.rb +4 -4
- data/lib/maven/tools/pom.rb +1 -1
- data/lib/maven/tools/version.rb +1 -1
- data/lib/maven/tools/versions.rb +2 -2
- data/spec/artifact_spec.rb +43 -43
- data/spec/coordinate_spec.rb +55 -55
- data/spec/dsl/gemspec_spec/jars_and_poms.xml +2 -2
- data/spec/dsl/gemspec_spec/jars_and_poms_include_jars.xml +2 -2
- data/spec/dsl/gemspec_spec/maven-tools.xml +2 -2
- data/spec/dsl/gemspec_spec.rb +4 -4
- data/spec/dsl/jarfile_lock_spec.rb +44 -44
- data/spec/dsl/profile_gemspec_spec/jars_and_poms.xml +2 -2
- data/spec/dsl/profile_gemspec_spec/jars_and_poms_include_jars.xml +2 -2
- data/spec/dsl/profile_gemspec_spec/maven-tools.xml +2 -2
- data/spec/dsl/profile_gemspec_spec/no_gems.xml +2 -2
- data/spec/dsl/profile_gemspec_spec/snapshot.xml +2 -2
- data/spec/dsl/profile_gemspec_spec/unknown_license.xml +2 -2
- data/spec/dsl/profile_gemspec_spec.rb +7 -7
- data/spec/dsl/project_gemspec_spec/extended.xml +2 -2
- data/spec/dsl/project_gemspec_spec/jars_and_poms.xml +2 -2
- data/spec/dsl/project_gemspec_spec/jars_and_poms_include_jars.xml +2 -2
- data/spec/dsl/project_gemspec_spec/maven-tools.xml +2 -2
- data/spec/dsl/project_gemspec_spec/no_gems.xml +2 -2
- data/spec/dsl/project_gemspec_spec/profile.xml +2 -2
- data/spec/dsl/project_gemspec_spec/snapshot.xml +2 -2
- data/spec/dsl/project_gemspec_spec/unknown_license.xml +2 -2
- data/spec/dsl/project_gemspec_spec.rb +9 -9
- data/spec/gemfile/pom.xml +2 -2
- data/spec/gemfile_include_jars/pom.xml +2 -2
- data/spec/gemfile_with_access_to_model/pom.xml +2 -2
- data/spec/gemfile_with_custom_source/pom.xml +2 -2
- data/spec/gemfile_with_custom_source_and_custom_jarname/pom.xml +2 -2
- data/spec/gemfile_with_extras/pom.xml +2 -2
- data/spec/gemfile_with_groups/pom.xml +2 -2
- data/spec/gemfile_with_groups_and_lockfile/pom.xml +2 -2
- data/spec/gemfile_with_jars_lock/pom.xml +2 -2
- data/spec/gemfile_with_lock/pom.xml +2 -2
- data/spec/gemfile_with_path/pom.xml +2 -2
- data/spec/gemfile_with_platforms/pom.xml +2 -2
- data/spec/gemfile_with_source/pom.xml +2 -2
- data/spec/gemfile_with_source_and_custom_jarname/pom.xml +2 -2
- data/spec/gemfile_with_source_and_no_jar/pom.xml +2 -2
- data/spec/gemfile_with_test_group/pom.xml +2 -2
- data/spec/gemfile_with_two_sources/pom.xml +2 -2
- data/spec/gemfile_without_gemspec/pom.xml +2 -2
- data/spec/gemspec/pom.xml +2 -2
- data/spec/gemspec_dependencies_spec.rb +4 -4
- data/spec/gemspec_in_profile/pom.xml +2 -2
- data/spec/gemspec_include_jars/pom.xml +2 -2
- data/spec/gemspec_no_rubygems_repo/pom.xml +2 -2
- data/spec/gemspec_prerelease/pom.xml +2 -2
- data/spec/gemspec_prerelease_snapshot/pom.xml +2 -2
- data/spec/gemspec_with_access_to_model/pom.xml +2 -2
- data/spec/gemspec_with_custom_source/pom.xml +2 -2
- data/spec/gemspec_with_custom_source_and_custom_jarname/pom.xml +2 -2
- data/spec/gemspec_with_extras/pom.xml +2 -2
- data/spec/gemspec_with_jar_dependencies/pom.xml +2 -2
- data/spec/gemspec_with_jars_lock/pom.xml +2 -2
- data/spec/gemspec_with_prereleased_dependency/pom.xml +2 -2
- data/spec/gemspec_with_prereleased_dependency_and_no_repo/pom.xml +2 -2
- data/spec/gemspec_with_source/pom.xml +2 -2
- data/spec/gemspec_with_source_and_custom_jarname/pom.xml +2 -2
- data/spec/gemspec_with_source_and_no_jar/pom.xml +2 -2
- data/spec/jarfile_spec.rb +20 -20
- data/spec/mavenfile/Mavenfile +1 -1
- data/spec/pom.xml +1 -1
- data/spec/pom_maven_alternative_style/pom.rb +1 -1
- data/spec/pom_maven_hash_style/pom.rb +1 -1
- data/spec/pom_maven_style/pom.rb +1 -1
- data/spec/pom_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1d8f13e30677224431fc8a84385954b8ac92a272286bb95c807cbb9b5da47f0
|
4
|
+
data.tar.gz: 598df59f33b4c2a8f669b3e5f6fb9edd935588faaf41bccc3ed44f970ade2205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c236ce0eda4cd250300306256d2976aefdf79e60d4ac17bcfc7b5fe5610ef54997b7bf4e2adbb574d3f87ca3f499dbe405ad81ef7874b2c2cc7bb32904fa3728
|
7
|
+
data.tar.gz: d5740d590871a91e29a46da46cd98c2f8e571524b3a871ad4feced1dda9ca9e4fc5bf3cefc33d267d53fb34ddaa910715e2ab236b776428df12678864a15a752
|
data/README.md
CHANGED
@@ -18,6 +18,14 @@ Contributing
|
|
18
18
|
4. Push to the branch (`git push origin my-new-feature`)
|
19
19
|
5. Create new Pull Request
|
20
20
|
|
21
|
+
Building and releasing
|
22
|
+
----------------------
|
23
|
+
|
24
|
+
Specs can be run with `rake spec` but will also be run as part of maven test phase.
|
25
|
+
|
26
|
+
Build the gem with mvn package, making sure that both lib/maven-tools/version.rb and pom.xml are updated to the new
|
27
|
+
release version. The built gem will be in the pkg/ dir.
|
28
|
+
|
21
29
|
meta-fu
|
22
30
|
-------
|
23
31
|
|
@@ -71,7 +71,7 @@ module Maven
|
|
71
71
|
# TODO rename "no_rubygems_repo" to "no_jar_support"
|
72
72
|
if( options[ :no_rubygems_repo ] != true &&
|
73
73
|
jar &&
|
74
|
-
( source || File.
|
74
|
+
( source || File.exist?( File.join( project.basedir,
|
75
75
|
'src/main/java' ) ) ) )
|
76
76
|
|
77
77
|
unless spec.nil? || spec.platform.to_s.match( /java|jruby/ )
|
@@ -25,7 +25,7 @@ module Maven
|
|
25
25
|
|
26
26
|
def initialize( parent, file = 'Jars.lock' )
|
27
27
|
file = File.join( parent.basedir, file )
|
28
|
-
if File.
|
28
|
+
if File.exist?(file)
|
29
29
|
parent.profile File.basename(file) do
|
30
30
|
parent.activation do
|
31
31
|
parent.file( :exists => File.basename(file) )
|
data/lib/maven/tools/dsl.rb
CHANGED
@@ -139,7 +139,7 @@ module Maven
|
|
139
139
|
options = name
|
140
140
|
name = 'Gemfile'
|
141
141
|
end
|
142
|
-
name = ::File.join( basedir, name ) unless ::File.
|
142
|
+
name = ::File.join( basedir, name ) unless ::File.exist?( name )
|
143
143
|
if @context == :project
|
144
144
|
build do
|
145
145
|
extension! 'org.jruby.maven:mavengem-wagon', '${mavengem.wagon.version}'
|
@@ -149,7 +149,7 @@ module Maven
|
|
149
149
|
@inside_gemfile = true
|
150
150
|
# the eval might need those options for gemspec declaration
|
151
151
|
lockfile = ::File.expand_path( name + '.lock' )
|
152
|
-
if File.
|
152
|
+
if File.exist? lockfile
|
153
153
|
pr = profile :gemfile do
|
154
154
|
activation do
|
155
155
|
file( :missing => name.sub(/#{basedir}./, '') + '.lock' )
|
@@ -304,7 +304,7 @@ module Maven
|
|
304
304
|
end
|
305
305
|
# TODO rename "no_rubygems_repo" to "no_jar_support"
|
306
306
|
if options[ :no_rubygems_repo ] != true && jar && ( source ||
|
307
|
-
::File.
|
307
|
+
::File.exist?( ::File.join( basedir, 'src', 'main', 'java' ) ) )
|
308
308
|
unless spec.nil? || spec.platform.to_s.match( /java|jruby/ )
|
309
309
|
warn "gem is not a java platform gem but has a jar and source"
|
310
310
|
end
|
@@ -361,7 +361,7 @@ module Maven
|
|
361
361
|
warn "DEPRECATED use filename instead"
|
362
362
|
file = jfile.file
|
363
363
|
end
|
364
|
-
file = ::File.join( basedir, file ) unless ::File.
|
364
|
+
file = ::File.join( basedir, file ) unless ::File.exist?( file )
|
365
365
|
dsl = Maven::Tools::DSL::Jarfile.new( @current, file, options[ :skip_lock ] )
|
366
366
|
|
367
367
|
# TODO this setup should be part of DSL::Jarfile
|
data/lib/maven/tools/jarfile.rb
CHANGED
@@ -40,7 +40,7 @@ module Maven
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def exists?
|
43
|
-
::File.
|
43
|
+
::File.exist?(@file)
|
44
44
|
end
|
45
45
|
|
46
46
|
def mtime_lock
|
@@ -48,7 +48,7 @@ module Maven
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def exists_lock?
|
51
|
-
::File.
|
51
|
+
::File.exist?(@lockfile)
|
52
52
|
end
|
53
53
|
|
54
54
|
def load_lockfile
|
@@ -83,7 +83,7 @@ module Maven
|
|
83
83
|
|
84
84
|
def eval_file( file )
|
85
85
|
warn "#{self.class} is deprecated"
|
86
|
-
if ::File.
|
86
|
+
if ::File.exist?( file )
|
87
87
|
eval( ::File.read( file ), nil, file )
|
88
88
|
self
|
89
89
|
end
|
@@ -178,7 +178,7 @@ module Maven
|
|
178
178
|
|
179
179
|
def populate_unlocked( container = nil, &block )
|
180
180
|
warn 'DEPRECATED use Maven::Tools::DSL::Jarfile instead'
|
181
|
-
if ::File.
|
181
|
+
if ::File.exist?(@file)
|
182
182
|
dsl = Maven::Tools::DSL::Jarfile.new( nil, @file )
|
183
183
|
|
184
184
|
if block
|
data/lib/maven/tools/pom.rb
CHANGED
data/lib/maven/tools/version.rb
CHANGED
data/lib/maven/tools/versions.rb
CHANGED
@@ -24,12 +24,12 @@ module Maven
|
|
24
24
|
VERSIONS = {
|
25
25
|
:jar_plugin => "2.4",
|
26
26
|
:clean_plugin => "2.4",
|
27
|
-
:jruby_plugins => "3.0.0
|
27
|
+
:jruby_plugins => "3.0.0",
|
28
28
|
:jruby9_plugins => "0.3.0",
|
29
29
|
:bundler_version => "1.10.6",
|
30
30
|
:jruby_version => "9.1.2.0",
|
31
31
|
:polyglot_version => "0.1.18",
|
32
|
-
:mavengem_wagon => "2.0.0
|
32
|
+
:mavengem_wagon => "2.0.0"
|
33
33
|
}.freeze
|
34
34
|
end
|
35
35
|
end
|
data/spec/artifact_spec.rb
CHANGED
@@ -4,67 +4,67 @@ require 'maven/tools/artifact'
|
|
4
4
|
describe Maven::Tools::Artifact do
|
5
5
|
|
6
6
|
it 'should convert from coordinate' do
|
7
|
-
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:123' ).to_s.must_equal 'sdas:das:jar:tes:123'
|
8
|
-
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:123' ).to_s.must_equal 'sdas:das:jar:123'
|
9
|
-
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:[123,234]' ).to_s.must_equal 'sdas:das:jar:tes:[123,234]'
|
10
|
-
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:[123,234]' ).to_s.must_equal 'sdas:das:jar:[123,234]'
|
11
|
-
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:123:[de:fr,gb:us]' ).to_s.must_equal 'sdas:das:jar:tes:123:[de:fr,gb:us]'
|
12
|
-
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:123:[de:fr,gb:us]' ).to_s.must_equal 'sdas:das:jar:123:[de:fr,gb:us]'
|
13
|
-
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:[123,234]:[de:fr,gb:us]' ).to_s.must_equal 'sdas:das:jar:tes:[123,234]:[de:fr,gb:us]'
|
14
|
-
Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:[123,234]:[de:fr,gb:us]' ).to_s.must_equal 'sdas:das:jar:[123,234]:[de:fr,gb:us]'
|
7
|
+
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:123' ).to_s).must_equal 'sdas:das:jar:tes:123'
|
8
|
+
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:123' ).to_s).must_equal 'sdas:das:jar:123'
|
9
|
+
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:[123,234]' ).to_s).must_equal 'sdas:das:jar:tes:[123,234]'
|
10
|
+
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:[123,234]' ).to_s).must_equal 'sdas:das:jar:[123,234]'
|
11
|
+
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:123:[de:fr,gb:us]' ).to_s).must_equal 'sdas:das:jar:tes:123:[de:fr,gb:us]'
|
12
|
+
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:123:[de:fr,gb:us]' ).to_s).must_equal 'sdas:das:jar:123:[de:fr,gb:us]'
|
13
|
+
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:tes:[123,234]:[de:fr,gb:us]' ).to_s).must_equal 'sdas:das:jar:tes:[123,234]:[de:fr,gb:us]'
|
14
|
+
_(Maven::Tools::Artifact.from_coordinate( 'sdas:das:jar:[123,234]:[de:fr,gb:us]' ).to_s).must_equal 'sdas:das:jar:[123,234]:[de:fr,gb:us]'
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'should setup artifact' do
|
18
|
-
Maven::Tools::Artifact.new( "sdas", "das", "jar", "123", "tes" ).to_s.must_equal 'sdas:das:jar:tes:123'
|
19
|
-
Maven::Tools::Artifact.new( "sdas", "das", "jar", "123" ).to_s.must_equal 'sdas:das:jar:123'
|
20
|
-
Maven::Tools::Artifact.new( "sdas.asd", "das", "jar", "123", ["fds:fre"] ).to_s.must_equal 'sdas.asd:das:jar:123:[fds:fre]'
|
21
|
-
Maven::Tools::Artifact.new( "sdas.asd", "das", "jar","123", "bla", ["fds:fre", "ferf:de"] ).to_s.must_equal 'sdas.asd:das:jar:bla:123:[fds:fre,ferf:de]'
|
22
|
-
Maven::Tools::Artifact.new( "sdas.asd", "das", "jar", "123", "blub", ["fds:fre", "ferf:de"] ).to_s.must_equal 'sdas.asd:das:jar:blub:123:[fds:fre,ferf:de]'
|
18
|
+
_(Maven::Tools::Artifact.new( "sdas", "das", "jar", "123", "tes" ).to_s).must_equal 'sdas:das:jar:tes:123'
|
19
|
+
_(Maven::Tools::Artifact.new( "sdas", "das", "jar", "123" ).to_s).must_equal 'sdas:das:jar:123'
|
20
|
+
_(Maven::Tools::Artifact.new( "sdas.asd", "das", "jar", "123", ["fds:fre"] ).to_s).must_equal 'sdas.asd:das:jar:123:[fds:fre]'
|
21
|
+
_(Maven::Tools::Artifact.new( "sdas.asd", "das", "jar","123", "bla", ["fds:fre", "ferf:de"] ).to_s).must_equal 'sdas.asd:das:jar:bla:123:[fds:fre,ferf:de]'
|
22
|
+
_(Maven::Tools::Artifact.new( "sdas.asd", "das", "jar", "123", "blub", ["fds:fre", "ferf:de"] ).to_s).must_equal 'sdas.asd:das:jar:blub:123:[fds:fre,ferf:de]'
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'should convert ruby version contraints - gems' do
|
26
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '=1' ).to_s.must_equal 'rubygems:asd:gem:[1,1.0.0.0.0.1)'
|
27
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '>=1' ).to_s.must_equal 'rubygems:asd:gem:[1,)'
|
28
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=1' ).to_s.must_equal 'rubygems:asd:gem:[0,1]'
|
29
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '>1' ).to_s.must_equal 'rubygems:asd:gem:(1,)'
|
30
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<1' ).to_s.must_equal 'rubygems:asd:gem:[0,1)'
|
31
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '!=1' ).to_s.must_equal 'rubygems:asd:gem:(1,)'
|
32
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<2', '>1' ).to_s.must_equal 'rubygems:asd:gem:(1,2)'
|
33
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=2', '>1' ).to_s.must_equal 'rubygems:asd:gem:(1,2]'
|
34
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<2', '>=1' ).to_s.must_equal 'rubygems:asd:gem:[1,2)'
|
35
|
-
Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=2', '>=1' ).to_s.must_equal 'rubygems:asd:gem:[1,2]'
|
26
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '=1' ).to_s).must_equal 'rubygems:asd:gem:[1,1.0.0.0.0.1)'
|
27
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '>=1' ).to_s).must_equal 'rubygems:asd:gem:[1,)'
|
28
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=1' ).to_s).must_equal 'rubygems:asd:gem:[0,1]'
|
29
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '>1' ).to_s).must_equal 'rubygems:asd:gem:(1,)'
|
30
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<1' ).to_s).must_equal 'rubygems:asd:gem:[0,1)'
|
31
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '!=1' ).to_s).must_equal 'rubygems:asd:gem:(1,)'
|
32
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<2', '>1' ).to_s).must_equal 'rubygems:asd:gem:(1,2)'
|
33
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=2', '>1' ).to_s).must_equal 'rubygems:asd:gem:(1,2]'
|
34
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<2', '>=1' ).to_s).must_equal 'rubygems:asd:gem:[1,2)'
|
35
|
+
_(Maven::Tools::Artifact.from( :gem, 'rubygems:asd', '<=2', '>=1' ).to_s).must_equal 'rubygems:asd:gem:[1,2]'
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'should convert ruby version contraints - jars' do
|
39
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '=1' ).to_s.must_equal 'org.something:asd:jar:[1,1.0.0.0.0.1)'
|
40
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '>=1' ).to_s.must_equal 'org.something:asd:jar:[1,)'
|
41
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=1' ).to_s.must_equal 'org.something:asd:jar:[0,1]'
|
42
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '>1' ).to_s.must_equal 'org.something:asd:jar:(1,)'
|
43
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<1' ).to_s.must_equal 'org.something:asd:jar:[0,1)'
|
44
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '!=1' ).to_s.must_equal 'org.something:asd:jar:(1,)'
|
45
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<2', '>1' ).to_s.must_equal 'org.something:asd:jar:(1,2)'
|
46
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=2', '>1' ).to_s.must_equal 'org.something:asd:jar:(1,2]'
|
47
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<2', '>=1' ).to_s.must_equal 'org.something:asd:jar:[1,2)'
|
48
|
-
Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=2', '>=1' ).to_s.must_equal 'org.something:asd:jar:[1,2]'
|
39
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '=1' ).to_s).must_equal 'org.something:asd:jar:[1,1.0.0.0.0.1)'
|
40
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '>=1' ).to_s).must_equal 'org.something:asd:jar:[1,)'
|
41
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=1' ).to_s).must_equal 'org.something:asd:jar:[0,1]'
|
42
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '>1' ).to_s).must_equal 'org.something:asd:jar:(1,)'
|
43
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<1' ).to_s).must_equal 'org.something:asd:jar:[0,1)'
|
44
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '!=1' ).to_s).must_equal 'org.something:asd:jar:(1,)'
|
45
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<2', '>1' ).to_s).must_equal 'org.something:asd:jar:(1,2)'
|
46
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=2', '>1' ).to_s).must_equal 'org.something:asd:jar:(1,2]'
|
47
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<2', '>=1' ).to_s).must_equal 'org.something:asd:jar:[1,2)'
|
48
|
+
_(Maven::Tools::Artifact.from( :jar, 'org.something:asd', '<=2', '>=1' ).to_s).must_equal 'org.something:asd:jar:[1,2]'
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'passes in scope to artifact' do
|
52
52
|
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1' )
|
53
|
-
a.to_s.must_equal 'org.something:asd:jar:1'
|
54
|
-
a[ :scope ].must_be_nil
|
53
|
+
_(a.to_s).must_equal 'org.something:asd:jar:1'
|
54
|
+
_(a[ :scope ]).must_be_nil
|
55
55
|
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1', :scope => :provided )
|
56
|
-
a.to_s.must_equal 'org.something:asd:jar:1'
|
57
|
-
a[ :scope ].must_equal :provided
|
56
|
+
_(a.to_s).must_equal 'org.something:asd:jar:1'
|
57
|
+
_(a[ :scope ]).must_equal :provided
|
58
58
|
end
|
59
59
|
it 'passes in exclusions to artifact' do
|
60
60
|
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1' )
|
61
|
-
a.to_s.must_equal 'org.something:asd:jar:1'
|
62
|
-
a[ :exclusions ].must_be_nil
|
61
|
+
_(a.to_s).must_equal 'org.something:asd:jar:1'
|
62
|
+
_(a[ :exclusions ]).must_be_nil
|
63
63
|
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1', :exclusions => ["org.something:dsa"] )
|
64
|
-
a.to_s.must_equal 'org.something:asd:jar:1:[org.something:dsa]'
|
65
|
-
a[ :exclusions ].must_equal [ 'org.something:dsa' ]
|
64
|
+
_(a.to_s).must_equal 'org.something:asd:jar:1:[org.something:dsa]'
|
65
|
+
_(a[ :exclusions ]).must_equal [ 'org.something:dsa' ]
|
66
66
|
a = Maven::Tools::Artifact.from( :jar, 'org.something:asd', '1', :exclusions => ["org.something:dsa", "org.anything:qwe"] )
|
67
|
-
a.to_s.must_equal 'org.something:asd:jar:1:[org.something:dsa,org.anything:qwe]'
|
68
|
-
a[ :exclusions ].must_equal [ 'org.something:dsa', 'org.anything:qwe' ]
|
67
|
+
_(a.to_s).must_equal 'org.something:asd:jar:1:[org.something:dsa,org.anything:qwe]'
|
68
|
+
_(a[ :exclusions ]).must_equal [ 'org.something:dsa', 'org.anything:qwe' ]
|
69
69
|
end
|
70
70
|
end
|
data/spec/coordinate_spec.rb
CHANGED
@@ -9,75 +9,75 @@ describe Maven::Tools::Coordinate do
|
|
9
9
|
subject { A.new }
|
10
10
|
|
11
11
|
it 'should convert ruby version to maven version ranges' do
|
12
|
-
subject.to_version.must_equal "[0,)"
|
13
|
-
subject.to_version('!=2.3.4').must_equal "(2.3.4,)"
|
14
|
-
subject.to_version('!=2.3.4.rc').must_equal "(2.3.4.rc-SNAPSHOT,)"
|
15
|
-
subject.to_version('=2.3.4').must_equal "[2.3.4,2.3.4.0.0.0.0.1)"
|
16
|
-
subject.to_version('=2.3.4.alpha').must_equal "2.3.4.alpha"
|
17
|
-
subject.to_version('~>1.8.2').must_equal "[1.8.2,1.8.99999]"
|
18
|
-
subject.to_version('~>1.8.2.beta').must_equal "[1.8.2.beta-SNAPSHOT,1.8.99999]"
|
19
|
-
subject.to_version('~>1.8.2.beta123.12').must_equal "[1.8.2.beta123.12-SNAPSHOT,1.8.99999]"
|
20
|
-
subject.to_version('~>1.8.2.1beta').must_equal "[1.8.2.1beta-SNAPSHOT,1.8.99999]"
|
21
|
-
subject.to_version('~>1.8').must_equal "[1.8,1.99999]"
|
22
|
-
subject.to_version('~>0').must_equal "[0,99999]"
|
23
|
-
subject.to_version('>1.2').must_equal "(1.2,)"
|
24
|
-
subject.to_version('>1.2.GA').must_equal "(1.2.GA-SNAPSHOT,)"
|
25
|
-
subject.to_version('<1.2').must_equal "[0,1.2)"
|
26
|
-
subject.to_version('<1.2.dev').must_equal "[0,1.2.dev-SNAPSHOT)"
|
27
|
-
subject.to_version('>=1.2').must_equal "[1.2,)"
|
28
|
-
subject.to_version('>=1.2.gamma').must_equal "[1.2.gamma-SNAPSHOT,)"
|
29
|
-
subject.to_version('<=1.2').must_equal "[0,1.2]"
|
30
|
-
subject.to_version('<=1.2.pre').must_equal "[0,1.2.pre-SNAPSHOT]"
|
31
|
-
subject.to_version('>=1.2', '<2.0').must_equal "[1.2,2.0)"
|
32
|
-
subject.to_version('>=1.2', '<=2.0').must_equal "[1.2,2.0]"
|
33
|
-
subject.to_version('>1.2', '<2.0').must_equal "(1.2,2.0)"
|
34
|
-
subject.to_version('>1.2', '<=2.0').must_equal "(1.2,2.0]"
|
12
|
+
_(subject.to_version).must_equal "[0,)"
|
13
|
+
_(subject.to_version('!=2.3.4')).must_equal "(2.3.4,)"
|
14
|
+
_(subject.to_version('!=2.3.4.rc')).must_equal "(2.3.4.rc-SNAPSHOT,)"
|
15
|
+
_(subject.to_version('=2.3.4')).must_equal "[2.3.4,2.3.4.0.0.0.0.1)"
|
16
|
+
_(subject.to_version('=2.3.4.alpha')).must_equal "2.3.4.alpha"
|
17
|
+
_(subject.to_version('~>1.8.2')).must_equal "[1.8.2,1.8.99999]"
|
18
|
+
_(subject.to_version('~>1.8.2.beta')).must_equal "[1.8.2.beta-SNAPSHOT,1.8.99999]"
|
19
|
+
_(subject.to_version('~>1.8.2.beta123.12')).must_equal "[1.8.2.beta123.12-SNAPSHOT,1.8.99999]"
|
20
|
+
_(subject.to_version('~>1.8.2.1beta')).must_equal "[1.8.2.1beta-SNAPSHOT,1.8.99999]"
|
21
|
+
_(subject.to_version('~>1.8')).must_equal "[1.8,1.99999]"
|
22
|
+
_(subject.to_version('~>0')).must_equal "[0,99999]"
|
23
|
+
_(subject.to_version('>1.2')).must_equal "(1.2,)"
|
24
|
+
_(subject.to_version('>1.2.GA')).must_equal "(1.2.GA-SNAPSHOT,)"
|
25
|
+
_(subject.to_version('<1.2')).must_equal "[0,1.2)"
|
26
|
+
_(subject.to_version('<1.2.dev')).must_equal "[0,1.2.dev-SNAPSHOT)"
|
27
|
+
_(subject.to_version('>=1.2')).must_equal "[1.2,)"
|
28
|
+
_(subject.to_version('>=1.2.gamma')).must_equal "[1.2.gamma-SNAPSHOT,)"
|
29
|
+
_(subject.to_version('<=1.2')).must_equal "[0,1.2]"
|
30
|
+
_(subject.to_version('<=1.2.pre')).must_equal "[0,1.2.pre-SNAPSHOT]"
|
31
|
+
_(subject.to_version('>=1.2', '<2.0')).must_equal "[1.2,2.0)"
|
32
|
+
_(subject.to_version('>=1.2', '<=2.0')).must_equal "[1.2,2.0]"
|
33
|
+
_(subject.to_version('>1.2', '<2.0')).must_equal "(1.2,2.0)"
|
34
|
+
_(subject.to_version('>1.2', '<=2.0')).must_equal "(1.2,2.0]"
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'should keep maven version and ranges as they are' do
|
38
|
-
subject.to_version('1.2.3').must_equal "1.2.3"
|
39
|
-
subject.to_version('(1,2)').must_equal "(1,2)"
|
40
|
-
subject.to_version('[1,2)').must_equal "[1,2)"
|
41
|
-
subject.to_version('(1,2]').must_equal "(1,2]"
|
42
|
-
subject.to_version('[1,2]').must_equal "[1,2]"
|
38
|
+
_(subject.to_version('1.2.3')).must_equal "1.2.3"
|
39
|
+
_(subject.to_version('(1,2)')).must_equal "(1,2)"
|
40
|
+
_(subject.to_version('[1,2)')).must_equal "[1,2)"
|
41
|
+
_(subject.to_version('(1,2]')).must_equal "(1,2]"
|
42
|
+
_(subject.to_version('[1,2]')).must_equal "[1,2]"
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'should keep maven snapshot version and ranges as they are' do
|
46
|
-
subject.to_version('1.2.3-SNAPSHOT').must_equal "1.2.3-SNAPSHOT"
|
47
|
-
subject.to_version('(1,2-SNAPSHOT)').must_equal "(1,2-SNAPSHOT)"
|
48
|
-
subject.to_version('[1-SNAPSHOT,2)').must_equal "[1-SNAPSHOT,2)"
|
49
|
-
subject.to_version('(1,2-SNAPSHOT]').must_equal "(1,2-SNAPSHOT]"
|
50
|
-
subject.to_version('[1-SNAPSHOT,2]').must_equal "[1-SNAPSHOT,2]"
|
46
|
+
_(subject.to_version('1.2.3-SNAPSHOT')).must_equal "1.2.3-SNAPSHOT"
|
47
|
+
_(subject.to_version('(1,2-SNAPSHOT)')).must_equal "(1,2-SNAPSHOT)"
|
48
|
+
_(subject.to_version('[1-SNAPSHOT,2)')).must_equal "[1-SNAPSHOT,2)"
|
49
|
+
_(subject.to_version('(1,2-SNAPSHOT]')).must_equal "(1,2-SNAPSHOT]"
|
50
|
+
_(subject.to_version('[1-SNAPSHOT,2]')).must_equal "[1-SNAPSHOT,2]"
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'should convert pom of jar deps to maven coordinate' do
|
54
|
-
subject.to_coordinate('something "a:b"').must_be_nil
|
55
|
-
subject.to_coordinate('#jar "a:b"').must_be_nil
|
56
|
-
subject.to_coordinate('jar "a:b" # bla').must_equal "a:b:jar:[0,)"
|
57
|
-
subject.to_coordinate("pom 'b:c', '!=2.3.4'").must_equal "b:c:pom:(2.3.4,)"
|
58
|
-
subject.to_coordinate('jar "c:d", "2.3.4"').must_equal "c:d:jar:2.3.4"
|
59
|
-
subject.to_coordinate("jar 'd:e', '~>1.8.2'").must_equal "d:e:jar:[1.8.2,1.8.99999]"
|
60
|
-
subject.to_coordinate('pom "f:g", ">1.2", "<=2.0"').must_equal "f:g:pom:(1.2,2.0]"
|
61
|
-
subject.to_coordinate('pom "e:f", "[1.8,1.9.9)"').must_equal "e:f:pom:[1.8,1.9.9)"
|
62
|
-
subject.to_coordinate('pom "e:f", "(1.8,1.9.9)"').must_equal "e:f:pom:(1.8,1.9.9)"
|
63
|
-
subject.to_coordinate('pom "e:f", "[1.8, 1.9.9]"').must_equal "e:f:pom:[1.8,1.9.9]"
|
54
|
+
_(subject.to_coordinate('something "a:b"')).must_be_nil
|
55
|
+
_(subject.to_coordinate('#jar "a:b"')).must_be_nil
|
56
|
+
_(subject.to_coordinate('jar "a:b" # bla')).must_equal "a:b:jar:[0,)"
|
57
|
+
_(subject.to_coordinate("pom 'b:c', '!=2.3.4'")).must_equal "b:c:pom:(2.3.4,)"
|
58
|
+
_(subject.to_coordinate('jar "c:d", "2.3.4"')).must_equal "c:d:jar:2.3.4"
|
59
|
+
_(subject.to_coordinate("jar 'd:e', '~>1.8.2'")).must_equal "d:e:jar:[1.8.2,1.8.99999]"
|
60
|
+
_(subject.to_coordinate('pom "f:g", ">1.2", "<=2.0"')).must_equal "f:g:pom:(1.2,2.0]"
|
61
|
+
_(subject.to_coordinate('pom "e:f", "[1.8,1.9.9)"')).must_equal "e:f:pom:[1.8,1.9.9)"
|
62
|
+
_(subject.to_coordinate('pom "e:f", "(1.8,1.9.9)"')).must_equal "e:f:pom:(1.8,1.9.9)"
|
63
|
+
_(subject.to_coordinate('pom "e:f", "[1.8, 1.9.9]"')).must_equal "e:f:pom:[1.8,1.9.9]"
|
64
64
|
end
|
65
65
|
|
66
66
|
it 'should support classifiers' do
|
67
|
-
subject.to_coordinate('something "a:b:jdk15"').must_be_nil
|
68
|
-
subject.to_coordinate('#jar "a:b:jdk15"').must_be_nil
|
69
|
-
subject.to_coordinate('jar "a:b:jdk15" # bla').must_equal "a:b:jar:jdk15:[0,)"
|
70
|
-
subject.to_coordinate("pom 'b:c:jdk15', '!=2.3.4'").must_equal "b:c:pom:jdk15:(2.3.4,)"
|
71
|
-
subject.to_coordinate('jar "c:d:jdk15", "2.3.4"').must_equal "c:d:jar:jdk15:2.3.4"
|
72
|
-
subject.to_coordinate("jar 'd:e:jdk15', '~>1.8.2'").must_equal "d:e:jar:jdk15:[1.8.2,1.8.99999]"
|
73
|
-
subject.to_coordinate('pom "f:g:jdk15", ">1.2", "<=2.0"').must_equal "f:g:pom:jdk15:(1.2,2.0]"
|
74
|
-
subject.to_coordinate('pom "e:f:jdk15", "[1.8,1.9.9)"').must_equal "e:f:pom:jdk15:[1.8,1.9.9)"
|
75
|
-
subject.to_coordinate('pom "e:f:jdk15", "(1.8,1.9.9)"').must_equal "e:f:pom:jdk15:(1.8,1.9.9)"
|
76
|
-
subject.to_coordinate('pom "e:f:jdk15", "[1.8, 1.9.9]"').must_equal "e:f:pom:jdk15:[1.8,1.9.9]"
|
67
|
+
_(subject.to_coordinate('something "a:b:jdk15"')).must_be_nil
|
68
|
+
_(subject.to_coordinate('#jar "a:b:jdk15"')).must_be_nil
|
69
|
+
_(subject.to_coordinate('jar "a:b:jdk15" # bla')).must_equal "a:b:jar:jdk15:[0,)"
|
70
|
+
_(subject.to_coordinate("pom 'b:c:jdk15', '!=2.3.4'")).must_equal "b:c:pom:jdk15:(2.3.4,)"
|
71
|
+
_(subject.to_coordinate('jar "c:d:jdk15", "2.3.4"')).must_equal "c:d:jar:jdk15:2.3.4"
|
72
|
+
_(subject.to_coordinate("jar 'd:e:jdk15', '~>1.8.2'")).must_equal "d:e:jar:jdk15:[1.8.2,1.8.99999]"
|
73
|
+
_(subject.to_coordinate('pom "f:g:jdk15", ">1.2", "<=2.0"')).must_equal "f:g:pom:jdk15:(1.2,2.0]"
|
74
|
+
_(subject.to_coordinate('pom "e:f:jdk15", "[1.8,1.9.9)"')).must_equal "e:f:pom:jdk15:[1.8,1.9.9)"
|
75
|
+
_(subject.to_coordinate('pom "e:f:jdk15", "(1.8,1.9.9)"')).must_equal "e:f:pom:jdk15:(1.8,1.9.9)"
|
76
|
+
_(subject.to_coordinate('pom "e:f:jdk15", "[1.8, 1.9.9]"')).must_equal "e:f:pom:jdk15:[1.8,1.9.9]"
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'supports declarations with scope' do
|
80
|
-
subject.to_split_coordinate_with_scope('jar rubygems:ruby-maven, ~> 3.1.1.0, :scope => :provided').must_equal [:provided, "rubygems", "ruby-maven", "jar", "[3.1.1.0,3.1.1.99999]"]
|
81
|
-
subject.to_split_coordinate_with_scope("jar 'rubygems:ruby-maven', '~> 3.1.1.0', :scope => :test").must_equal [:test, "rubygems", "ruby-maven", "jar", "[3.1.1.0,3.1.1.99999]"]
|
80
|
+
_(subject.to_split_coordinate_with_scope('jar rubygems:ruby-maven, ~> 3.1.1.0, :scope => :provided')).must_equal [:provided, "rubygems", "ruby-maven", "jar", "[3.1.1.0,3.1.1.99999]"]
|
81
|
+
_(subject.to_split_coordinate_with_scope("jar 'rubygems:ruby-maven', '~> 3.1.1.0', :scope => :test")).must_equal [:test, "rubygems", "ruby-maven", "jar", "[3.1.1.0,3.1.1.99999]"]
|
82
82
|
end
|
83
83
|
end
|
@@ -5,8 +5,8 @@
|
|
5
5
|
<version>0.0.0</version>
|
6
6
|
<name>gemspec_spec</name>
|
7
7
|
<properties>
|
8
|
-
<jruby.plugins.version>3.0.0
|
9
|
-
<mavengem.wagon.version>2.0.0
|
8
|
+
<jruby.plugins.version>3.0.0</jruby.plugins.version>
|
9
|
+
<mavengem.wagon.version>2.0.0</mavengem.wagon.version>
|
10
10
|
</properties>
|
11
11
|
<dependencies>
|
12
12
|
<dependency>
|
@@ -5,8 +5,8 @@
|
|
5
5
|
<version>0.0.0</version>
|
6
6
|
<name>gemspec_spec</name>
|
7
7
|
<properties>
|
8
|
-
<jruby.plugins.version>3.0.0
|
9
|
-
<mavengem.wagon.version>2.0.0
|
8
|
+
<jruby.plugins.version>3.0.0</jruby.plugins.version>
|
9
|
+
<mavengem.wagon.version>2.0.0</mavengem.wagon.version>
|
10
10
|
</properties>
|
11
11
|
<dependencies>
|
12
12
|
<dependency>
|
@@ -5,8 +5,8 @@
|
|
5
5
|
<version>0.0.0</version>
|
6
6
|
<name>BASEDIR</name>
|
7
7
|
<properties>
|
8
|
-
<jruby.plugins.version>3.0.0
|
9
|
-
<mavengem.wagon.version>2.0.0
|
8
|
+
<jruby.plugins.version>3.0.0</jruby.plugins.version>
|
9
|
+
<mavengem.wagon.version>2.0.0</mavengem.wagon.version>
|
10
10
|
</properties>
|
11
11
|
<dependencies>
|
12
12
|
<dependency>
|
data/spec/dsl/gemspec_spec.rb
CHANGED
@@ -30,21 +30,21 @@ describe Maven::Tools::DSL::Gemspec do
|
|
30
30
|
subject.new parent
|
31
31
|
xml = ""
|
32
32
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
33
|
-
xml.must_equal( GemspecFile.read( 'maven-tools.xml', 'maven-tools' ) )
|
33
|
+
_(xml).must_equal( GemspecFile.read( 'maven-tools.xml', 'maven-tools' ) )
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'evals maven_tools.gemspec from yaml' do
|
37
37
|
subject.new parent, 'maven-tools.gemspec'
|
38
38
|
xml = ""
|
39
39
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
40
|
-
xml.must_equal( GemspecFile.read( 'maven-tools.xml', 'gemspec_spec' ) )
|
40
|
+
_(xml).must_equal( GemspecFile.read( 'maven-tools.xml', 'gemspec_spec' ) )
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'evals gemspec with jar and pom dependencies' do
|
44
44
|
subject.new parent, 'jars_and_poms.gemspec'
|
45
45
|
xml = ""
|
46
46
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
47
|
-
xml.must_equal( GemspecFile.read( 'jars_and_poms.xml',
|
47
|
+
_(xml).must_equal( GemspecFile.read( 'jars_and_poms.xml',
|
48
48
|
'gemspec_spec' ) )
|
49
49
|
end
|
50
50
|
|
@@ -52,7 +52,7 @@ describe Maven::Tools::DSL::Gemspec do
|
|
52
52
|
subject.new parent, :name => 'jars_and_poms.gemspec', :include_jars => true
|
53
53
|
xml = ""
|
54
54
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
55
|
-
xml.must_equal( GemspecFile.read( 'jars_and_poms_include_jars.xml',
|
55
|
+
_(xml).must_equal( GemspecFile.read( 'jars_and_poms_include_jars.xml',
|
56
56
|
'gemspec_spec' ) )
|
57
57
|
end
|
58
58
|
end
|