jar-dependencies 0.1.11 → 0.1.12

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: a34bb3f36e6ad44d263107a9d6fe8d3e513b934f
4
- data.tar.gz: 620b12873948e1347d0020596dcb7cc080304952
3
+ metadata.gz: f8046f88d8efe9b20de38785a7f2ba5b9cafc963
4
+ data.tar.gz: dcb3af6f3d1763359e5a00386582a37ebd1963c1
5
5
  SHA512:
6
- metadata.gz: d2f5934de747736b5f733cfac0aeb932be5896ff8e1ff1536290894f71bc50733b41c4bdd2533ed596b5acff65c0cd511b719ff4f6f6efb93c7c00051eaac813
7
- data.tar.gz: d76e95558788a112844391576b838af227d2f2871f0f988b5817a645af450a39ea276861beb5236a26410ac3587479e18f06789736d02c71f8a7a16ca2a9901a
6
+ metadata.gz: f2bd6d2d4eb6139407e04d67956643b34d60e9110baa6a769d16d2cfbc7a5e7ad586b0b84fd631cafcf7becd643bff5ee8611e046ee41faf642af732507dfba2
7
+ data.tar.gz: 8f52b67493e13f75cfbe93507fcfa3199631883ef05b9971de0b87f9294f0b84126725e4e5aadb709843c013109be78ebf33aa7fe9f22393693a7aa9e305da43
data/Mavenfile CHANGED
@@ -10,8 +10,7 @@ jruby_plugin( :minitest, :minispecDirectory => "specs/*_spec.rb" ) do
10
10
  gem 'ruby-maven', '3.1.1.0.8'
11
11
  end
12
12
 
13
- # (jruby-1.6.8 mode 1.8 produces a lot of yaml errors parsing gemspecs)
14
- properties( 'jruby.versions' => ['1.6.8', '1.7.12', '${jruby.version}', '9.0.0.0.pre1'
13
+ properties( 'jruby.versions' => ['1.7.12', '${jruby.version}', '9.0.0.0.pre1'
15
14
  ].join(','),
16
15
  'jruby.modes' => ['1.9', '2.0', '2.1'].join(','),
17
16
  # just lock the version
@@ -48,18 +48,19 @@ module Jars
48
48
 
49
49
  if defined? JRUBY_VERSION
50
50
  def to_prop( key )
51
- java.lang.System.getProperty( key.downcase.gsub( /_/, '.' ) ) ||
52
- ENV[ key.upcase.gsub( /[.]/, '_' ) ]
51
+ key = key.gsub( '_', '.' )
52
+ ENV_JAVA[ ( key.downcase!; key ) ] ||
53
+ ENV[ ( key.gsub!( '.', '_' ); key.upcase!; key ) ]
53
54
  end
54
55
  else
55
56
  def to_prop( key )
56
- ENV[ key.upcase.gsub( /[.]/, '_' ) ]
57
+ ENV[ key.gsub( '.', '_' ).upcase ]
57
58
  end
58
59
  end
59
60
 
60
61
  def to_boolean( key )
61
62
  prop = to_prop( key )
62
- prop == '' or prop == 'true'
63
+ ! prop.nil? && ( prop.empty? || prop.eql?('true') )
63
64
  end
64
65
 
65
66
  def skip?
@@ -67,11 +68,11 @@ module Jars
67
68
  end
68
69
 
69
70
  def no_require?
70
- @frozen || to_boolean( NO_REQUIRE )
71
+ ( @frozen ||= false ) || to_boolean( NO_REQUIRE )
71
72
  end
72
73
 
73
74
  def quiet?
74
- @silent || to_boolean( QUIET )
75
+ ( @silent ||= false ) || to_boolean( QUIET )
75
76
  end
76
77
 
77
78
  def verbose?
@@ -112,9 +113,11 @@ module Jars
112
113
  end
113
114
 
114
115
  def maven_user_settings
115
- if @_jars_maven_user_settings_.nil?
116
+ unless instance_variable_defined?(:@_jars_maven_user_settings_)
117
+ @_jars_maven_user_settings_ = nil
118
+ end
119
+ if ( @_jars_maven_user_settings_ ||= nil ).nil?
116
120
  if settings = absolute( to_prop( MAVEN_SETTINGS ) )
117
- settings = File.expand_path(settings)
118
121
  unless File.exists?(settings)
119
122
  warn "configured ENV['#{MAVEN_SETTINGS}'] = '#{settings}' not found" unless quiet?
120
123
  settings = false
@@ -130,6 +133,9 @@ module Jars
130
133
  alias maven_settings maven_user_settings
131
134
 
132
135
  def maven_global_settings
136
+ unless instance_variable_defined?(:@_jars_maven_global_settings_)
137
+ @_jars_maven_global_settings_ = nil
138
+ end
133
139
  if @_jars_maven_global_settings_.nil?
134
140
  if mvn_home = ENV[ 'M2_HOME' ] || ENV[ 'MAVEN_HOME' ]
135
141
  settings = File.join( mvn_home, 'conf/settings.xml' )
@@ -143,7 +149,7 @@ module Jars
143
149
  end
144
150
 
145
151
  def home
146
- if @_jars_home_.nil?
152
+ if ( @_jars_home_ ||= nil ).nil?
147
153
  unless @_jars_home_ = absolute( to_prop( HOME ) )
148
154
  begin
149
155
  if user_settings = maven_user_settings
@@ -169,7 +175,7 @@ module Jars
169
175
  if jars_lock = classpath.jars_lock
170
176
  @@jars_lock = jars_lock
171
177
  classpath.require( scope )
172
- self.no_more_warnings
178
+ no_more_warnings
173
179
  end
174
180
  end
175
181
 
@@ -229,7 +235,7 @@ module Jars
229
235
  ENV_JAVA[ a[2..-2] ] || a
230
236
  end
231
237
  if local_repo.empty? or not File.exists?( local_repo )
232
- local_repo = nil
238
+ local_repo = nil
233
239
  end
234
240
  local_repo
235
241
  end
@@ -1,6 +1,6 @@
1
1
  require 'jar_dependencies'
2
2
  require 'jars/maven_exec'
3
- require 'uri'
3
+
4
4
  module Jars
5
5
  class Installer
6
6
 
@@ -183,5 +183,5 @@ module Jars
183
183
  end
184
184
  end
185
185
  # to stay backward compatible
186
- JarInstaller = Installer
186
+ JarInstaller = Installer unless defined? JarInstaller
187
187
  end
@@ -1,5 +1,5 @@
1
1
  require 'jar_dependencies'
2
- require 'uri'
2
+
3
3
  module Jars
4
4
  class MavenExec
5
5
 
@@ -78,9 +78,9 @@ module Jars
78
78
  end
79
79
 
80
80
  def setup_arguments( pom, *goals )
81
- args = [ *goals,
82
- '-DoutputAbsoluteArtifactFilename=true',
83
- '-DincludeTypes=jar',
81
+ args = [ *goals,
82
+ '-DoutputAbsoluteArtifactFilename=true',
83
+ '-DincludeTypes=jar',
84
84
  '-DoutputScope=true',
85
85
  '-DuseRepositoryLayout=true',
86
86
  "-DoutputDirectory=#{Jars.home}",
@@ -93,13 +93,20 @@ module Jars
93
93
  args << '--quiet'
94
94
  end
95
95
 
96
- if Jars.maven_user_settings.nil? && (proxy = Gem.configuration[ :proxy ]).is_a?( String )
97
- uri = URI.parse( proxy )
96
+ # TODO what todo with https proxy ?
97
+ # FIX this proxy settings seems not to work
98
+ if (proxy = Gem.configuration[ :http_proxy ]).is_a?( String )
99
+ require 'uri'; uri = URI.parse( proxy )
98
100
  args << "-DproxySet=true"
99
101
  args << "-DproxyHost=#{uri.host}"
100
102
  args << "-DproxyPort=#{uri.port}"
101
103
  end
102
104
 
105
+ if Jars.maven_settings
106
+ args << '-s'
107
+ args << Jars.maven_settings
108
+ end
109
+
103
110
  args << "-Dmaven.repo.local=#{java.io.File.new( Jars.local_maven_repo ).absolute_path}"
104
111
 
105
112
  args
data/lib/jars/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jars
2
- VERSION = '0.1.11'.freeze
2
+ VERSION = '0.1.12'.freeze
3
3
  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.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian meier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-13 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement