maven-tools 1.2.1 → 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/spec/artifact_spec.rb +43 -43
- data/spec/coordinate_spec.rb +55 -55
- data/spec/dsl/gemspec_spec.rb +4 -4
- data/spec/dsl/jarfile_lock_spec.rb +44 -44
- data/spec/dsl/profile_gemspec_spec.rb +7 -7
- data/spec/dsl/project_gemspec_spec.rb +9 -9
- data/spec/gemspec_dependencies_spec.rb +4 -4
- data/spec/jarfile_spec.rb +20 -20
- 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/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
|
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
|
@@ -9,29 +9,29 @@ describe Maven::Tools::DSL::JarfileLock do
|
|
9
9
|
|
10
10
|
it 'loads legacy Jarfile.lock' do
|
11
11
|
lock = subject.new( base + '.legacy' )
|
12
|
-
lock.coordinates( :test ).size.must_equal 0
|
13
|
-
lock.coordinates.size.must_equal 52
|
12
|
+
_(lock.coordinates( :test ).size).must_equal 0
|
13
|
+
_(lock.coordinates.size).must_equal 52
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'loads Jarfile.lock' do
|
17
17
|
lock = subject.new( base )
|
18
|
-
lock.coordinates( :test ).size.must_equal 7
|
19
|
-
lock.coordinates.size.must_equal 45
|
18
|
+
_(lock.coordinates( :test ).size).must_equal 7
|
19
|
+
_(lock.coordinates.size).must_equal 45
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'tests existence' do
|
23
23
|
lock = subject.new( base )
|
24
24
|
( lock.coordinates( :test ) + lock.coordinates ).each do |c|
|
25
|
-
lock.exists?( c ).must_equal true
|
26
|
-
lock.exists?( c + ".bla" ).must_equal false
|
25
|
+
_(lock.exists?( c )).must_equal true
|
26
|
+
_(lock.exists?( c + ".bla" )).must_equal false
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'tests locked' do
|
31
31
|
lock = subject.new( base )
|
32
32
|
( lock.coordinates( :test ) + lock.coordinates ).each do |c|
|
33
|
-
lock.locked?( c ).must_equal true
|
34
|
-
lock.locked?( c + ".bla" ).must_equal true
|
33
|
+
_(lock.locked?( c )).must_equal true
|
34
|
+
_(lock.locked?( c + ".bla" )).must_equal true
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -45,8 +45,8 @@ describe Maven::Tools::DSL::JarfileLock do
|
|
45
45
|
:runtime => [ 'huffle:puffle:321' ] } )
|
46
46
|
lock.dump
|
47
47
|
lock = subject.new( file )
|
48
|
-
lock.coordinates.must_equal ['huffle:puffle:321']
|
49
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
48
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321']
|
49
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
50
50
|
ensure
|
51
51
|
FileUtils.rm_f file_lock
|
52
52
|
end
|
@@ -57,43 +57,43 @@ describe Maven::Tools::DSL::JarfileLock do
|
|
57
57
|
|
58
58
|
lock.replace( { :test => [ 'bla:blas:123' ],
|
59
59
|
:runtime => [ 'huffle:puffle:321' ] } )
|
60
|
-
lock.coordinates.must_equal ['huffle:puffle:321']
|
61
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
60
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321']
|
61
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
62
62
|
|
63
63
|
lock.replace( { :runtime => [ 'huffle:puffle:321' ] } )
|
64
|
-
lock.coordinates.must_equal ['huffle:puffle:321']
|
65
|
-
lock.coordinates( :test ).must_equal []
|
64
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321']
|
65
|
+
_(lock.coordinates( :test )).must_equal []
|
66
66
|
|
67
67
|
lock.replace( { :test => [ 'bla:blas:123' ]} )
|
68
|
-
lock.coordinates.must_equal []
|
69
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
68
|
+
_(lock.coordinates).must_equal []
|
69
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
70
70
|
end
|
71
71
|
|
72
72
|
it 'can add missing data idempotent' do
|
73
73
|
lock = subject.new( 'something' )
|
74
74
|
|
75
|
-
lock.update_unlocked( { :test => [ 'bla:blas:123' ],
|
76
|
-
:runtime => [ 'huffle:puffle:321' ] } ).must_equal true
|
77
|
-
lock.update_unlocked( { :test => [ 'bla:blas:123' ],
|
78
|
-
:runtime => [ 'huffle:puffle:321' ] } ).must_equal true
|
79
|
-
lock.coordinates.must_equal ['huffle:puffle:321']
|
80
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
75
|
+
_(lock.update_unlocked( { :test => [ 'bla:blas:123' ],
|
76
|
+
:runtime => [ 'huffle:puffle:321' ] } )).must_equal true
|
77
|
+
_(lock.update_unlocked( { :test => [ 'bla:blas:123' ],
|
78
|
+
:runtime => [ 'huffle:puffle:321' ] } )).must_equal true
|
79
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321']
|
80
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
81
81
|
|
82
|
-
lock.update_unlocked( { :runtime => [ 'huffle:puffle:321' ] } ).must_equal true
|
83
|
-
lock.coordinates.must_equal ['huffle:puffle:321']
|
84
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
82
|
+
_(lock.update_unlocked( { :runtime => [ 'huffle:puffle:321' ] } )).must_equal true
|
83
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321']
|
84
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
85
85
|
|
86
|
-
lock.update_unlocked( { :runtime => [ 'huffle:puffle2:321' ] } ).must_equal true
|
87
|
-
lock.coordinates.must_equal ['huffle:puffle:321', 'huffle:puffle2:321']
|
88
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
86
|
+
_(lock.update_unlocked( { :runtime => [ 'huffle:puffle2:321' ] } )).must_equal true
|
87
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321', 'huffle:puffle2:321']
|
88
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
89
89
|
|
90
|
-
lock.update_unlocked( { :test => [ 'bla:blas:123' ]} ).must_equal true
|
91
|
-
lock.coordinates.must_equal ['huffle:puffle:321', 'huffle:puffle2:321']
|
92
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
90
|
+
_(lock.update_unlocked( { :test => [ 'bla:blas:123' ]} )).must_equal true
|
91
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321', 'huffle:puffle2:321']
|
92
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
93
93
|
|
94
|
-
lock.update_unlocked( { :test => [ 'bla:bla2:123' ]} ).must_equal true
|
95
|
-
lock.coordinates.must_equal ['huffle:puffle:321', 'huffle:puffle2:321']
|
96
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123', 'bla:bla2:123']
|
94
|
+
_(lock.update_unlocked( { :test => [ 'bla:bla2:123' ]} )).must_equal true
|
95
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321', 'huffle:puffle2:321']
|
96
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123', 'bla:bla2:123']
|
97
97
|
end
|
98
98
|
|
99
99
|
it 'fails add data on version conflict' do
|
@@ -102,17 +102,17 @@ describe Maven::Tools::DSL::JarfileLock do
|
|
102
102
|
lock.replace( { :test => [ 'bla:blas:123' ],
|
103
103
|
:runtime => [ 'huffle:puffle:321' ] } )
|
104
104
|
|
105
|
-
lock.update_unlocked( { :test => [ 'bla:blas:1233' ],
|
106
|
-
:runtime => [ 'huffle:puffle:3214' ] } ).must_equal false
|
107
|
-
lock.coordinates.must_equal ['huffle:puffle:321']
|
108
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
105
|
+
_(lock.update_unlocked( { :test => [ 'bla:blas:1233' ],
|
106
|
+
:runtime => [ 'huffle:puffle:3214' ] } )).must_equal false
|
107
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321']
|
108
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
109
109
|
|
110
|
-
lock.update_unlocked( { :runtime => [ 'huffle:puffle:3214' ] } ).must_equal false
|
111
|
-
lock.coordinates.must_equal ['huffle:puffle:321']
|
112
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
110
|
+
_(lock.update_unlocked( { :runtime => [ 'huffle:puffle:3214' ] } )).must_equal false
|
111
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321']
|
112
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
113
113
|
|
114
|
-
lock.update_unlocked( { :test => [ 'bla:blas:1233' ]} ).must_equal false
|
115
|
-
lock.coordinates.must_equal ['huffle:puffle:321']
|
116
|
-
lock.coordinates( :test ).must_equal ['bla:blas:123']
|
114
|
+
_(lock.update_unlocked( { :test => [ 'bla:blas:1233' ]} )).must_equal false
|
115
|
+
_(lock.coordinates).must_equal ['huffle:puffle:321']
|
116
|
+
_(lock.coordinates( :test )).must_equal ['bla:blas:123']
|
117
117
|
end
|
118
118
|
end
|
@@ -34,7 +34,7 @@ describe Maven::Tools::DSL::ProfileGemspec do
|
|
34
34
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
35
35
|
v = Maven::Tools::VERSION
|
36
36
|
v += '-SNAPSHOT' if v =~ /.dev$/
|
37
|
-
xml.must_equal( ProfileGemspecFile.read( 'maven-tools.xml', 'maven-tools',
|
37
|
+
_(xml).must_equal( ProfileGemspecFile.read( 'maven-tools.xml', 'maven-tools',
|
38
38
|
v ) )
|
39
39
|
end
|
40
40
|
|
@@ -42,28 +42,28 @@ describe Maven::Tools::DSL::ProfileGemspec do
|
|
42
42
|
subject.new parent, 'maven-tools.gemspec'
|
43
43
|
xml = ""
|
44
44
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
45
|
-
xml.must_equal( ProfileGemspecFile.read( 'maven-tools.xml', 'profile_gemspec_spec' ) )
|
45
|
+
_(xml).must_equal( ProfileGemspecFile.read( 'maven-tools.xml', 'profile_gemspec_spec' ) )
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'evals maven_tools.gemspec from yaml no gem dependencies' do
|
49
49
|
subject.new parent, 'maven-tools.gemspec', :no_gems => true
|
50
50
|
xml = ""
|
51
51
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
52
|
-
xml.must_equal( ProfileGemspecFile.read( 'no_gems.xml', 'gemspec_spec' ) )
|
52
|
+
_(xml).must_equal( ProfileGemspecFile.read( 'no_gems.xml', 'gemspec_spec' ) )
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'evals snapshot.gemspec' do
|
56
56
|
subject.new parent, 'snapshot.gemspec'
|
57
57
|
xml = ""
|
58
58
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
59
|
-
xml.must_equal( ProfileGemspecFile.read( 'snapshot.xml', 'snapshot', '1.a-SNAPSHOT' ) )
|
59
|
+
_(xml).must_equal( ProfileGemspecFile.read( 'snapshot.xml', 'snapshot', '1.a-SNAPSHOT' ) )
|
60
60
|
end
|
61
61
|
|
62
62
|
it 'evals gemspec with jar and pom dependencies' do
|
63
63
|
subject.new parent, 'jars_and_poms.gemspec'
|
64
64
|
xml = ""
|
65
65
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
66
|
-
xml.must_equal( ProfileGemspecFile.read( 'jars_and_poms.xml',
|
66
|
+
_(xml).must_equal( ProfileGemspecFile.read( 'jars_and_poms.xml',
|
67
67
|
'gemspec_spec' ) )
|
68
68
|
end
|
69
69
|
|
@@ -71,7 +71,7 @@ describe Maven::Tools::DSL::ProfileGemspec do
|
|
71
71
|
subject.new parent, :name => 'jars_and_poms.gemspec', :include_jars => true
|
72
72
|
xml = ""
|
73
73
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
74
|
-
xml.must_equal( ProfileGemspecFile.read( 'jars_and_poms_include_jars.xml',
|
74
|
+
_(xml).must_equal( ProfileGemspecFile.read( 'jars_and_poms_include_jars.xml',
|
75
75
|
'gemspec_spec' ) )
|
76
76
|
end
|
77
77
|
|
@@ -79,6 +79,6 @@ describe Maven::Tools::DSL::ProfileGemspec do
|
|
79
79
|
subject.new parent, 'unknown_license.gemspec'
|
80
80
|
xml = ""
|
81
81
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
82
|
-
xml.must_equal( ProfileGemspecFile.read( 'unknown_license.xml', 'gemspec_spec' ) )
|
82
|
+
_(xml).must_equal( ProfileGemspecFile.read( 'unknown_license.xml', 'gemspec_spec' ) )
|
83
83
|
end
|
84
84
|
end
|
@@ -34,7 +34,7 @@ describe Maven::Tools::DSL::ProjectGemspec do
|
|
34
34
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
35
35
|
v = Maven::Tools::VERSION
|
36
36
|
v += '-SNAPSHOT' if v =~ /.[[:alpha:]][[:alnum:]]*$/
|
37
|
-
xml.must_equal( XmlFile.read( 'maven-tools.xml', 'maven-tools',
|
37
|
+
_(xml).must_equal( XmlFile.read( 'maven-tools.xml', 'maven-tools',
|
38
38
|
v ) )
|
39
39
|
end
|
40
40
|
|
@@ -42,35 +42,35 @@ describe Maven::Tools::DSL::ProjectGemspec do
|
|
42
42
|
subject.new parent, 'maven-tools.gemspec'
|
43
43
|
xml = ""
|
44
44
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
45
|
-
xml.must_equal( XmlFile.read( 'maven-tools.xml', 'gemspec_spec' ) )
|
45
|
+
_(xml).must_equal( XmlFile.read( 'maven-tools.xml', 'gemspec_spec' ) )
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'evals maven_tools.gemspec from yaml with profile' do
|
49
49
|
subject.new parent, 'maven-tools.gemspec', :profile => :hidden
|
50
50
|
xml = ""
|
51
51
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
52
|
-
xml.must_equal( XmlFile.read( 'profile.xml', 'gemspec_spec' ) )
|
52
|
+
_(xml).must_equal( XmlFile.read( 'profile.xml', 'gemspec_spec' ) )
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'evals maven_tools.gemspec from yaml no gem dependencies' do
|
56
56
|
subject.new parent, 'maven-tools.gemspec', :no_gems => true
|
57
57
|
xml = ""
|
58
58
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
59
|
-
xml.must_equal( XmlFile.read( 'no_gems.xml', 'gemspec_spec' ) )
|
59
|
+
_(xml).must_equal( XmlFile.read( 'no_gems.xml', 'gemspec_spec' ) )
|
60
60
|
end
|
61
61
|
|
62
62
|
it 'evals snapshot.gemspec' do
|
63
63
|
subject.new parent, 'snapshot.gemspec'
|
64
64
|
xml = ""
|
65
65
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
66
|
-
xml.must_equal( XmlFile.read( 'snapshot.xml', 'snapshot', '1.a-SNAPSHOT' ) )
|
66
|
+
_(xml).must_equal( XmlFile.read( 'snapshot.xml', 'snapshot', '1.a-SNAPSHOT' ) )
|
67
67
|
end
|
68
68
|
|
69
69
|
it 'evals gemspec with jar and pom dependencies' do
|
70
70
|
subject.new parent, 'jars_and_poms.gemspec'
|
71
71
|
xml = ""
|
72
72
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
73
|
-
xml.must_equal( XmlFile.read( 'jars_and_poms.xml',
|
73
|
+
_(xml).must_equal( XmlFile.read( 'jars_and_poms.xml',
|
74
74
|
'gemspec_spec' ) )
|
75
75
|
end
|
76
76
|
|
@@ -78,7 +78,7 @@ describe Maven::Tools::DSL::ProjectGemspec do
|
|
78
78
|
subject.new parent, :name => 'jars_and_poms.gemspec', :include_jars => true
|
79
79
|
xml = ""
|
80
80
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
81
|
-
xml.must_equal( XmlFile.read( 'jars_and_poms_include_jars.xml',
|
81
|
+
_(xml).must_equal( XmlFile.read( 'jars_and_poms_include_jars.xml',
|
82
82
|
'gemspec_spec' ) )
|
83
83
|
end
|
84
84
|
|
@@ -91,7 +91,7 @@ describe Maven::Tools::DSL::ProjectGemspec do
|
|
91
91
|
subject.new parent, :name => 'extended.gemspec'
|
92
92
|
xml = ""
|
93
93
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
94
|
-
xml.must_equal( XmlFile.read( 'extended.xml',
|
94
|
+
_(xml).must_equal( XmlFile.read( 'extended.xml',
|
95
95
|
'gemspec_spec' ) )
|
96
96
|
end
|
97
97
|
|
@@ -99,6 +99,6 @@ describe Maven::Tools::DSL::ProjectGemspec do
|
|
99
99
|
subject.new parent, :name => 'unknown_license.gemspec'
|
100
100
|
xml = ""
|
101
101
|
Maven::Tools::Visitor.new( xml ).accept_project( parent.model )
|
102
|
-
xml.must_equal( XmlFile.read( 'unknown_license.xml', 'gemspec_spec') )
|
102
|
+
_(xml).must_equal( XmlFile.read( 'unknown_license.xml', 'gemspec_spec') )
|
103
103
|
end
|
104
104
|
end
|
@@ -25,9 +25,9 @@ describe Maven::Tools::GemspecDependencies do
|
|
25
25
|
subject { Maven::Tools::GemspecDependencies.new( spec ) }
|
26
26
|
|
27
27
|
it 'should setup artifact' do
|
28
|
-
subject.runtime.must_equal ["rubygems:thor:[0.14.6,2.0)", "rubygems:maven-tools:[0.32.3,0.32.99999]"]
|
29
|
-
subject.development.must_equal ["rubygems:minitest:[5.3,5.99999]", "rubygems:rake:[10.0,10.99999]"]
|
30
|
-
subject.java_runtime.must_equal [ ["sdas", "das", "jar", "tes", "123"],
|
28
|
+
_(subject.runtime).must_equal ["rubygems:thor:[0.14.6,2.0)", "rubygems:maven-tools:[0.32.3,0.32.99999]"]
|
29
|
+
_(subject.development).must_equal ["rubygems:minitest:[5.3,5.99999]", "rubygems:rake:[10.0,10.99999]"]
|
30
|
+
_(subject.java_runtime).must_equal [ ["sdas", "das", "jar", "tes", "123"],
|
31
31
|
["sdas", "das", "jar", "123"],
|
32
32
|
["sdas.asd", "das", "jar", "123", ["fds:fre"]],
|
33
33
|
["sdas.asd", "das", "jar", "bla", "123", ["fds:fre", "ferf:de"]],
|
@@ -37,7 +37,7 @@ describe Maven::Tools::GemspecDependencies do
|
|
37
37
|
["de.sdas.asd", "das", "jar", "123", ["fds:fre"]],
|
38
38
|
["de.sdas.asd", "das", "jar", "bla", "123", ["fds:fre", "ferf:de"]],
|
39
39
|
["de.sdas.asd", "das", "jar", "blub", "123", ["fds:fre","ferf:de"]] ]
|
40
|
-
subject.java_dependencies.must_equal [ [:compile, "sdas", "das", "jar", "tes", "123"],
|
40
|
+
_(subject.java_dependencies).must_equal [ [:compile, "sdas", "das", "jar", "tes", "123"],
|
41
41
|
[:compile, "sdas", "das", "jar", "123"],
|
42
42
|
[:compile, "sdas.asd", "das", "jar", "123", ["fds:fre"]],
|
43
43
|
[:compile, "sdas.asd", "das", "jar", "bla", "123", ["fds:fre", "ferf:de"]],
|
data/spec/jarfile_spec.rb
CHANGED
@@ -38,7 +38,7 @@ describe Maven::Tools::Jarfile do
|
|
38
38
|
|
39
39
|
it 'generates lockfile' do
|
40
40
|
subject.generate_lockfile(%w( a b c d e f ruby.bundler:bla))
|
41
|
-
File.read(jfile_lock).must_equal <<-EOF
|
41
|
+
_(File.read(jfile_lock)).must_equal <<-EOF
|
42
42
|
a
|
43
43
|
b
|
44
44
|
c
|
@@ -55,10 +55,10 @@ a:b:pom:3
|
|
55
55
|
a:c:jar:1
|
56
56
|
EOF
|
57
57
|
end
|
58
|
-
subject.locked.must_equal ["a:b:pom:3", "a:c:jar:1"]
|
59
|
-
subject.locked?("a:b:pom:321").must_equal true
|
60
|
-
subject.locked?("a:b:jar:321").must_equal true
|
61
|
-
subject.locked?("a:d:jar:432").must_equal false
|
58
|
+
_(subject.locked).must_equal ["a:b:pom:3", "a:c:jar:1"]
|
59
|
+
_(subject.locked?("a:b:pom:321")).must_equal true
|
60
|
+
_(subject.locked?("a:b:jar:321")).must_equal true
|
61
|
+
_(subject.locked?("a:d:jar:432")).must_equal false
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'populate repositories' do
|
@@ -70,11 +70,11 @@ source "http://example.org/repo/3"
|
|
70
70
|
EOF
|
71
71
|
end
|
72
72
|
subject.populate_unlocked container
|
73
|
-
container.repositories.size.must_equal 3
|
74
|
-
container.artifacts.size.must_equal 0
|
75
|
-
container.repositories[0].must_equal "first"
|
76
|
-
container.repositories[1].must_equal "second"
|
77
|
-
container.repositories[2].must_equal "http://example.org/repo/3"
|
73
|
+
_(container.repositories.size).must_equal 3
|
74
|
+
_(container.artifacts.size).must_equal 0
|
75
|
+
_(container.repositories[0]).must_equal "first"
|
76
|
+
_(container.repositories[1]).must_equal "second"
|
77
|
+
_(container.repositories[2]).must_equal "http://example.org/repo/3"
|
78
78
|
end
|
79
79
|
|
80
80
|
it 'populate artifacts without locked' do
|
@@ -85,10 +85,10 @@ pom 'x:y', '987'
|
|
85
85
|
EOF
|
86
86
|
end
|
87
87
|
subject.populate_unlocked container
|
88
|
-
container.repositories.size.must_equal 0
|
89
|
-
container.artifacts.size.must_equal 2
|
90
|
-
container.artifacts[0].to_s.must_equal "a:b:jar:123"
|
91
|
-
container.artifacts[1].to_s.must_equal "x:y:pom:987"
|
88
|
+
_(container.repositories.size).must_equal 0
|
89
|
+
_(container.artifacts.size).must_equal 2
|
90
|
+
_(container.artifacts[0].to_s).must_equal "a:b:jar:123"
|
91
|
+
_(container.artifacts[1].to_s).must_equal "x:y:pom:987"
|
92
92
|
end
|
93
93
|
|
94
94
|
it 'populate artifacts with locked' do
|
@@ -105,9 +105,9 @@ EOF
|
|
105
105
|
end
|
106
106
|
|
107
107
|
subject.populate_unlocked container
|
108
|
-
container.repositories.size.must_equal 0
|
109
|
-
container.artifacts.size.must_equal 1
|
110
|
-
container.artifacts[0].to_s.must_equal "x:y:pom:987"
|
108
|
+
_(container.repositories.size).must_equal 0
|
109
|
+
_(container.artifacts.size).must_equal 1
|
110
|
+
_(container.artifacts[0].to_s).must_equal "x:y:pom:987"
|
111
111
|
end
|
112
112
|
|
113
113
|
it 'populate locked artifacts' do
|
@@ -118,8 +118,8 @@ EOF
|
|
118
118
|
end
|
119
119
|
|
120
120
|
subject.populate_locked container
|
121
|
-
container.repositories.size.must_equal 0
|
122
|
-
container.artifacts.size.must_equal 1
|
123
|
-
container.artifacts[0].to_s.must_equal "a:b:jar:432"
|
121
|
+
_(container.repositories.size).must_equal 0
|
122
|
+
_(container.artifacts.size).must_equal 1
|
123
|
+
_(container.artifacts[0].to_s).must_equal "a:b:jar:432"
|
124
124
|
end
|
125
125
|
end
|
data/spec/pom_spec.rb
CHANGED
@@ -9,7 +9,7 @@ describe Maven::Tools::POM do
|
|
9
9
|
it "should convert #{dir}" do
|
10
10
|
pom = Maven::Tools::POM.new( dir )
|
11
11
|
file = File.join( dir, 'pom.xml' )
|
12
|
-
file = File.join( File.dirname( dir ), 'pom.xml' ) unless File.
|
12
|
+
file = File.join( File.dirname( dir ), 'pom.xml' ) unless File.exist? file
|
13
13
|
pom_xml = File.read( file )
|
14
14
|
pom_xml.sub!( /<!--(.|\n)*-->\n/, '' )
|
15
15
|
pom_xml.sub!( /<?.*?>\n/, '' )
|
@@ -18,7 +18,7 @@ describe Maven::Tools::POM do
|
|
18
18
|
pom_xml.gsub!( /tesla-polyglot/, 'polyglot' )
|
19
19
|
pom_xml.gsub!( /${tesla.version}/, Maven::Tools::VERSIONS[ :polyglot_version ] )
|
20
20
|
|
21
|
-
pom.to_s.must_equal pom_xml
|
21
|
+
_(pom.to_s).must_equal pom_xml
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maven-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Meier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|