maven-tools 1.0.2 → 1.0.3
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/lib/maven/tools/artifact.rb +5 -0
- data/lib/maven/tools/coordinate.rb +13 -3
- data/lib/maven/tools/dsl.rb +11 -7
- data/lib/maven/tools/gemspec_dependencies.rb +19 -3
- data/lib/maven/tools/pom.rb +1 -0
- data/lib/maven/tools/version.rb +1 -1
- data/lib/maven/tools/versions.rb +1 -1
- data/spec/coordinate_spec.rb +5 -0
- data/spec/gemfile/pom.xml +1 -1
- data/spec/gemfile_include_jars/pom.xml +1 -1
- data/spec/gemfile_with_access_to_model/pom.xml +1 -1
- data/spec/gemfile_with_custom_source/pom.xml +1 -1
- data/spec/gemfile_with_custom_source_and_custom_jarname/pom.xml +1 -1
- data/spec/gemfile_with_extras/pom.xml +1 -1
- data/spec/gemfile_with_groups/pom.xml +1 -1
- data/spec/gemfile_with_groups_and_lockfile/pom.xml +1 -1
- data/spec/gemfile_with_lock/pom.xml +1 -1
- data/spec/gemfile_with_path/pom.xml +1 -1
- data/spec/gemfile_with_platforms/pom.xml +1 -1
- data/spec/gemfile_with_source/pom.xml +1 -1
- data/spec/gemfile_with_source_and_custom_jarname/pom.xml +1 -1
- data/spec/gemfile_with_source_and_no_jar/pom.xml +1 -1
- data/spec/gemfile_with_test_group/pom.xml +1 -1
- data/spec/gemfile_without_gemspec/pom.xml +1 -1
- data/spec/gemspec/pom.xml +1 -1
- data/spec/gemspec_dependencies_spec.rb +10 -0
- data/spec/gemspec_in_profile/pom.xml +1 -1
- data/spec/gemspec_include_jars/pom.xml +1 -1
- data/spec/gemspec_no_rubygems_repo/pom.xml +1 -1
- data/spec/gemspec_prerelease/pom.xml +1 -1
- data/spec/gemspec_prerelease_snapshot/pom.xml +1 -1
- data/spec/gemspec_with_access_to_model/pom.xml +1 -1
- data/spec/gemspec_with_custom_source/pom.xml +1 -1
- data/spec/gemspec_with_custom_source_and_custom_jarname/pom.xml +1 -1
- data/spec/gemspec_with_extras/pom.xml +1 -1
- data/spec/gemspec_with_prereleased_dependency/pom.xml +1 -1
- data/spec/gemspec_with_prereleased_dependency_and_no_repo/pom.xml +1 -1
- data/spec/gemspec_with_source/pom.xml +1 -1
- data/spec/gemspec_with_source_and_custom_jarname/pom.xml +1 -1
- data/spec/gemspec_with_source_and_no_jar/pom.xml +1 -1
- data/spec/my/my.gemspec +4 -1
- metadata +2 -4
- data/spec/my/my-1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f27e73f0d87bcdd02d6ac3dc46f50458ad2a315
|
4
|
+
data.tar.gz: 2b12c4aedd8b1afcc3f5dee285339264eb1d8e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ea1554560fa1fbea94725b073ac4dc82681db0b8c307aee392ba2698075d6d2085b2fe706f87eaae1c4201a68380529665279e91fb2875147bf3e04f0b74c64
|
7
|
+
data.tar.gz: 756eba360b0a4dbd21546a19d9c20cfdb1e118c4a6b0777e1156d93d01ef2920535252b7ad67d59378c8fa5dfedda87534a52f3ca003215761399769a7134f2e
|
data/lib/maven/tools/artifact.rb
CHANGED
@@ -142,6 +142,7 @@ module Maven
|
|
142
142
|
options.delete( :version )
|
143
143
|
options.delete( :classifier )
|
144
144
|
options.delete( :exclusions )
|
145
|
+
options.delete( :scope ) if options[ :scope ] == :compile
|
145
146
|
self.merge!( options )
|
146
147
|
end
|
147
148
|
end
|
@@ -150,6 +151,10 @@ module Maven
|
|
150
151
|
[ self[:group_id], self[:artifact_id], self[:version], self[:classifier] ].select { |o| o }.join( ':' )
|
151
152
|
end
|
152
153
|
|
154
|
+
def key
|
155
|
+
@key ||= [ self[:group_id], self[:artifact_id], self[:classifier] ].select { |o| o }.join( ':' )
|
156
|
+
end
|
157
|
+
|
153
158
|
def exclusions
|
154
159
|
if key?( :exclusions )
|
155
160
|
self[:exclusions].inspect.gsub( /[\[\]" ]/, '' ).split( /,/ )
|
@@ -21,6 +21,17 @@
|
|
21
21
|
module Maven
|
22
22
|
module Tools
|
23
23
|
module Coordinate
|
24
|
+
def to_split_coordinate_with_scope( line )
|
25
|
+
line = line.sub( /#.*^/, '' )
|
26
|
+
scope = :compile
|
27
|
+
line.sub!( /,\s+:scope\s+=>\s(:provided|:runtime|:compile|:test)/ ) do |part|
|
28
|
+
scope = part.sub( /.*:/, '' ).to_sym
|
29
|
+
''
|
30
|
+
end
|
31
|
+
coord = to_split_coordinate( line )
|
32
|
+
[ scope ] + coord if coord
|
33
|
+
end
|
34
|
+
|
24
35
|
def to_split_coordinate( line )
|
25
36
|
if line =~ /^\s*(jar|pom)\s/
|
26
37
|
packaging = line.strip.sub(/\s+.*/, '')
|
@@ -28,7 +39,6 @@ module Maven
|
|
28
39
|
# Remove packaging, comments and whitespaces
|
29
40
|
sanitized_line = line.sub(/\s*[a-z]+\s+/, '').sub(/#.*/,'').gsub(/\s+/,'')
|
30
41
|
|
31
|
-
|
32
42
|
exclusions = nil
|
33
43
|
sanitized_line.gsub!( /[,:](\[.+:.+\]|'\[.+:.+\]'|"\[.+:.+\]")/ ) do |match|
|
34
44
|
exclusions = match.gsub( /['"]/, '' )[2..-2].split( /,\s*/ )
|
@@ -66,8 +76,8 @@ module Maven
|
|
66
76
|
parts.insert( 2, packaging )
|
67
77
|
parts << exclusions
|
68
78
|
|
69
|
-
# make sure there are
|
70
|
-
parts.
|
79
|
+
# make sure there are no nils
|
80
|
+
parts.compact
|
71
81
|
end
|
72
82
|
end
|
73
83
|
|
data/lib/maven/tools/dsl.rb
CHANGED
@@ -153,7 +153,11 @@ module Maven
|
|
153
153
|
end
|
154
154
|
|
155
155
|
if pr && pr.dependencies.empty?
|
156
|
-
@current.
|
156
|
+
if @current.respond_to? :delete
|
157
|
+
@current.profiles.delete( pr )
|
158
|
+
else
|
159
|
+
@current.profiles.remove( pr )
|
160
|
+
end
|
157
161
|
end
|
158
162
|
|
159
163
|
if pr && !pr.dependencies.empty?
|
@@ -259,7 +263,8 @@ module Maven
|
|
259
263
|
source_directory source
|
260
264
|
end
|
261
265
|
end
|
262
|
-
|
266
|
+
# TODO rename "no_rubygems_repo" to "no_jar_support"
|
267
|
+
if options[ :no_rubygems_repo ] != true && jar && ( source ||
|
263
268
|
::File.exists?( ::File.join( basedir, 'src', 'main', 'java' ) ) )
|
264
269
|
unless spec.nil? || spec.platform.to_s.match( /java|jruby/ )
|
265
270
|
warn "gem is not a java platform gem but has a jar and source"
|
@@ -437,10 +442,8 @@ module Maven
|
|
437
442
|
deps = all_deps( spec )
|
438
443
|
end
|
439
444
|
|
440
|
-
|
441
|
-
|
442
|
-
_dependency Maven::Tools::Artifact.new( *d )
|
443
|
-
end
|
445
|
+
deps.java_dependency_artifacts.each do |a|
|
446
|
+
_dependency a
|
444
447
|
end
|
445
448
|
end
|
446
449
|
|
@@ -1049,10 +1052,11 @@ module Maven
|
|
1049
1052
|
def _dependency( type, *args, &block )
|
1050
1053
|
do_dependency( false, type, *args, &block )
|
1051
1054
|
end
|
1052
|
-
|
1055
|
+
alias :dependency_artifact :_dependency
|
1053
1056
|
def _dependency!( type, *args, &block )
|
1054
1057
|
do_dependency( true, type, *args, &block )
|
1055
1058
|
end
|
1059
|
+
alias :dependency_artifact! :_dependency!
|
1056
1060
|
|
1057
1061
|
def _dependency?( type, *args )
|
1058
1062
|
find_dependency( dependency_container,
|
@@ -14,9 +14,22 @@ module Maven
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def java_runtime
|
17
|
-
|
17
|
+
warn 'deprecated us java_dependency_artifacts instead'
|
18
|
+
_deps( :java ).select { |d| d[0] == :compile }.collect { |d| d[ 1..-1] }
|
18
19
|
end
|
19
20
|
|
21
|
+
def java_dependencies
|
22
|
+
warn 'deprecated us java_dependency_artifacts instead'
|
23
|
+
_deps( :java )
|
24
|
+
end
|
25
|
+
|
26
|
+
def java_dependency_artifacts
|
27
|
+
_deps( :java ).collect do |d|
|
28
|
+
scope = d.shift
|
29
|
+
d += [nil, nil, { :scope => scope } ][ (d.size - 4 )..2 ]
|
30
|
+
Maven::Tools::Artifact.new( *d )
|
31
|
+
end
|
32
|
+
end
|
20
33
|
def runtime
|
21
34
|
_deps( :runtime )
|
22
35
|
end
|
@@ -43,8 +56,11 @@ module Maven
|
|
43
56
|
_deps( dep.type ) << "rubygems:#{dep.name}:#{to_version( *versions )}"
|
44
57
|
end
|
45
58
|
@spec.requirements.each do |req|
|
46
|
-
|
47
|
-
|
59
|
+
req.sub!( /#.*^/, '' )
|
60
|
+
coord = to_split_coordinate_with_scope( req )
|
61
|
+
if coord && coord.size > 1
|
62
|
+
_deps( :java ) << coord
|
63
|
+
end
|
48
64
|
end
|
49
65
|
end
|
50
66
|
end
|
data/lib/maven/tools/pom.rb
CHANGED
data/lib/maven/tools/version.rb
CHANGED
data/lib/maven/tools/versions.rb
CHANGED
data/spec/coordinate_spec.rb
CHANGED
@@ -74,4 +74,9 @@ describe Maven::Tools::Coordinate do
|
|
74
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
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
76
|
end
|
77
|
+
|
78
|
+
it 'supports declarations with scope' do
|
79
|
+
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]"]
|
80
|
+
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]"]
|
81
|
+
end
|
77
82
|
end
|
data/spec/gemfile/pom.xml
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
</scm>
|
31
31
|
<properties>
|
32
32
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
33
|
-
<jruby.plugins.version>1.0.
|
33
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
34
34
|
<version_from_model>1.5.0</version_from_model>
|
35
35
|
</properties>
|
36
36
|
<repositories>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
</scm>
|
31
31
|
<properties>
|
32
32
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
33
|
-
<jruby.plugins.version>1.0.
|
33
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
34
34
|
<tesla.dump.pom>pom.xml</tesla.dump.pom>
|
35
35
|
<tesla.dump.readonly>true</tesla.dump.readonly>
|
36
36
|
</properties>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<name>gemfile_with_groups</name>
|
18
18
|
<properties>
|
19
19
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
20
|
-
<jruby.plugins.version>1.0.
|
20
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
21
21
|
</properties>
|
22
22
|
<dependencies>
|
23
23
|
<dependency>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<name>gemfile_with_groups_and_lockfile</name>
|
18
18
|
<properties>
|
19
19
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
20
|
-
<jruby.plugins.version>1.0.
|
20
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
21
21
|
</properties>
|
22
22
|
<repositories>
|
23
23
|
<repository>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<name>gemfile_with_path</name>
|
18
18
|
<properties>
|
19
19
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
20
|
-
<jruby.plugins.version>1.0.
|
20
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
21
21
|
</properties>
|
22
22
|
<dependencies>
|
23
23
|
<dependency>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<name>gemfile_with_platforms</name>
|
18
18
|
<properties>
|
19
19
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
20
|
-
<jruby.plugins.version>1.0.
|
20
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
21
21
|
</properties>
|
22
22
|
<dependencies>
|
23
23
|
<dependency>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<name>gemfile_with_test_group</name>
|
9
9
|
<properties>
|
10
10
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
11
|
-
<jruby.plugins.version>1.0.
|
11
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
12
12
|
</properties>
|
13
13
|
<repositories>
|
14
14
|
<repository>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<name>gemfile_without_gemspec</name>
|
18
18
|
<properties>
|
19
19
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
20
|
-
<jruby.plugins.version>1.0.
|
20
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
21
21
|
</properties>
|
22
22
|
<dependencies>
|
23
23
|
<dependency>
|
data/spec/gemspec/pom.xml
CHANGED
@@ -37,5 +37,15 @@ 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"],
|
41
|
+
[:compile, "sdas", "das", "jar", "123"],
|
42
|
+
[:compile, "sdas.asd", "das", "jar", "123", ["fds:fre"]],
|
43
|
+
[:compile, "sdas.asd", "das", "jar", "bla", "123", ["fds:fre", "ferf:de"]],
|
44
|
+
[:compile, "sdas.asd", "das", "jar", "blub", "123", ["fds:fre", "ferf:de"]],
|
45
|
+
[:compile, "de.sdas", "das", "jar", "tes", "123"],
|
46
|
+
[:compile, "de.sdas", "das", "jar", "123"],
|
47
|
+
[:compile, "de.sdas.asd", "das", "jar", "123", ["fds:fre"]],
|
48
|
+
[:compile, "de.sdas.asd", "das", "jar", "bla", "123", ["fds:fre", "ferf:de"]],
|
49
|
+
[:compile, "de.sdas.asd", "das", "jar", "blub", "123", ["fds:fre","ferf:de"]] ]
|
40
50
|
end
|
41
51
|
end
|
@@ -32,7 +32,7 @@
|
|
32
32
|
</build>
|
33
33
|
<properties>
|
34
34
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
35
|
-
<jruby.plugins.version>1.0.
|
35
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
36
36
|
</properties>
|
37
37
|
<dependencies>
|
38
38
|
<dependency>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
</scm>
|
31
31
|
<properties>
|
32
32
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
33
|
-
<jruby.plugins.version>1.0.
|
33
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
34
34
|
<version_from_model>1.5.0</version_from_model>
|
35
35
|
</properties>
|
36
36
|
<repositories>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
</scm>
|
31
31
|
<properties>
|
32
32
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
33
|
-
<jruby.plugins.version>1.0.
|
33
|
+
<jruby.plugins.version>1.0.4</jruby.plugins.version>
|
34
34
|
<tesla.dump.pom>pom.xml</tesla.dump.pom>
|
35
35
|
<tesla.dump.readonly>true</tesla.dump.readonly>
|
36
36
|
</properties>
|
data/spec/my/my.gemspec
CHANGED
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.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Meier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -223,7 +223,6 @@ files:
|
|
223
223
|
- spec/gemspec_with_extras/bouncy-castle-java.gemspec
|
224
224
|
- spec/gemspec_with_source_and_no_jar/bouncy-castle-java.gemspec
|
225
225
|
- spec/gemfile_with_extras/bouncy-castle-java.gemspec
|
226
|
-
- spec/my/my-1.0.gem
|
227
226
|
homepage: http://github.com/torquebox/maven-tools
|
228
227
|
licenses:
|
229
228
|
- MIT
|
@@ -394,4 +393,3 @@ test_files:
|
|
394
393
|
- spec/gemspec_with_extras/bouncy-castle-java.gemspec
|
395
394
|
- spec/gemspec_with_source_and_no_jar/bouncy-castle-java.gemspec
|
396
395
|
- spec/gemfile_with_extras/bouncy-castle-java.gemspec
|
397
|
-
- spec/my/my-1.0.gem
|
data/spec/my/my-1.0.gem
DELETED
Binary file
|