maven-tools 0.34.3 → 0.34.4

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.
@@ -185,18 +185,25 @@ module Maven
185
185
 
186
186
  def setup_jruby( jruby, jruby_scope = :provided )
187
187
  jruby ||= VERSIONS[ :jruby_version ]
188
+
189
+ if jruby.match( /-SNAPSHOT/ ) != nil
190
+ snapshot_repository( 'http://ci.jruby.org/snapshots/maven',
191
+ :id => 'jruby-snapshots' )
192
+ end
188
193
  scope( jruby_scope ) do
189
- if ( jruby < '1.7' )
194
+ if jruby < '1.7'
190
195
  warn 'jruby version below 1.7 uses jruby-complete'
191
196
  jar 'org.jruby:jruby-core', jruby
192
- elsif ( jruby < '1.7.5' )
197
+ elsif jruby.sub( /1\.7\./, '').to_i < 5
193
198
  jar 'org.jruby:jruby-core', jruby
194
- else
195
- jar 'org.jruby:jruby-noasm', jruby
199
+ elsif jruby =~ /-no_asm$/
200
+ pom 'org.jruby:jruby-noasm', jruby.sub( /-no_asm$/, '' )
201
+ else
202
+ pom 'org.jruby:jruby', jruby
196
203
  end
197
204
  end
198
205
  end
199
- private :setup_jruby
206
+ #private :setup_jruby
200
207
 
201
208
  def jarfile( file = 'Jarfile', options = {} )
202
209
  if file.is_a? Hash
@@ -18,8 +18,8 @@
18
18
  # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
19
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  #
21
- require File.join(File.dirname(__FILE__), 'coordinate.rb')
22
- require File.join(File.dirname(__FILE__), 'artifact.rb')
21
+ require ::File.join(::File.dirname(__FILE__), 'coordinate.rb')
22
+ require ::File.join(::File.dirname(__FILE__), 'artifact.rb')
23
23
  require 'fileutils'
24
24
  module Maven
25
25
  module Tools
@@ -33,25 +33,25 @@ module Maven
33
33
  end
34
34
 
35
35
  def mtime
36
- File.mtime(@file)
36
+ ::File.mtime(@file)
37
37
  end
38
38
 
39
39
  def exists?
40
- File.exists?(@file)
40
+ ::File.exists?(@file)
41
41
  end
42
42
 
43
43
  def mtime_lock
44
- File.mtime(@lockfile)
44
+ ::File.mtime(@lockfile)
45
45
  end
46
46
 
47
47
  def exists_lock?
48
- File.exists?(@lockfile)
48
+ ::File.exists?(@lockfile)
49
49
  end
50
50
 
51
51
  def load_lockfile
52
52
  _locked = []
53
53
  if exists_lock?
54
- File.read(@lockfile).each_line do |line|
54
+ ::File.read(@lockfile).each_line do |line|
55
55
  line.strip!
56
56
  if line.size > 0 && !(line =~ /^\s*#/)
57
57
  _locked << line
@@ -79,8 +79,8 @@ module Maven
79
79
  end
80
80
 
81
81
  def eval_file( file )
82
- if File.exists?( file )
83
- eval( File.read( file ) )
82
+ if ::File.exists?( file )
83
+ eval( ::File.read( file ), nil, file )
84
84
  self
85
85
  end
86
86
  end
@@ -98,17 +98,21 @@ module Maven
98
98
  end
99
99
 
100
100
  def local( path )
101
- artifacts << Artifact.new_local( File.expand_path( path ), :jar )
101
+ artifacts << Artifact.new_local( ::File.expand_path( path ), :jar )
102
102
  end
103
103
 
104
104
  def jar( *args )
105
- args << '[0,)' if args.size == 1
106
- artifacts << Artifact.from( :jar, *args )
105
+ a = Artifact.from( :jar, *args )
106
+ a[ :scope ] = @scope if @scope
107
+ artifacts << a
108
+ a
107
109
  end
108
110
 
109
111
  def pom( *args )
110
- args << '[0,)' if args.size == 1
111
- artifacts << Artifact.from( :pom, *args )
112
+ a = Artifact.from( :pom, *args )
113
+ a[ :scope ] = @scope if @scope
114
+ artifacts << a
115
+ a
112
116
  end
113
117
 
114
118
  def snapshot_repository( name, url = nil )
@@ -126,14 +130,30 @@ module Maven
126
130
  end
127
131
  alias :source :repository
128
132
 
129
- def jruby( version = nil )
130
- @jruby = version if version
133
+ # TODO add flag to use repacked asm
134
+ def jruby( version = nil, no_asm = false )
135
+ if version
136
+ @jruby = version
137
+ @jruby += '-no_asm' if no_asm
138
+ end
139
+ @scope = :provided
140
+ yield if block_given?
141
+ @jruby
142
+ ensure
143
+ @scope = nil
144
+ end
145
+
146
+ def scope( scope )
147
+ @scope = scope
148
+ yield if block_given?
149
+ ensure
150
+ @scope = nil
131
151
  end
132
152
 
133
153
  end
134
154
 
135
155
  def populate_unlocked( container = nil, &block )
136
- if File.exists?(@file)
156
+ if ::File.exists?(@file)
137
157
  dsl = DSL.new
138
158
  dsl.eval_file( @file )
139
159
 
@@ -174,7 +194,7 @@ module Maven
174
194
  if dependency_coordinates.empty?
175
195
  FileUtils.rm_f(@lockfile) if exists_lock?
176
196
  else
177
- File.open(@lockfile, 'w') do |f|
197
+ ::File.open(@lockfile, 'w') do |f|
178
198
  dependency_coordinates.each do |d|
179
199
  f.puts d.to_s unless d.to_s =~ /^ruby.bundler:/
180
200
  end
@@ -20,6 +20,6 @@
20
20
  #
21
21
  module Maven
22
22
  module Tools
23
- VERSION = '0.34.3'.freeze
23
+ VERSION = '0.34.4'.freeze
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maven-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.3
4
+ version: 0.34.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-09 00:00:00.000000000 Z
12
+ date: 2014-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: virtus