maven-tools 0.29.3 → 0.30.0
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.
- data/lib/maven/tools/minimal_project.rb +63 -0
- data/lib/maven/tools/version.rb +1 -1
- metadata +3 -2
@@ -0,0 +1,63 @@
|
|
1
|
+
# TODO make nice require after ruby-maven uses the same ruby files
|
2
|
+
require 'maven/model/model'
|
3
|
+
require 'maven/tools/versions'
|
4
|
+
|
5
|
+
module Maven
|
6
|
+
module Tools
|
7
|
+
|
8
|
+
class MinimalProject < Maven::Model::Project
|
9
|
+
tags :dummy
|
10
|
+
|
11
|
+
def self.create( gemfile, &block )
|
12
|
+
require 'rubygems'
|
13
|
+
require 'rubygems/format'
|
14
|
+
self.new( Gem::Format.from_file_by_path( gemfile ).spec )
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize( spec, &block )
|
18
|
+
super( "rubygems", spec.name, spec.version, &block )
|
19
|
+
|
20
|
+
packaging "gem"
|
21
|
+
|
22
|
+
name spec.summary || "#{self.artifact_id} - gem"
|
23
|
+
description spec.description if spec.description
|
24
|
+
url spec.homepage if spec.homepage
|
25
|
+
( [spec.email].flatten || [] ).zip( [spec.authors].flatten || [] ).map do |email, author|
|
26
|
+
self.developers.new( author, email )
|
27
|
+
end
|
28
|
+
|
29
|
+
# TODO work with collection of licenses - there can be more than one !!!
|
30
|
+
( spec.licenses + spec.files.select {|file| file.to_s =~ /license|gpl/i } ).each do |license|
|
31
|
+
# TODO make this better, i.e. detect the right license name from the file itself
|
32
|
+
self.licenses.new( license )
|
33
|
+
end
|
34
|
+
|
35
|
+
plugin('gem', VERSIONS[:jruby_plugins]) do |g|
|
36
|
+
g.extensions = true
|
37
|
+
end
|
38
|
+
|
39
|
+
spec.dependencies.each do |dep|
|
40
|
+
versions = dep.requirement.requirements.collect do |req|
|
41
|
+
# use this construct to get the same result in 1.8.x and 1.9.x
|
42
|
+
req.collect{ |i| i.to_s }.join
|
43
|
+
end
|
44
|
+
g = gem( dep.name, versions )
|
45
|
+
g.scope = 'test' if dep.type == :development
|
46
|
+
end
|
47
|
+
|
48
|
+
spec.requirements.each do |req|
|
49
|
+
req.split( /\n/ ).each do |r|
|
50
|
+
coord = to_coordinate( r )
|
51
|
+
if coord
|
52
|
+
name = coord.sub(/:[^:]+:[^:]+$/, '')
|
53
|
+
versions = coord.sub(/.*:/, '')
|
54
|
+
if r =~ /^\s*(jar|pom)\s/
|
55
|
+
jar( name, versions )
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/lib/maven/tools/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: maven-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.30.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kristian Meier
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-06
|
13
|
+
date: 2012-11-06 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- lib/maven/tools/pom_generator.rb
|
74
74
|
- lib/maven/tools/gemfile_lock.rb~
|
75
75
|
- lib/maven/tools/gemfile_lock.rb
|
76
|
+
- lib/maven/tools/minimal_project.rb
|
76
77
|
- lib/maven/tools/coordinate.rb~
|
77
78
|
- lib/maven/tools/versions.rb
|
78
79
|
- lib/maven/model/utils.rb
|