maven-tools 0.29.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,84 @@
1
+ module Maven
2
+ module Tools
3
+ module Coordinate
4
+
5
+ def to_coordinate(line)
6
+ if line =~ /^\s*(jar|pom)\s/
7
+
8
+ group_id, artifact_id, version, second_version = line.sub(/\s*[a-z]+\s+/, '').sub(/#.*/,'').gsub(/\s+/,'').gsub(/['"],/, ':').gsub(/['"]/, '').split(/:/)
9
+ mversion = second_version ? to_version(version, second_version) : to_version(version)
10
+ extension = line.strip.sub(/\s+.*/, '')
11
+ "#{group_id}:#{artifact_id}:#{extension}:#{mversion}"
12
+ end
13
+ end
14
+
15
+ def group_artifact(*args)
16
+ case args.size
17
+ when 1
18
+ name = args[0]
19
+ if name =~ /:/
20
+ [name.sub(/:[^:]+$/, ''), name.sub(/.*:/, '')]
21
+ else
22
+ ["rubygems", name]
23
+ end
24
+ else
25
+ [args[0], args[1]]
26
+ end
27
+ end
28
+
29
+ def gav(*args)
30
+ if args[0] =~ /:/
31
+ [args[0].sub(/:[^:]+$/, ''), args[0].sub(/.*:/, ''), maven_version(*args[1, 2])]
32
+ else
33
+ [args[0], args[1], maven_version(*args[2,3])]
34
+ end
35
+ end
36
+
37
+ def to_version(*args)
38
+ maven_version(*args) || "[0,)"
39
+ end
40
+
41
+ private
42
+
43
+ def maven_version(*args)
44
+ if args.size == 0 || (args.size == 1 && args[0].nil?)
45
+ nil
46
+ else
47
+ low, high = convert(args[0])
48
+ low, high = convert(args[1], low, high) if args[1] =~ /[=~><]/
49
+ if low == high
50
+ low
51
+ else
52
+ "#{low || '[0'},#{high || ')'}"
53
+ end
54
+ end
55
+ end
56
+
57
+ def convert(arg, low = nil, high = nil)
58
+ if arg =~ /~>/
59
+ val = arg.sub(/~>\s*/, '')
60
+ last = val.sub(/\.[0-9]*[a-z]+.*$/, '').sub(/\.[^.]+$/, '.99999')
61
+ ["[#{val}", "#{last}]"]
62
+ elsif arg =~ />=/
63
+ val = arg.sub(/>=\s*/, '')
64
+ ["[#{val}", (nil || high)]
65
+ elsif arg =~ /<=/
66
+ val = arg.sub(/<=\s*/, '')
67
+ [(nil || low), "#{val}]"]
68
+ # treat '!' the same way as '>' since maven can not describe such range
69
+ elsif arg =~ /[!>]/
70
+ val = arg.sub(/[!>]\s*/, '')
71
+ ["(#{val}", (nil || high)]
72
+ elsif arg =~ /</
73
+ val = arg.sub(/<\s*/, '')
74
+ [(nil || low), "#{val})"]
75
+ elsif arg =~ /\=/
76
+ val = arg.sub(/=\s*/, '')
77
+ ["[" + val, val + '.0.0.0.0.1)']
78
+ else
79
+ [arg, arg]
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,81 @@
1
+ puts "=-------------------"
2
+ module Maven
3
+ module Tools
4
+ module Coordinate
5
+
6
+ def to_coordinate(line)
7
+ if line =~ /^\s*(jar|pom)\s/
8
+
9
+ group_id, artifact_id, version, second_version = line.sub(/\s*[a-z]+\s+/, '').sub(/#.*/,'').gsub(/\s+/,'').gsub(/['"],/, ':').gsub(/['"]/, '').split(/:/)
10
+ mversion = second_version ? to_version(version, second_version) : to_version(version)
11
+ extension = line.strip.sub(/\s+.*/, '')
12
+ "#{group_id}:#{artifact_id}:#{extension}:#{mversion}"
13
+ end
14
+ end
15
+
16
+ def group_artifact(*args)
17
+ case args.size
18
+ when 1
19
+ name = args[0]
20
+ if name =~ /:/
21
+ [name.sub(/:[^:]+$/, ''), name.sub(/.*:/, '')]
22
+ else
23
+ ["rubygems", name]
24
+ end
25
+ else
26
+ [args[0], args[1]]
27
+ end
28
+ end
29
+
30
+ def gav(*args)
31
+ if args[0] =~ /:/
32
+ [args[0].sub(/:[^:]+$/, ''), args[0].sub(/.*:/, ''), to_version(*args[1, 2])]
33
+ else
34
+ [args[0], args[1], to_version(*args[2,3])]
35
+ end
36
+ end
37
+
38
+ def to_version(*args)
39
+ if args.size == 0 || (args.size == 1 && args[0].nil?)
40
+ "[0,)"
41
+ else
42
+ low, high = convert(args[0])
43
+ low, high = convert(args[1], low, high) if args[1] =~ /[=~><]/
44
+ if low == high
45
+ low
46
+ else
47
+ "#{low || '[0'},#{high || ')'}"
48
+ end
49
+ end
50
+ end
51
+
52
+ private
53
+
54
+ def convert(arg, low = nil, high = nil)
55
+ if arg =~ /~>/
56
+ val = arg.sub(/~>\s*/, '')
57
+ last = val.sub(/\.[^.]+$/, '.99999')
58
+ ["[#{val}", "#{last}]"]
59
+ elsif arg =~ />=/
60
+ val = arg.sub(/>=\s*/, '')
61
+ ["[#{val}", (nil || high)]
62
+ elsif arg =~ /<=/
63
+ val = arg.sub(/<=\s*/, '')
64
+ [(nil || low), "#{val}]"]
65
+ # treat '!' the same way as '>' since maven can not describe such range
66
+ elsif arg =~ /[!>]/
67
+ val = arg.sub(/[!>]\s*/, '')
68
+ ["(#{val}", (nil || high)]
69
+ elsif arg =~ /</
70
+ val = arg.sub(/<\s*/, '')
71
+ [(nil || low), "#{val})"]
72
+ elsif arg =~ /\=/
73
+ val = arg.sub(/=\s*/, '')
74
+ ["[" + val, val + '.0.0.0.0.1)']
75
+ else
76
+ [arg, arg]
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,9 @@
1
+ require File.join(File.dirname(__FILE__), 'gem_project.rb')
2
+
3
+ proj = Maven::Tools::GemProject.new("in_phase_execution")
4
+
5
+ proj.load(ARGV[0])
6
+
7
+ block = proj.executions_in_phase[ARGV[1]]
8
+ block.call if block
9
+
@@ -0,0 +1,503 @@
1
+ # TODO make nice require after ruby-maven uses the same ruby files
2
+ require File.join(File.dirname(File.dirname(__FILE__)), 'model', 'model.rb')
3
+ require File.join(File.dirname(__FILE__), 'gemfile_lock.rb')
4
+ require File.join(File.dirname(__FILE__), 'versions.rb')
5
+ require File.join(File.dirname(__FILE__), 'jarfile.rb')
6
+
7
+ module Maven
8
+ module Tools
9
+
10
+ class ArtifactPassthrough
11
+
12
+ def initialize(&block)
13
+ @block = block
14
+ end
15
+
16
+ def add_artifact(a)
17
+ @block.call(a)
18
+ end
19
+
20
+ def add_repository(name, url)
21
+ end
22
+ end
23
+
24
+ class GemProject < Maven::Model::Project
25
+ tags :dummy
26
+
27
+ def initialize(artifact_id = dir_name, version = "0.0.0", &block)
28
+ super("rubygems", artifact_id, version, &block)
29
+ packaging "gem"
30
+ end
31
+
32
+ def add_param(config, name, list, default = [])
33
+ if list.is_a? Array
34
+ config[name] = list.join(",").to_s unless (list || []) == default
35
+ else
36
+ # list == nil => (list || []) == default is true
37
+ config[name] = list.to_s unless (list || []) == default
38
+ end
39
+ end
40
+ private :add_param
41
+
42
+ def load_gemspec(specfile)
43
+ require 'rubygems'
44
+ if specfile.is_a? ::Gem::Specification
45
+ spec = specfile
46
+ else
47
+ spec = ::Gem::Specification.load(specfile)
48
+ @gemspec = specfile
49
+ end
50
+ raise "file not found '#{specfile}'" unless spec
51
+ @current_file = specfile
52
+ artifact_id spec.name
53
+ version spec.version
54
+ name spec.summary || "#{self.artifact_id} - gem"
55
+ description spec.description if spec.description
56
+ url spec.homepage if spec.homepage
57
+ (spec.email || []).zip(spec.authors || []).map do |email, author|
58
+ self.developers.new(author, email)
59
+ end
60
+
61
+ # TODO work with collection of licenses - there can be more than one !!!
62
+ (spec.licenses + spec.files.select {|file| file.to_s =~ /license|gpl/i }).each do |license|
63
+ # TODO make this better, i.e. detect the right license name from the file itself
64
+ self.licenses.new(license)
65
+ end
66
+
67
+ config = {}
68
+ if @gemspec
69
+ relative = File.expand_path(@gemspec).sub(/#{File.expand_path('.')}/, '').sub(/^\//, '')
70
+ add_param(config, "gemspec", relative)
71
+ end
72
+ add_param(config, "autorequire", spec.autorequire)
73
+ add_param(config, "defaultExecutable", spec.default_executable)
74
+ add_param(config, "testFiles", spec.test_files)
75
+ #has_rdoc always gives true => makes not sense to keep it then
76
+ #add_param(config, "hasRdoc", spec.has_rdoc)
77
+ add_param(config, "extraRdocFiles", spec.extra_rdoc_files)
78
+ add_param(config, "rdocOptions", spec.rdoc_options)
79
+ add_param(config, "requirePaths", spec.require_paths, ["lib"])
80
+ add_param(config, "rubyforgeProject", spec.rubyforge_project)
81
+ add_param(config, "requiredRubygemsVersion",
82
+ spec.required_rubygems_version && spec.required_rubygems_version != ">= 0" ? "<![CDATA[#{spec.required_rubygems_version}]]>" : nil)
83
+ add_param(config, "bindir", spec.bindir, "bin")
84
+ add_param(config, "requiredRubyVersion",
85
+ spec.required_ruby_version && spec.required_ruby_version != ">= 0" ? "<![CDATA[#{spec.required_ruby_version}]]>" : nil)
86
+ add_param(config, "postInstallMessage",
87
+ spec.post_install_message ? "<![CDATA[#{spec.post_install_message}]]>" : nil)
88
+ add_param(config, "executables", spec.executables)
89
+ add_param(config, "extensions", spec.extensions)
90
+ add_param(config, "platform", spec.platform, 'ruby')
91
+
92
+ # # TODO maybe calculate extra files
93
+ # files = spec.files.dup
94
+ # (Dir['lib/**/*'] + Dir['spec/**/*'] + Dir['features/**/*'] + Dir['test/**/*'] + spec.licenses + spec.extra_rdoc_files).each do |f|
95
+ # files.delete(f)
96
+ # if f =~ /^.\//
97
+ # files.delete(f.sub(/^.\//, ''))
98
+ # else
99
+ # files.delete("./#{f}")
100
+ # end
101
+ # end
102
+ #add_param(config, "extraFiles", files)
103
+ add_param(config, "files", spec.files)
104
+
105
+ plugin('gem').with(config) if config.size > 0
106
+
107
+ spec.dependencies.each do |dep|
108
+ scope =
109
+ case dep.type
110
+ when :runtime
111
+ "compile"
112
+ when :development
113
+ "test"
114
+ else
115
+ warn "unknown scope: #{dep.type}"
116
+ "compile"
117
+ end
118
+
119
+ versions = dep.requirement.requirements.collect do |req|
120
+ # use this construct to get the same result in 1.8.x and 1.9.x
121
+ req.collect{ |i| i.to_s }.join
122
+ end
123
+ gem(dep.name, versions).scope = scope
124
+ end
125
+
126
+ spec.requirements.each do |req|
127
+ begin
128
+ eval req
129
+ rescue => e
130
+ # TODO requirements is a list !!!
131
+ add_param(config, "requirements", req)
132
+ rescue SyntaxError => e
133
+ # TODO requirements is a list !!!
134
+ add_param(config, "requirements", req)
135
+ rescue NameError => e
136
+ # TODO requirements is a list !!!
137
+ add_param(config, "requirements", req)
138
+ end
139
+ end
140
+ end
141
+
142
+ def load_mavenfile(file)
143
+ file = file.path if file.is_a?(File)
144
+ if File.exists? file
145
+ @current_file = file
146
+ content = File.read(file)
147
+ eval content
148
+ else
149
+ self
150
+ end
151
+ end
152
+
153
+ def load_gemfile(file)
154
+ file = file.path if file.is_a?(File)
155
+ if File.exists? file
156
+ @current_file = file
157
+ content = File.read(file)
158
+ #loaded_files << file
159
+ if @lock.nil?
160
+ @lock = GemfileLock.new(file + ".lock")
161
+ if @lock.size == 0
162
+ @lock = nil
163
+ else
164
+ @lock.hull.each do |dep|
165
+ dependency_management.gem dep
166
+ end
167
+ end
168
+ end
169
+ eval content
170
+
171
+ # we have a Gemfile so we add the bundler plugin
172
+ plugin(:bundler)
173
+ else
174
+ self
175
+ end
176
+ end
177
+
178
+ def load_jarfile(file)
179
+ jars = Jarfile.new(file)
180
+ if jars.exists?
181
+ container = ArtifactPassthrough.new do |a|
182
+ artifactId, groupId, extension, version = a.split(/:/)
183
+ send(extension.to_sym, "#{artifactId}:#{groupId}", version)
184
+ end
185
+ if !jars.exists_lock? || jars.mtime > jars.mtime_lock
186
+ jars.populate_unlocked container
187
+ end
188
+ jars.populate_locked container
189
+ end
190
+ end
191
+
192
+ def dir_name
193
+ File.basename(File.expand_path("."))
194
+ end
195
+ private :dir_name
196
+
197
+ def add_defaults(args = {})
198
+ versions = VERSIONS
199
+ versions = versions.merge(args) if args
200
+
201
+ name "#{dir_name} - gem" unless name
202
+
203
+ packaging "gem" unless packaging
204
+
205
+ repository("rubygems-releases").url = "http://rubygems-proxy.torquebox.org/releases" unless repository("rubygems-releases").url
206
+
207
+ has_prereleases = dependencies.detect { |d| d.type.to_sym == :gem && d.version =~ /[a-zA-Z]/ }
208
+ if has_prereleases && repository("rubygems-prereleases").url.nil?
209
+ repository("rubygems-prereleases") do |r|
210
+ r.url = "http://rubygems-proxy.torquebox.org/prereleases"
211
+ # r.releases(:enabled => false)
212
+ r.snapshots(:enabled => true)
213
+ end
214
+ end
215
+
216
+ # TODO go through all plugins to find out any SNAPSHOT version !!
217
+ if versions[:jruby_plugins] =~ /-SNAPSHOT$/ || properties['jruby.plugins.version'] =~ /-SNAPSHOT$/
218
+ plugin_repository("sonatype-snapshots") do |nexus|
219
+ nexus.url = "http://oss.sonatype.org/content/repositories/snapshots"
220
+ nexus.releases(:enabled => false)
221
+ nexus.snapshots(:enabled => true)
222
+ end
223
+ end
224
+
225
+ if packaging =~ /gem/ || plugin?(:gem)
226
+ gem = plugin(:gem)
227
+ gem.version = "${jruby.plugins.version}" unless gem.version
228
+ if packaging =~ /gem/
229
+ gem.extensions = true
230
+ if @gemspec && !(self.gem?('jruby-openssl') || self.gem?('jruby-openssl-maven'))
231
+ gem.gem('jruby-openssl-maven')
232
+ end
233
+ end
234
+ if File.exists?('lib') && File.exists?(File.join('src', 'main', 'java'))
235
+ plugin(:jar) do |j|
236
+ j.version = versions[:jar_plugin] unless j.version
237
+ j.in_phase('prepare-package').execute_goal(:jar).with :outputDirectory => '${project.basedir}/lib', :finalName => '${project.artifactId}'
238
+ end
239
+ end
240
+ end
241
+
242
+ if @bundler_deps && @bundler_deps.size > 0
243
+ plugin(:bundler)
244
+ bdeps = []
245
+ # first get the locked gems
246
+ @bundler_deps.each do |args, dep|
247
+ if @lock
248
+ # add its dependencies as well to have the version
249
+ # determine by the dependencyManagement
250
+ @lock.dependency_hull(dep.artifact_id).map.each do |d|
251
+ bdeps << d unless has_gem? d[0]
252
+ end
253
+ end
254
+ end
255
+ # any unlocked gems now
256
+ @bundler_deps.each do |args, dep|
257
+ bdeps << args unless has_gem? args[0]
258
+ end
259
+
260
+ # now add the deps to bundler plugin
261
+ # avoid to setup bundler if it has no deps
262
+ if bdeps.size > 0
263
+ plugin(:bundler) do |bundler|
264
+ # install will be triggered on initialize phase
265
+ bundler.execution.goals << "install"
266
+
267
+ bdeps.each do |d|
268
+ bundler.gem(d)
269
+ end
270
+ end
271
+ end
272
+ end
273
+
274
+ if plugin?(:bundler)
275
+ bundler = plugin(:bundler)
276
+ bundler.version = "${jruby.plugins.version}" unless bundler.version
277
+ unless gem?(:bundler)
278
+ gem("bundler")
279
+ end
280
+ end
281
+
282
+ if gem?('bundler') && !gem('bundler').version?
283
+ gem('bundler').version = nil
284
+ dependency_management.gem 'bundler', versions[:bundler_version]
285
+ end
286
+
287
+ if versions[:jruby_plugins]
288
+ #add_test_plugin(nil, "test")
289
+ add_test_plugin("rspec", "spec")
290
+ add_test_plugin("cucumber", "features")
291
+ add_test_plugin("minitest", "test")
292
+ add_test_plugin("minitest", "spec", 'spec')
293
+ end
294
+
295
+ self.properties = {
296
+ "project.build.sourceEncoding" => "UTF-8",
297
+ "gem.home" => "${project.build.directory}/rubygems",
298
+ "gem.path" => "${project.build.directory}/rubygems",
299
+ "jruby.plugins.version" => versions[:jruby_plugins]
300
+ }.merge(self.properties)
301
+
302
+ has_plugin_gems = build.plugins.detect do |k, pl|
303
+ pl.dependencies.detect { |d| d.type.to_sym == :gem } if pl.dependencies
304
+ end
305
+
306
+ if has_plugin_gems
307
+ plugin_repository("rubygems-releases").url = "http://rubygems-proxy.torquebox.org/releases" unless plugin_repository("rubygems-releases").url
308
+
309
+ # unless plugin_repository("rubygems-prereleases").url
310
+ # plugin_repository("rubygems-prereleases") do |r|
311
+ # r.url = "http://rubygems-proxy.torquebox.org/prereleases"
312
+ # r.releases(:enabled => false)
313
+ # r.snapshots(:enabled => true)
314
+ # end
315
+ # end
316
+ end
317
+ # TODO
318
+ configs = {
319
+ :gem => [:initialize],
320
+ :rails3 => [:initialize, :pom],
321
+ :bundler => [:install]
322
+ }.collect do |name, goals|
323
+ if plugin?(name)
324
+ {
325
+ :pluginExecutionFilter => {
326
+ :groupId => 'de.saumya.mojo',
327
+ :artifactId => "#{name}-maven-plugin",
328
+ :versionRange => '[0,)',
329
+ :goals => goals
330
+ },
331
+ :action => { :ignore => nil }
332
+ }
333
+ end
334
+ end
335
+ configs.delete_if { |c| c.nil? }
336
+ if configs.size > 0
337
+ build.plugin_management do |pm|
338
+ options = {
339
+ :lifecycleMappingMetadata => {
340
+ :pluginExecutions => Maven::Model::NamedArray.new(:pluginExecution) do |e|
341
+ # sort them for testing
342
+ configs.sort {|m,n| -1 *(n.first[1][:artifactId].to_s <=> m.first[1][:artifactId].to_s) }.each { |c| e << c }
343
+ end
344
+ }
345
+ }
346
+ pm.plugins.get('org.eclipse.m2e:lifecycle-mapping', '1.0.0').configuration(options)
347
+ end
348
+ end
349
+
350
+ if packaging =~ /gem/ || plugin?(:gem)
351
+ profile('executable') do |exe|
352
+ exe.jar('de.saumya.mojo:gem-assembly-descriptors', '${jruby.plugins.version}').scope :runtime
353
+ exe.plugin(:assembly, '2.2-beta-5') do |a|
354
+ options = {
355
+ :descriptorRefs => ['jar-with-dependencies-and-gems'],
356
+ :archive => {:manifest => { :mainClass => 'de.saumya.mojo.assembly.Main' } }
357
+ }
358
+ a.configuration(options)
359
+ a.in_phase(:package).execute_goal(:assembly)
360
+ a.jar 'de.saumya.mojo:gem-assembly-descriptors', '${jruby.plugins.version}'
361
+ end
362
+ end
363
+ end
364
+ end
365
+
366
+ def has_gem?(gem)
367
+ self.gem?(gem)
368
+ end
369
+
370
+ def add_test_plugin(name, test_dir, goal = 'test')
371
+ unless plugin?(name)
372
+ has_gem = name.nil? ? true : gem?(name)
373
+ if has_gem && File.exists?(test_dir)
374
+ plugin(name || 'runit', "${jruby.plugins.version}").execution.goals << goal
375
+ end
376
+ else
377
+ pl = plugin(name || 'runit')
378
+ pl.version = "${jruby.plugins.version}" unless pl.version
379
+ end
380
+ end
381
+ private :add_test_plugin
382
+
383
+ def stack
384
+ @stack ||= [[:default]]
385
+ end
386
+ private :stack
387
+
388
+ def group(*args, &block)
389
+ stack << args
390
+ block.call if block
391
+ stack.pop
392
+ end
393
+
394
+ def gemspec(name = nil)
395
+ if name
396
+ load_gemspec(File.join(File.dirname(@current_file), name))
397
+ else
398
+ Dir[File.join(File.dirname(@current_file), "*.gemspec")].each do |file|
399
+ load_gemspec(file)
400
+ end
401
+ end
402
+ end
403
+
404
+ def source(*args)
405
+ warn "ignore source #{args}" if !(args[0].to_s =~ /^https?:\/\/rubygems.org/) && args[0] != :rubygems
406
+ end
407
+
408
+ def path(*args)
409
+ end
410
+
411
+ def git(*args)
412
+ end
413
+
414
+ def is_jruby_platform(*args)
415
+ args.detect { |a| :jruby == a.to_sym }
416
+ end
417
+ private :is_jruby_platform
418
+
419
+ def platforms(*args, &block)
420
+ if is_jruby_platform(*args)
421
+ block.call
422
+ end
423
+ end
424
+
425
+ def gem(*args, &block)
426
+ dep = nil
427
+ if args.last.is_a?(Hash)
428
+ options = args.delete(args.last)
429
+ unless options.key?(:git) || options.key?(:path)
430
+ if options[:platforms].nil? || is_jruby_platform(*(options[:platforms] || []))
431
+ group = options[:group] || options[:groups]
432
+ if group
433
+ [group].flatten.each do |g|
434
+ if dep
435
+ profile(g).dependencies << dep
436
+ else
437
+ dep = profile(g).gem(args, &block)
438
+ end
439
+ end
440
+ else
441
+ self.gem(args, &block)
442
+ end
443
+ end
444
+ end
445
+ else
446
+ stack.last.each do |c|
447
+ if c == :default
448
+ if @lock.nil? || args[0]== 'bundler'
449
+ dep = add_gem(args, &block)
450
+ else
451
+ dep = add_gem(args[0], &block)
452
+
453
+ # add its dependencies as well to have the version
454
+ # determine by the dependencyManagement
455
+ @lock.dependency_hull(args[0]).map.each do |d|
456
+ add_gem d[0], nil
457
+ end
458
+ end
459
+ else
460
+ if @lock.nil?
461
+ if dep
462
+ profile(c).dependencies << dep
463
+ else
464
+ dep = profile(c).gem(args, &block)
465
+ end
466
+ else
467
+ if dep
468
+ profile(c).dependencies << dep
469
+ else
470
+ dep = profile(c).gem(args[0], nil, &block)
471
+ end
472
+ # add its dependencies as well to have the version
473
+ # determine by the dependencyManagement
474
+ @lock.dependency_hull(args[0]).map.each do |d|
475
+ profile(c).gem d[0], nil unless gem? d[0]
476
+ end
477
+ end
478
+ end
479
+ end
480
+ end
481
+ if dep
482
+ # first collect the missing deps it any
483
+ @bundler_deps ||= []
484
+ # use a dep with version so just create it from the args
485
+ @bundler_deps << [args, dep]
486
+ end
487
+ dep
488
+ end
489
+ end
490
+ end
491
+ end
492
+
493
+ if $0 == __FILE__
494
+ proj = Maven::Tools::GemProject.new("test_gem")
495
+ if ARGV[0] =~ /\.gemspec$/
496
+ proj.load_gemspec(ARGV[0])
497
+ else
498
+ proj.load(ARGV[0] || 'Gemfile')
499
+ end
500
+ proj.load(ARGV[1] || 'Mavenfile')
501
+ proj.add_defaults
502
+ puts proj.to_xml
503
+ end