jar-dependencies 0.1.4 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41b0779dda127fa309b6e7403b2f4dab16b4d1fe
4
- data.tar.gz: 76fc989f956c1e72a140de043a417a713a444ecc
3
+ metadata.gz: 47218aaa72a8f9a2e38b5caba257a637a30419e6
4
+ data.tar.gz: 657965ecece116b92e2979669db3f9f2c2a9e8b4
5
5
  SHA512:
6
- metadata.gz: 75bc7bc19f0f0a41423a2be7206bb125ac7735099a48b7250193b8948d6e4da3de4ec36a2641c0eb727a83d02c57aa2502d62c0a6a0b2ce0e687ef3ce4e48f0d
7
- data.tar.gz: 06afdf617b0a7b17f3c6095039bec02a7202a42afe298ecc59c725e0a57225ecc76cacb53abf07d2882654d179560096902eec97aa5ab2394d0f2d121af66272
6
+ metadata.gz: 8118b85d509069969b158b033bd5af94b8a177b3287e7fb502cb3a30ad403bd91993c50f685909c0c670d5eebc3ab4974724b1349d629809550bcb3a48f75be6
7
+ data.tar.gz: 77736c9d2020481c94e913885e58ee41bf410edc7211ccf9543f85df3440446fc904a009254e72cebb104a572ca8efead09e5241820c88aae6feaf24a04cb9cc
data/Mavenfile CHANGED
@@ -13,7 +13,7 @@ end
13
13
  #snapshot_repository :jruby, 'http://ci.jruby.org/snapshots/maven'
14
14
 
15
15
  # (jruby-1.6.8 mode 1.8 produces a lot of yaml errors parsing gemspecs)
16
- properties( 'jruby.versions' => ['1.6.8', '1.7.13'#,'9000.dev-SNAPSHOT'
16
+ properties( 'jruby.versions' => ['1.6.8', '1.7.12', '1.7.16.1'#,'9000.dev-SNAPSHOT'
17
17
  ].join(','),
18
18
  'jruby.modes' => ['1.9', '2.0','2.1'].join(','),
19
19
  # just lock the version
@@ -25,9 +25,9 @@ plugin :invoker, '1.8' do
25
25
  execute_goals( :install, :run,
26
26
  :id => 'integration-tests',
27
27
  :projectsDirectory => 'integration',
28
- :properties => { 'jar-dependencies.version' => '${project.version}' },
29
- :pomIncludes => [ '*/pom.xml' ],
30
- :streamLogs => true )
28
+ :streamLogs => true ,
29
+ :cloneProjectsTo => '${project.build.directory}',
30
+ :properties => { 'jar-dependencies.version' => '${project.version}' })
31
31
  end
32
32
 
33
33
  # vim: syntax=Ruby
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'jar-dependencies'
5
- s.version = "0.1.4"
5
+ s.version = "0.1.7"
6
6
  s.author = 'christian meier'
7
7
  s.email = [ 'mkristian@web.de' ]
8
8
  s.summary = 'manage jar dependencies for gems'
@@ -18,10 +18,9 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.description = 'manage jar dependencies for gems and keep track which jar was already loaded using maven artifact coordinates. it warns on version conflicts and loads only ONE jar assuming the first one is compatible to the second one otherwise your project needs to lock down the right version.'
20
20
 
21
- s.requirements << "gem ruby-maven, ~> 3.1.1.0, :scope => :runtime"
22
-
23
21
  s.add_development_dependency 'minitest', '~> 5.3'
24
22
  s.add_development_dependency 'rake', '~> 10.2'
23
+ s.add_development_dependency "ruby-maven", "~> 3.1.1.0.8"
25
24
  end
26
25
 
27
26
  # vim: syntax=Ruby
@@ -55,7 +55,7 @@ module Jars
55
55
  end
56
56
 
57
57
  def no_require?
58
- to_boolean( NO_REQUIRE )
58
+ @frozen || to_boolean( NO_REQUIRE )
59
59
  end
60
60
 
61
61
  def quiet?
@@ -75,7 +75,7 @@ module Jars
75
75
  end
76
76
 
77
77
  def freeze_loading
78
- ENV[ NO_REQUIRE ] = 'true'
78
+ @frozen = true
79
79
  end
80
80
 
81
81
  def reset
data/lib/jar_installer.rb CHANGED
@@ -39,8 +39,8 @@ module Jars
39
39
  setup_type( line )
40
40
 
41
41
  line.sub!( /^\s+/, '' )
42
- @coord = line.sub( /:[^:]+:[^:]+$/, '' )
43
- first, second = line.sub( /:[^:]+:[^:]+$/, '' ).split( /:#{type}:/ )
42
+ @coord = line.sub( /:[^:]+:([A-Z]:\\)?[^:]+$/, '' )
43
+ first, second = @coord.split( /:#{type}:/ )
44
44
  group_id, artifact_id = first.split( /:/ )
45
45
  parts = group_id.split( '.' )
46
46
  parts << artifact_id
@@ -50,9 +50,14 @@ module Jars
50
50
 
51
51
  setup_scope( line )
52
52
 
53
- line.gsub!( /:jar:|:pom:|:test:|:compile:|:runtime:|:provided:/, ':' )
54
- @file = line.sub( /^.*:/, '' ).strip
55
- @gav = line.sub( /:[^:]+$/, '' )
53
+ reg = /:jar:|:pom:|:test:|:compile:|:runtime:|:provided:|:system:/
54
+ @file = line.slice(@coord.length, line.length).sub(reg, '').strip
55
+ @system = nil != (line =~ /:system:/)
56
+ @gav = @coord.sub(reg, ':')
57
+ end
58
+
59
+ def system?
60
+ @system
56
61
  end
57
62
  end
58
63
 
@@ -88,18 +93,25 @@ module Jars
88
93
  def self.vendor_file( dir, dep )
89
94
  vendored = File.join( dir, dep.path )
90
95
  FileUtils.mkdir_p( File.dirname( vendored ) )
91
- FileUtils.cp( dep.file, vendored )
96
+ FileUtils.cp( dep.file, vendored ) unless dep.system?
97
+ end
98
+
99
+ def self.write_dep( file, dir, dep, vendor )
100
+ return if dep.type != :jar || dep.scope != :runtime
101
+ if dep.system?
102
+ file.puts( "require( '#{dep.file}' )" ) if file
103
+ elsif dep.scope == :runtime
104
+ vendor_file( dir, dep ) if vendor
105
+ file.puts( "require_jar( '#{dep.gav.gsub( /:/, "', '" )}' )" ) if file
106
+ end
92
107
  end
93
108
 
94
109
  def self.install_deps( deps, dir, require_filename, vendor )
95
110
  f = write_require_file( require_filename ) if require_filename
96
111
  deps.each do |dep|
97
- next if dep.type != :jar || dep.scope != :runtime
98
- args = dep.gav.gsub( /:/, "', '" )
99
- vendor_file( dir, dep ) if vendor
100
- f.puts( "require_jar( '#{args}' )" ) if f
112
+ write_dep( f, dir, dep, vendor )
101
113
  end
102
- yield f if block_given?
114
+ yield f if block_given? and f
103
115
  ensure
104
116
  f.close if f
105
117
  end
@@ -153,6 +165,7 @@ module Jars
153
165
 
154
166
  def ruby_maven_install_options=( options )
155
167
  @options = options.dup
168
+ @options.delete( :ignore_dependencies )
156
169
  end
157
170
 
158
171
  def vendor_jars( write_require_file = true )
@@ -193,7 +206,7 @@ module Jars
193
206
  end
194
207
 
195
208
  def setup_arguments( deps )
196
- args = [ 'dependency:list', "-DoutputFile=#{deps}", '-DincludeScope=runtime', '-DoutputAbsoluteArtifactFilename=true', '-DincludeTypes=jar', '-DoutputScope=true', '-f', @specfile ]
209
+ args = [ 'dependency:list', "-DoutputFile=#{deps}", '-DoutputAbsoluteArtifactFilename=true', '-DincludeTypes=jar', '-DoutputScope=true', '-f', @specfile ]
197
210
 
198
211
  if Jars.debug?
199
212
  args << '-X'
@@ -236,7 +249,7 @@ module Jars
236
249
  raise "there was an error installing 'ruby-maven'. please install it manually: #{e.inspect}"
237
250
  end
238
251
 
239
- def monkey_path_gem_dependencies
252
+ def monkey_patch_gem_dependencies
240
253
  # monkey patch to NOT include gem dependencies
241
254
  require 'maven/tools/gemspec_dependencies'
242
255
  eval <<EOF
@@ -250,7 +263,7 @@ EOF
250
263
  def install_dependencies
251
264
  lazy_load_maven
252
265
 
253
- monkey_path_gem_dependencies
266
+ monkey_patch_gem_dependencies
254
267
 
255
268
  deps = File.join( @basedir, 'deps.lst' )
256
269
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jar-dependencies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.7
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-10-27 00:00:00.000000000 Z
11
+ date: 2014-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -38,6 +38,20 @@ dependencies:
38
38
  version: '10.2'
39
39
  prerelease: false
40
40
  type: :development
41
+ - !ruby/object:Gem::Dependency
42
+ name: ruby-maven
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 3.1.1.0.8
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ~>
51
+ - !ruby/object:Gem::Version
52
+ version: 3.1.1.0.8
53
+ prerelease: false
54
+ type: :development
41
55
  description: manage jar dependencies for gems and keep track which jar was already loaded using maven artifact coordinates. it warns on version conflicts and loads only ONE jar assuming the first one is compatible to the second one otherwise your project needs to lock down the right version.
42
56
  email:
43
57
  - mkristian@web.de
@@ -76,8 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
90
  - - '>='
77
91
  - !ruby/object:Gem::Version
78
92
  version: '0'
79
- requirements:
80
- - gem ruby-maven, ~> 3.1.1.0, :scope => :runtime
93
+ requirements: []
81
94
  rubyforge_project:
82
95
  rubygems_version: 2.1.9
83
96
  signing_key: