jar-dependencies 0.1.7 → 0.1.8

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: 47218aaa72a8f9a2e38b5caba257a637a30419e6
4
- data.tar.gz: 657965ecece116b92e2979669db3f9f2c2a9e8b4
3
+ metadata.gz: f607cf0e0acf6dc622b37a829a8adc1322edfbf6
4
+ data.tar.gz: 8cf7cc1b6d81ca0f1c664a98b6519586265fa813
5
5
  SHA512:
6
- metadata.gz: 8118b85d509069969b158b033bd5af94b8a177b3287e7fb502cb3a30ad403bd91993c50f685909c0c670d5eebc3ab4974724b1349d629809550bcb3a48f75be6
7
- data.tar.gz: 77736c9d2020481c94e913885e58ee41bf410edc7211ccf9543f85df3440446fc904a009254e72cebb104a572ca8efead09e5241820c88aae6feaf24a04cb9cc
6
+ metadata.gz: b4bfa3b22e9fd05eee1710cc4859799a7271d6d9779ef86be3925cb08ace83e33e48c3d30bfcd0944995192e4c98414638afe607fe51141c8cbfe9c9d8138fc8
7
+ data.tar.gz: 326a5440977b4440e20698680843e1f2da0bfc69abc6e285cac0e0e345f25ebef9455fe1659d6c211bd904f6b376ce859cb04c752a358432686afb90ad6d3423
data/Mavenfile CHANGED
@@ -13,9 +13,9 @@ 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.12', '1.7.16.1'#,'9000.dev-SNAPSHOT'
16
+ properties( 'jruby.versions' => ['1.6.8', '1.7.12', '1.7.19', '9.0.0.0.pre1'
17
17
  ].join(','),
18
- 'jruby.modes' => ['1.9', '2.0','2.1'].join(','),
18
+ 'jruby.modes' => ['1.9', '2.0', '2.1'].join(','),
19
19
  # just lock the version
20
20
  'jruby.version' => '1.7.13',
21
21
  'tesla.dump.pom' => 'pom.xml',
@@ -25,7 +25,8 @@ plugin :invoker, '1.8' do
25
25
  execute_goals( :install, :run,
26
26
  :id => 'integration-tests',
27
27
  :projectsDirectory => 'integration',
28
- :streamLogs => true ,
28
+ :streamLogs => true,
29
+ :goals => ['install'],
29
30
  :cloneProjectsTo => '${project.build.directory}',
30
31
  :properties => { 'jar-dependencies.version' => '${project.version}' })
31
32
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'jar-dependencies'
5
- s.version = "0.1.7"
5
+ s.version = "0.1.8"
6
6
  s.author = 'christian meier'
7
7
  s.email = [ 'mkristian@web.de' ]
8
8
  s.summary = 'manage jar dependencies for gems'
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.executable = 'bundle-with-jars'
14
14
 
15
- s.files = Dir[ 'lib/*rb' ]
15
+ s.files = Dir[ 'lib/**/*rb' ]
16
16
  s.files += Dir[ '*file' ]
17
17
  s.files += [ 'Readme.md', 'jar-dependencies.gemspec', 'MIT-LICENSE' ]
18
18
 
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_development_dependency 'minitest', '~> 5.3'
22
22
  s.add_development_dependency 'rake', '~> 10.2'
23
- s.add_development_dependency "ruby-maven", "~> 3.1.1.0.8"
23
+ s.add_development_dependency "ruby-maven", "~> 3.1.1.0.9"
24
24
  end
25
25
 
26
26
  # vim: syntax=Ruby
@@ -20,14 +20,18 @@
20
20
  #
21
21
 
22
22
  module Jars
23
- HOME = 'JARS_HOME'.freeze
24
- MAVEN_SETTINGS = 'JARS_MAVEN_SETTINGS'.freeze
25
- SKIP = 'JARS_SKIP'.freeze
26
- NO_REQUIRE = 'JARS_NO_REQUIRE'.freeze
27
- QUIET = 'JARS_QUIET'.freeze
28
- VERBOSE = 'JARS_VERBOSE'.freeze
29
- DEBUG = 'JARS_DEBUG'.freeze
30
- VENDOR = 'JARS_VENDOR'.freeze
23
+ unless defined? Jars::MAVEN_SETTINGS
24
+ HOME = 'JARS_HOME'.freeze
25
+ MAVEN_SETTINGS = 'JARS_MAVEN_SETTINGS'.freeze
26
+ # skip the gem post install hook
27
+ SKIP = 'JARS_SKIP'.freeze
28
+ # just do not require any jars
29
+ NO_REQUIRE = 'JARS_NO_REQUIRE'.freeze
30
+ QUIET = 'JARS_QUIET'.freeze
31
+ VERBOSE = 'JARS_VERBOSE'.freeze
32
+ DEBUG = 'JARS_DEBUG'.freeze
33
+ VENDOR = 'JARS_VENDOR'.freeze
34
+ end
31
35
 
32
36
  class << self
33
37
 
@@ -59,7 +63,7 @@ module Jars
59
63
  end
60
64
 
61
65
  def quiet?
62
- to_boolean( QUIET )
66
+ @silent || to_boolean( QUIET )
63
67
  end
64
68
 
65
69
  def verbose?
@@ -74,6 +78,10 @@ module Jars
74
78
  to_boolean( VENDOR )
75
79
  end
76
80
 
81
+ def no_more_warnings
82
+ @silent = true
83
+ end
84
+
77
85
  def freeze_loading
78
86
  @frozen = true
79
87
  end
@@ -170,17 +178,16 @@ module Jars
170
178
  end
171
179
  end
172
180
 
173
- def detect_local_repository(settings); require 'rexml/document'
174
- doc = REXML::Document.new( File.read( settings ) )
175
- if local_repo = doc.root.elements['localRepository']
176
- if ( local_repo = local_repo.first )
177
- local_repo = local_repo.value
178
- # replace maven like system properties embedded into the string
179
- local_repo.gsub!( /\$\{[a-zA-Z.]+\}/ ) do |a|
180
- ENV_JAVA[ a[2..-2] ] || a
181
- end
182
- local_repo = nil if local_repo.empty?
183
- end
181
+ def detect_local_repository(settings)
182
+ doc = File.read( settings )
183
+ # TODO filter out xml comments
184
+ local_repo = doc.sub( /<\/localRepository>.*/m, '' ).sub( /.*<localRepository>/m, '' )
185
+ # replace maven like system properties embedded into the string
186
+ local_repo.gsub!( /\$\{[a-zA-Z.]+\}/ ) do |a|
187
+ ENV_JAVA[ a[2..-2] ] || a
188
+ end
189
+ if local_repo.empty? or not File.exists?( local_repo )
190
+ local_repo = nil
184
191
  end
185
192
  local_repo
186
193
  end
data/lib/jar_installer.rb CHANGED
@@ -170,8 +170,17 @@ module Jars
170
170
 
171
171
  def vendor_jars( write_require_file = true )
172
172
  return unless has_jars?
173
- # do not vendor only if set explicitly via ENV/system-properties
174
- do_install( Jars.to_prop( Jars::VENDOR ) != 'false', write_require_file )
173
+ case Jars.to_prop( Jars::VENDOR )
174
+ when 'true'
175
+ do_vendor = true
176
+ when 'false'
177
+ do_vendor = false
178
+ else
179
+ # if the spec_file does not exists this means it is a local gem
180
+ # coming via bundle :path or :git
181
+ do_vendor = File.exists?( @spec.spec_file )
182
+ end
183
+ do_install( do_vendor, write_require_file )
175
184
  end
176
185
 
177
186
  def install_jars( write_require_file = true )
@@ -206,7 +215,13 @@ module Jars
206
215
  end
207
216
 
208
217
  def setup_arguments( deps )
209
- args = [ 'dependency:list', "-DoutputFile=#{deps}", '-DoutputAbsoluteArtifactFilename=true', '-DincludeTypes=jar', '-DoutputScope=true', '-f', @specfile ]
218
+ args = [ 'dependency:list',
219
+ "-DoutputFile=#{deps}",
220
+ '-DoutputAbsoluteArtifactFilename=true',
221
+ '-DincludeTypes=jar',
222
+ '-DoutputScope=true',
223
+ '-f', File.dirname( __FILE__ ) + '/jars/jar_pom.rb',
224
+ "-Djars.specfile=#{@specfile}" ]
210
225
 
211
226
  if Jars.debug?
212
227
  args << '-X'
@@ -269,6 +284,7 @@ EOF
269
284
 
270
285
  maven = Maven::Ruby::Maven.new
271
286
  maven.verbose = Jars.verbose?
287
+ puts " jar dependencies for #{@spec.spec_name} . . ." unless Jars.quiet?
272
288
  maven.exec( *setup_arguments( deps ) )
273
289
 
274
290
  self.class.load_from_maven( deps )
@@ -0,0 +1,22 @@
1
+ # this file is maven DSL and used by maven via jar_installer.rb
2
+
3
+ specfile = java.lang.System.getProperty('jars.specfile')
4
+
5
+ # needed since the gemspec does not allow absolute files
6
+ basedir( File.dirname( specfile ) )
7
+
8
+ # get ALL depenedencies from the specfile
9
+ gemspec File.basename( specfile )
10
+
11
+ # we do not want those gem dependencies
12
+ gems = model.dependencies.select do |d|
13
+ d.group_id == 'rubygems'
14
+ end
15
+ gems.each do |d|
16
+ model.dependencies.remove( d )
17
+ end
18
+
19
+ # some output
20
+ model.dependencies.each do |d|
21
+ puts " " + d.group_id + ':' + d.artifact_id + (d.classifier ? ":" + d.classifier : "" ) + ":" + d.version
22
+ end
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.7
4
+ version: 0.1.8
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-11-28 00:00:00.000000000 Z
11
+ date: 2015-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -44,12 +44,12 @@ dependencies:
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 3.1.1.0.8
47
+ version: 3.1.1.0.9
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - ~>
51
51
  - !ruby/object:Gem::Version
52
- version: 3.1.1.0.8
52
+ version: 3.1.1.0.9
53
53
  prerelease: false
54
54
  type: :development
55
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.
@@ -65,6 +65,7 @@ files:
65
65
  - lib/jar_installer.rb
66
66
  - lib/jar-dependencies.rb
67
67
  - lib/rubygems_plugin.rb
68
+ - lib/jars/jar_pom.rb
68
69
  - bin/bundle-with-jars
69
70
  - Rakefile
70
71
  - Mavenfile