ruby-maven 3.0.4.0.29.0 → 3.0.4.1
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/bin/rmvn +4 -2
- data/lib/ruby/maven/cli.rb~ +227 -0
- data/lib/ruby/maven/{cucumber_steps.rb → cucumber_steps.rb~} +2 -29
- data/lib/ruby/maven/pom_magic.rb~ +227 -0
- data/lib/ruby/maven/ruby.rb +1 -0
- data/lib/ruby/maven/ruby/cli.rb +134 -0
- data/lib/ruby/maven/ruby/cli.rb~ +127 -0
- data/lib/ruby/maven/ruby/maven.rb +108 -0
- data/lib/ruby/maven/ruby/maven.rb~ +93 -0
- data/lib/ruby/maven/ruby/pom_magic.rb +70 -0
- data/lib/ruby/maven/ruby/pom_magic.rb~ +56 -0
- data/lib/ruby/maven/ruby/version.rb +5 -0
- data/lib/ruby/maven/ruby/version.rb~ +6 -0
- data/lib/ruby/maven/ruby_cli.rb~ +131 -0
- data/lib/ruby/maven/ruby_maven.rb~ +227 -0
- data/lib/ruby/ruby_maven.rb +1 -227
- metadata +44 -6
data/lib/ruby/ruby_maven.rb
CHANGED
@@ -1,227 +1 @@
|
|
1
|
-
require '
|
2
|
-
require 'maven/tools/rails_project'
|
3
|
-
require 'java' if defined? JRUBY_VERSION
|
4
|
-
|
5
|
-
module Maven
|
6
|
-
class RubyMaven
|
7
|
-
|
8
|
-
# make the command line for the goals of the jruby-maven-plugins nicer
|
9
|
-
PLUGINS = {
|
10
|
-
:rake => [:rake],
|
11
|
-
:jruby => [:jruby, :compile],
|
12
|
-
:gem => [:package, :install, :push, :exec, :pom, :initialize, :irb],
|
13
|
-
:rails3 => [:new, :generate, :rake, :server, :console, :dbconsole, :pom, :initialize],
|
14
|
-
:cucumber => [:test],
|
15
|
-
:rspec => [:test],
|
16
|
-
:runit => [:test],
|
17
|
-
:mini => [:test,:spec],
|
18
|
-
:bundler => [:install, :update]
|
19
|
-
}
|
20
|
-
ALIASES = {
|
21
|
-
:ruby => :jruby,
|
22
|
-
:spec => :rspec,
|
23
|
-
:rails => :rails3,
|
24
|
-
:bundle => :bundler
|
25
|
-
}
|
26
|
-
|
27
|
-
def initialize
|
28
|
-
@maven_home = File.expand_path(File.join(File.dirname(__FILE__),'..','..'))
|
29
|
-
end
|
30
|
-
|
31
|
-
def launch_jruby(args)
|
32
|
-
classpath_array.each do |path|
|
33
|
-
require path
|
34
|
-
end
|
35
|
-
|
36
|
-
java.lang.System.setProperty("classworlds.conf",
|
37
|
-
File.join(@maven_home, 'bin', "m2.conf"))
|
38
|
-
|
39
|
-
java.lang.System.setProperty("maven.home", @maven_home)
|
40
|
-
|
41
|
-
org.codehaus.plexus.classworlds.launcher.Launcher.main(args)
|
42
|
-
end
|
43
|
-
|
44
|
-
def classpath_array
|
45
|
-
Dir.glob(File.join(@maven_home, "boot", "*jar")) +
|
46
|
-
Dir.glob(File.join(@maven_home, "ext", "ruby-tools*jar"))
|
47
|
-
end
|
48
|
-
|
49
|
-
def launch_java(*args)
|
50
|
-
system "java -cp #{classpath_array.join(':')} -Dmaven.home=#{File.expand_path(@maven_home)} -Dclassworlds.conf=#{File.expand_path(File.join(@maven_home, 'bin', 'm2.conf'))} org.codehaus.plexus.classworlds.launcher.Launcher #{args.join ' '}"
|
51
|
-
end
|
52
|
-
|
53
|
-
def prepare(args)
|
54
|
-
if args.size > 0
|
55
|
-
name = args[0].to_sym
|
56
|
-
name = ALIASES[name] || name
|
57
|
-
if PLUGINS.member?(name)
|
58
|
-
start = 1
|
59
|
-
if args.size > 1
|
60
|
-
if PLUGINS[name].member? args[1].to_sym
|
61
|
-
goal = args[1].to_sym
|
62
|
-
start = 2
|
63
|
-
else
|
64
|
-
goal = PLUGINS[name][0]
|
65
|
-
end
|
66
|
-
else
|
67
|
-
goal = PLUGINS[name][0]
|
68
|
-
end
|
69
|
-
# determine the version and delete from args if given
|
70
|
-
version = args.detect do |a|
|
71
|
-
a =~ /^-Dplugin.version=/
|
72
|
-
end
|
73
|
-
version ||= options['-Dplugin.version']
|
74
|
-
|
75
|
-
if version
|
76
|
-
args.delete(version)
|
77
|
-
version = ":" + version.sub(/^-Dplugin.version=/, '')
|
78
|
-
end
|
79
|
-
aa = if index = args.index("--")
|
80
|
-
args[(index + 1)..-1]
|
81
|
-
else
|
82
|
-
[]
|
83
|
-
end
|
84
|
-
ruby_args = (args[start, (index || 1000) - start] || []).join(' ')
|
85
|
-
|
86
|
-
aa << "de.saumya.mojo:#{name}-maven-plugin#{version}:#{goal}"
|
87
|
-
aa << "-Dargs=\"#{ruby_args}\"" if ruby_args.size > 0
|
88
|
-
args.replace(aa)
|
89
|
-
else
|
90
|
-
args.delete("--")
|
91
|
-
end
|
92
|
-
end
|
93
|
-
args
|
94
|
-
end
|
95
|
-
|
96
|
-
def log(args)
|
97
|
-
log = File.join('log', 'rmvn.log')
|
98
|
-
if File.exists? File.dirname(log)
|
99
|
-
File.open(log, 'a') do |f|
|
100
|
-
f.puts "#{$0.sub(/.*\//, '')} #{args.join ' '}"
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
def maybe_print_help(args)
|
106
|
-
if args.size == 0 || args[0] == "--help"
|
107
|
-
puts "usage: rmvn [<plugin-name> [<args>] [-- <maven-options>]] | [<maven-goal>|<maven-phase> <maven-options>] | --help"
|
108
|
-
PLUGINS.each do |name, goals|
|
109
|
-
puts
|
110
|
-
print "plugin #{name}"
|
111
|
-
print " - alias: #{ALIASES.invert[name]}" if ALIASES.invert[name]
|
112
|
-
puts
|
113
|
-
if goals.size > 1
|
114
|
-
print "\tgoals : #{goals.join(',')}"
|
115
|
-
puts
|
116
|
-
end
|
117
|
-
print "\tdefault goal: #{goals[0]}"
|
118
|
-
puts
|
119
|
-
end
|
120
|
-
puts
|
121
|
-
["--help"]
|
122
|
-
else
|
123
|
-
args
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
def options
|
128
|
-
@options ||= {}
|
129
|
-
end
|
130
|
-
|
131
|
-
def options_string
|
132
|
-
options_array.join ' '
|
133
|
-
end
|
134
|
-
|
135
|
-
def options_array
|
136
|
-
options.collect do |k,v|
|
137
|
-
if k =~ /^-D/
|
138
|
-
v = "=#{v}" unless v.nil?
|
139
|
-
else
|
140
|
-
v = " #{v}" unless v.nil?
|
141
|
-
end
|
142
|
-
"#{k}#{v}"
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
def command_line(args)
|
147
|
-
args = prepare(args)
|
148
|
-
args = maybe_print_help(args)
|
149
|
-
args
|
150
|
-
end
|
151
|
-
|
152
|
-
def new_rails_project
|
153
|
-
Maven::Tools::RailsProject.new
|
154
|
-
end
|
155
|
-
|
156
|
-
def generate_pom(*args)
|
157
|
-
unless args.member?("-f") || args.member?("--file")
|
158
|
-
gemfiles = Dir["*Gemfile"]
|
159
|
-
gemfiles.delete_if {|g| g =~ /.pom/}
|
160
|
-
if gemfiles.size > 0
|
161
|
-
proj =
|
162
|
-
if File.exists? File.join( 'config', 'application.rb' )
|
163
|
-
new_rails_project
|
164
|
-
else
|
165
|
-
Maven::Tools::GemProject.new
|
166
|
-
end
|
167
|
-
filename = gemfiles[0]
|
168
|
-
proj.load_gemfile(filename)
|
169
|
-
else
|
170
|
-
gemspecs = Dir["*.gemspec"]
|
171
|
-
gemspecs.delete_if {|g| g =~ /.pom/}
|
172
|
-
if gemspecs.size > 0
|
173
|
-
proj = Maven::Tools::GemProject.new
|
174
|
-
filename = gemspecs[0]
|
175
|
-
proj.load_gemspec(filename)
|
176
|
-
end
|
177
|
-
end
|
178
|
-
if filename
|
179
|
-
proj.load_jarfile(File.join(File.dirname(filename), 'Jarfile'))
|
180
|
-
proj.load_gemfile(File.join(File.dirname(filename), 'Mavenfile'))
|
181
|
-
proj.add_defaults
|
182
|
-
#target = File.join(File.dirname(filename), 'target')
|
183
|
-
#FileUtils.mkdir_p target
|
184
|
-
pom = ".pom.xml"
|
185
|
-
File.open(pom, 'w') do |f|
|
186
|
-
f.puts proj.to_xml
|
187
|
-
end
|
188
|
-
args << '-f'
|
189
|
-
args << pom
|
190
|
-
end
|
191
|
-
end
|
192
|
-
args
|
193
|
-
end
|
194
|
-
|
195
|
-
def exec(*args)
|
196
|
-
log(args)
|
197
|
-
a = command_line(args.dup.flatten)
|
198
|
-
verbose = options.delete('--verbose')
|
199
|
-
no_pom = options.delete('--no-pom')
|
200
|
-
a << options_array
|
201
|
-
a.flatten!
|
202
|
-
a = generate_pom(*a) unless no_pom
|
203
|
-
puts "mvn #{a.join(' ')}" if verbose
|
204
|
-
if defined? JRUBY_VERSION
|
205
|
-
# TODO use a setup like maven_gemify from jruby to launch maven
|
206
|
-
launch_java(a)
|
207
|
-
else
|
208
|
-
launch_java(a)
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
def exec_in(launchdirectory, *args)
|
213
|
-
succeeded = nil
|
214
|
-
FileUtils.cd(launchdirectory) do
|
215
|
-
succeeded = exec(args)
|
216
|
-
end
|
217
|
-
succeeded
|
218
|
-
end
|
219
|
-
|
220
|
-
def dump_pom(force = false, file = 'pom.xml')
|
221
|
-
if force || !File.exists?(file)
|
222
|
-
generate_pom
|
223
|
-
FileUtils.cp(".pom.xml", file)
|
224
|
-
end
|
225
|
-
end
|
226
|
-
end
|
227
|
-
end
|
1
|
+
require 'maven/ruby/maven'
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ruby-maven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.0.4.
|
5
|
+
version: 3.0.4.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- mkristian
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-08-13 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
@@ -18,9 +18,12 @@ dependencies:
|
|
18
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 0.14.6
|
24
|
+
- - <
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: "2.0"
|
24
27
|
type: :runtime
|
25
28
|
version_requirements: *id001
|
26
29
|
- !ruby/object:Gem::Dependency
|
@@ -34,6 +37,28 @@ dependencies:
|
|
34
37
|
version: 0.29.1
|
35
38
|
type: :runtime
|
36
39
|
version_requirements: *id002
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: minitest
|
42
|
+
prerelease: false
|
43
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - "="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 3.3.0
|
49
|
+
type: :development
|
50
|
+
version_requirements: *id003
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: rake
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - "="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.9.2.2
|
60
|
+
type: :development
|
61
|
+
version_requirements: *id004
|
37
62
|
description: maven support for rubygems based on maven 3.0. it allows to use xyz.gemspec file as pom file or the usual pom.xml files. with a rails3 application with a Gemfile (suitable for jruby). you need java installed or jruby but it will run with MRI (without installed jruby) since the maven will take care of the jruby to use.
|
38
63
|
email:
|
39
64
|
- m.kristian@web.de
|
@@ -90,7 +115,20 @@ files:
|
|
90
115
|
- lib/ext/README.txt
|
91
116
|
- lib/ruby/ruby_maven.rb
|
92
117
|
- lib/ruby/ruby-maven.rb
|
93
|
-
- lib/ruby/maven/
|
118
|
+
- lib/ruby/maven/cli.rb~
|
119
|
+
- lib/ruby/maven/ruby_maven.rb~
|
120
|
+
- lib/ruby/maven/cucumber_steps.rb~
|
121
|
+
- lib/ruby/maven/ruby_cli.rb~
|
122
|
+
- lib/ruby/maven/ruby.rb
|
123
|
+
- lib/ruby/maven/pom_magic.rb~
|
124
|
+
- lib/ruby/maven/ruby/pom_magic.rb
|
125
|
+
- lib/ruby/maven/ruby/cli.rb~
|
126
|
+
- lib/ruby/maven/ruby/version.rb
|
127
|
+
- lib/ruby/maven/ruby/cli.rb
|
128
|
+
- lib/ruby/maven/ruby/pom_magic.rb~
|
129
|
+
- lib/ruby/maven/ruby/version.rb~
|
130
|
+
- lib/ruby/maven/ruby/maven.rb
|
131
|
+
- lib/ruby/maven/ruby/maven.rb~
|
94
132
|
homepage: http://github.com/mkristian/ruby-maven
|
95
133
|
licenses: []
|
96
134
|
|
@@ -109,9 +147,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
148
|
none: false
|
111
149
|
requirements:
|
112
|
-
- - "
|
150
|
+
- - ">="
|
113
151
|
- !ruby/object:Gem::Version
|
114
|
-
version:
|
152
|
+
version: "0"
|
115
153
|
requirements: []
|
116
154
|
|
117
155
|
rubyforge_project:
|