ruby-maven 3.0.4.1.4 → 3.1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/bin/m2.conf +11 -7
  2. data/bin/rmvn +2 -2
  3. data/ext/ruby/maven-tools-0.33.0.jar +0 -0
  4. data/ext/ruby/tesla-polyglot-ruby-0.0.1-SNAPSHOT.jar +0 -0
  5. data/lib/tesla-polyglot-cli-0.0.1-SNAPSHOT.jar +0 -0
  6. data/lib/tesla-polyglot-common-0.0.1-SNAPSHOT.jar +0 -0
  7. data/{lib/ruby → ruby}/maven/ruby.rb +0 -0
  8. data/ruby/maven/ruby/maven.rb +199 -0
  9. data/ruby/maven/ruby/tasks.rb +75 -0
  10. data/ruby/maven/ruby/version.rb +6 -0
  11. data/{lib/ruby → ruby}/ruby-maven.rb +0 -0
  12. data/{lib/ruby → ruby}/ruby_maven.rb +0 -0
  13. data/ruby/tesla_maven.rb +56 -0
  14. metadata +42 -104
  15. data/LICENSE.txt +0 -202
  16. data/MIT-LICENSE +0 -20
  17. data/NOTICE.txt +0 -23
  18. data/README.txt +0 -77
  19. data/bin/mvn +0 -172
  20. data/bin/mvn.bat +0 -197
  21. data/bin/mvnDebug +0 -177
  22. data/bin/mvnDebug.bat +0 -200
  23. data/bin/mvnyjp +0 -193
  24. data/boot/plexus-classworlds-2.4.jar +0 -0
  25. data/conf/settings.xml +0 -257
  26. data/lib/aether-api-1.13.1.jar +0 -0
  27. data/lib/aether-connector-wagon-1.13.1.jar +0 -0
  28. data/lib/aether-impl-1.13.1.jar +0 -0
  29. data/lib/aether-spi-1.13.1.jar +0 -0
  30. data/lib/aether-util-1.13.1.jar +0 -0
  31. data/lib/commons-cli-1.2.jar +0 -0
  32. data/lib/ext/README.txt +0 -2
  33. data/lib/maven-aether-provider-3.0.4.jar +0 -0
  34. data/lib/maven-artifact-3.0.4.jar +0 -0
  35. data/lib/maven-compat-3.0.4.jar +0 -0
  36. data/lib/maven-core-3.0.4.jar +0 -0
  37. data/lib/maven-embedder-3.0.4.jar +0 -0
  38. data/lib/maven-model-3.0.4.jar +0 -0
  39. data/lib/maven-model-builder-3.0.4.jar +0 -0
  40. data/lib/maven-plugin-api-3.0.4.jar +0 -0
  41. data/lib/maven-repository-metadata-3.0.4.jar +0 -0
  42. data/lib/maven-settings-3.0.4.jar +0 -0
  43. data/lib/maven-settings-builder-3.0.4.jar +0 -0
  44. data/lib/plexus-cipher-1.7.jar +0 -0
  45. data/lib/plexus-component-annotations-1.5.5.jar +0 -0
  46. data/lib/plexus-interpolation-1.14.jar +0 -0
  47. data/lib/plexus-sec-dispatcher-1.3.jar +0 -0
  48. data/lib/plexus-utils-2.0.6.jar +0 -0
  49. data/lib/ruby/maven/cli.rb~ +0 -227
  50. data/lib/ruby/maven/cucumber_steps.rb~ +0 -134
  51. data/lib/ruby/maven/pom_magic.rb~ +0 -227
  52. data/lib/ruby/maven/ruby/Mavenfile +0 -7
  53. data/lib/ruby/maven/ruby/Mavenfile~ +0 -7
  54. data/lib/ruby/maven/ruby/cli.rb +0 -161
  55. data/lib/ruby/maven/ruby/cli.rb~ +0 -146
  56. data/lib/ruby/maven/ruby/maven.rb +0 -145
  57. data/lib/ruby/maven/ruby/maven.rb~ +0 -132
  58. data/lib/ruby/maven/ruby/pom_magic.rb +0 -132
  59. data/lib/ruby/maven/ruby/pom_magic.rb~ +0 -78
  60. data/lib/ruby/maven/ruby/version.rb +0 -32
  61. data/lib/ruby/maven/ruby/version.rb~ +0 -5
  62. data/lib/ruby/maven/ruby_cli.rb~ +0 -131
  63. data/lib/ruby/maven/ruby_maven.rb~ +0 -227
  64. data/lib/sisu-guava-0.9.9.jar +0 -0
  65. data/lib/sisu-guice-3.1.0-no_aop.jar +0 -0
  66. data/lib/sisu-inject-bean-2.3.0.jar +0 -0
  67. data/lib/sisu-inject-plexus-2.3.0.jar +0 -0
  68. data/lib/wagon-file-2.2.jar +0 -0
  69. data/lib/wagon-http-2.2-shaded.jar +0 -0
  70. data/lib/wagon-provider-api-2.2.jar +0 -0
@@ -1,227 +0,0 @@
1
- require 'fileutils'
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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file