ruby-maven 3.1.1.0.11 → 3.3.0.dev
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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.mvn/extensions.xml +8 -0
- data/bin/rmvn +3 -5
- data/lib/maven/ruby/maven.rb +15 -73
- data/lib/maven/ruby/tasks.rb +2 -0
- data/lib/maven/ruby/version.rb +1 -2
- data/lib/ruby_maven.rb +35 -0
- data/ruby-maven.gemspec +29 -0
- data/spec/ruby_maven_spec.rb +45 -0
- data/spec/setup.rb +6 -0
- metadata +14 -45
- data/bin/dumppom +0 -9
- data/lib/tesla_maven.rb +0 -56
- data/ruby-maven-home/bin/m2.conf +0 -12
- data/ruby-maven-home/bin/m2jruby.conf +0 -5
- data/ruby-maven-home/ext/ruby/tesla-polyglot-ruby-0.1.1.jar +0 -0
- data/ruby-maven-home/lib/tesla-polyglot-cli-0.1.1.jar +0 -0
- data/ruby-maven-home/lib/tesla-polyglot-common-0.1.1.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e03da4bc5c0ca4eb74a7972b46c8164d0143a70
|
4
|
+
data.tar.gz: c38d06abd005604e8f09656043c8d497a61d34c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ae0e3c6152bf8c891f0e84d272854feccdbca15c419cd42844bdbf9e6a14669c265cce942ccde26770a2f36f6acd0102433526a3b3ac65ab88097a6d456366c
|
7
|
+
data.tar.gz: 0b97469946062419fcc526c156bdf587154b5827533699d4af108f54213b7195a444a9e16895615f9b62344675d03d6b30a17ba6aa17612a5997a90aa3b4cc59
|
data/.gitignore
ADDED
data/.mvn/extensions.xml
ADDED
data/bin/rmvn
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require '
|
3
|
-
|
4
|
-
mvn = Maven::Ruby::Maven.new
|
2
|
+
require 'ruby-maven'
|
5
3
|
|
6
4
|
args = ARGV.dup
|
7
|
-
ARGV.clear # clean up in case another script gets executed it gets clear ARGV
|
5
|
+
ARGV.clear # clean up in case another script gets executed it gets a clear ARGV
|
8
6
|
|
9
|
-
|
7
|
+
RubyMaven.exec(*args)
|
data/lib/maven/ruby/maven.rb
CHANGED
@@ -18,12 +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
|
-
|
22
|
-
require 'maven/tools/model'
|
23
|
-
end
|
24
|
-
require 'maven/tools/visitor'
|
21
|
+
require 'ruby_maven'
|
25
22
|
require 'fileutils'
|
26
|
-
require 'tesla_maven'
|
27
23
|
|
28
24
|
module Maven
|
29
25
|
module Ruby
|
@@ -33,57 +29,6 @@ module Maven
|
|
33
29
|
|
34
30
|
private
|
35
31
|
|
36
|
-
# TODO if this is not needed anymore remove it completely
|
37
|
-
def launch_jruby(args)
|
38
|
-
java.lang.System.setProperty( "classworlds.conf",
|
39
|
-
TeslaMaven.bin( "m2jruby.conf" ) )
|
40
|
-
|
41
|
-
java.lang.System.setProperty( 'maven.home', TeslaMaven.maven_home )
|
42
|
-
java.lang.System.setProperty( 'tesla.home', TeslaMaven.home )
|
43
|
-
|
44
|
-
# loading here is needed to let tesla-ruby find jruby on
|
45
|
-
# classloader
|
46
|
-
self.class.require_classpath( TeslaMaven.maven_boot )
|
47
|
-
self.class.require_classpath( TeslaMaven.maven_lib )
|
48
|
-
self.class.require_classpath( TeslaMaven.lib )
|
49
|
-
|
50
|
-
# this is a hack to ensure ruby-maven also works inside the
|
51
|
-
# jruby development itself where the lib/jruby.jar gets build
|
52
|
-
# during the execution of maven and the jar used to launch jruby
|
53
|
-
# will be replaced.
|
54
|
-
|
55
|
-
jar = 'lib/jruby.jar'
|
56
|
-
jar_copy = 'lib/jruby-copy.jar'
|
57
|
-
if File.exists? jar
|
58
|
-
FileUtils.mv( jar, jar_copy )
|
59
|
-
end
|
60
|
-
|
61
|
-
org.codehaus.plexus.classworlds.launcher.Launcher.main_with_exit_code( args )
|
62
|
-
ensure
|
63
|
-
if File.exists? jar_copy
|
64
|
-
FileUtils.mv( jar_copy, jar )
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def launch_java(args)
|
69
|
-
# TODO works only on unix like OS
|
70
|
-
system "java -cp #{self.class.classpath( TeslaMaven.maven_boot )} -Dmaven.home=#{TeslaMaven.maven_home} -Dtesla.home=#{TeslaMaven.home} -Dclassworlds.conf=#{TeslaMaven.bin( 'm2.conf' )} org.codehaus.plexus.classworlds.launcher.Launcher #{args.join ' '}"
|
71
|
-
end
|
72
|
-
|
73
|
-
def self.classpath_array( dir )
|
74
|
-
Dir.glob( File.join( dir, "*jar" ) )
|
75
|
-
end
|
76
|
-
|
77
|
-
def self.classpath( dir )
|
78
|
-
classpath_array( dir ).join( File::PATH_SEPARATOR )
|
79
|
-
end
|
80
|
-
|
81
|
-
def self.require_classpath( dir )
|
82
|
-
classpath_array( dir ).each do |jar|
|
83
|
-
require jar
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
32
|
def options_array
|
88
33
|
options.collect do |k,v|
|
89
34
|
if k =~ /^-D/
|
@@ -103,7 +48,16 @@ module Maven
|
|
103
48
|
|
104
49
|
def initialize( project = nil, temp_pom = nil )
|
105
50
|
super()
|
51
|
+
|
106
52
|
if project
|
53
|
+
warn 'deprecated: EOF - just tell maven where you (ruby) pom is'
|
54
|
+
begin
|
55
|
+
require 'maven/tools/model'
|
56
|
+
require 'maven/tools/visitor'
|
57
|
+
rescue LoadError => e
|
58
|
+
warn 'maven-tools gem is not a direct dependency anymore'
|
59
|
+
raise e
|
60
|
+
end
|
107
61
|
f = File.expand_path( temp_pom || '.pom.xml' )
|
108
62
|
v = ::Maven::Tools::Visitor.new( File.open( f, 'w' ) )
|
109
63
|
# parse project and write out to temp_pom file
|
@@ -125,6 +79,7 @@ module Maven
|
|
125
79
|
def property(key, value = nil)
|
126
80
|
options["-D#{key}"] = value
|
127
81
|
end
|
82
|
+
alias :[]= :property
|
128
83
|
|
129
84
|
def verbose
|
130
85
|
if @verbose.nil?
|
@@ -135,24 +90,11 @@ module Maven
|
|
135
90
|
end
|
136
91
|
|
137
92
|
def exec(*args)
|
138
|
-
|
139
|
-
|
140
|
-
puts "mvn #{a.join(' ')}"
|
93
|
+
if verbose
|
94
|
+
puts "mvn #{args.join(' ')}"
|
141
95
|
end
|
142
|
-
|
143
|
-
|
144
|
-
# just keep it clean
|
145
|
-
Bundler.with_clean_env do
|
146
|
-
launch( a )
|
147
|
-
end
|
148
|
-
else
|
149
|
-
launch( a )
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
def launch( args )
|
154
|
-
puts "using java invokation" if verbose
|
155
|
-
result = launch_java( args )
|
96
|
+
|
97
|
+
result = RubyMaven.exec( *args )
|
156
98
|
if @embedded and not result
|
157
99
|
raise "error in executing maven #{result}"
|
158
100
|
else
|
data/lib/maven/ruby/tasks.rb
CHANGED
data/lib/maven/ruby/version.rb
CHANGED
data/lib/ruby_maven.rb
CHANGED
@@ -18,4 +18,39 @@
|
|
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 'maven'
|
21
22
|
require 'maven/ruby/maven'
|
23
|
+
|
24
|
+
module RubyMaven
|
25
|
+
|
26
|
+
def self.exec( *args )
|
27
|
+
if args.member?('-version') or args.member?('--version') or args.member?('-v')
|
28
|
+
puts "Polyglot Maven Extension #{POLYGLOT_VERSION}\n"
|
29
|
+
launch( '--version' )
|
30
|
+
elsif defined? Bundler
|
31
|
+
# it can be switching from ruby to jruby with invoking maven
|
32
|
+
# just keep it clean
|
33
|
+
Bundler.with_clean_env do
|
34
|
+
launch( *args )
|
35
|
+
end
|
36
|
+
else
|
37
|
+
launch( *args )
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.dir
|
42
|
+
@dir ||= File.expand_path( '../../', __FILE__ )
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.launch( *args )
|
46
|
+
Dir.chdir( dir ) do
|
47
|
+
Maven.exec( *args )
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
POLYGLOT_VERSION = begin
|
52
|
+
xml = File.read( File.join( dir, '.mvn/extensions.xml' ) )
|
53
|
+
xml.sub( /.*<version>/m, '' ).sub(/<\/version>.*/m, '' )
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
data/ruby-maven.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- mode:ruby -*-
|
2
|
+
|
3
|
+
require './lib/maven/ruby/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'ruby-maven'
|
7
|
+
s.version = Maven::Ruby::VERSION
|
8
|
+
|
9
|
+
s.authors = ["Christian Meier"]
|
10
|
+
s.description = %q{maven support for ruby based on tesla maven. MRI needs java/javac command installed.}
|
11
|
+
s.summary = %q{maven support for ruby projects}
|
12
|
+
s.email = ["m.kristian@web.de"]
|
13
|
+
|
14
|
+
s.homepage = %q{https://github.com/takari/ruby-maven}
|
15
|
+
|
16
|
+
s.license = 'EPL'
|
17
|
+
|
18
|
+
s.files = `git ls-files`.split($/)
|
19
|
+
|
20
|
+
s.executables = ['rmvn']
|
21
|
+
s.rdoc_options = ["--main", "README.md"]
|
22
|
+
|
23
|
+
#s.add_dependency 'maven-tools', "~> 1.0.6"
|
24
|
+
#s.add_dependency 'ruby-maven-libs', "~> 3.3.1"
|
25
|
+
s.add_development_dependency 'minitest', '~> 5.3'
|
26
|
+
s.add_development_dependency 'rake', '~> 10.3'
|
27
|
+
end
|
28
|
+
|
29
|
+
# vim: syntax=Ruby
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require_relative 'setup'
|
2
|
+
require 'ruby_maven'
|
3
|
+
require 'maven/ruby/version'
|
4
|
+
|
5
|
+
module CatchStdout
|
6
|
+
|
7
|
+
def self.exec
|
8
|
+
out = $stdout
|
9
|
+
@result = StringIO.new
|
10
|
+
$stdout = @result
|
11
|
+
yield
|
12
|
+
ensure
|
13
|
+
$stdout = out
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.result
|
17
|
+
@result.string
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe RubyMaven do
|
22
|
+
|
23
|
+
it 'displays the version info' do
|
24
|
+
CatchStdout.exec do
|
25
|
+
RubyMaven.exec( '--version' )
|
26
|
+
end
|
27
|
+
CatchStdout.result.must_match /Polyglot Maven Extension 0.1.9/
|
28
|
+
end
|
29
|
+
|
30
|
+
let :gem do
|
31
|
+
v = Maven::Ruby::VERSION
|
32
|
+
v += '-SNAPSHOT' if v =~ /[a-zA-Z]/
|
33
|
+
"pkg/ruby-maven-#{v}.gem"
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'pack the gem' do
|
37
|
+
FileUtils.rm_f gem
|
38
|
+
CatchStdout.exec do
|
39
|
+
RubyMaven.exec( '-Dverbose', 'package' )
|
40
|
+
end
|
41
|
+
CatchStdout.result.must_match /mvn -Dverbose package/
|
42
|
+
File.exists?( gem )
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
data/spec/setup.rb
ADDED
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-maven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0.dev
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Meier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: maven-tools
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.8
|
20
|
-
requirement: !ruby/object:Gem::Requirement
|
21
|
-
requirements:
|
22
|
-
- - ~>
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: 1.0.8
|
25
|
-
prerelease: false
|
26
|
-
type: :runtime
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: ruby-maven-libs
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 3.1.1
|
34
|
-
requirement: !ruby/object:Gem::Requirement
|
35
|
-
requirements:
|
36
|
-
- - '='
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: 3.1.1
|
39
|
-
prerelease: false
|
40
|
-
type: :runtime
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: minitest
|
43
15
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -71,25 +43,22 @@ email:
|
|
71
43
|
- m.kristian@web.de
|
72
44
|
executables:
|
73
45
|
- rmvn
|
74
|
-
- dumppom
|
75
46
|
extensions: []
|
76
47
|
extra_rdoc_files: []
|
77
48
|
files:
|
78
|
-
-
|
79
|
-
-
|
80
|
-
- ruby-maven-home/bin/m2.conf
|
81
|
-
- ruby-maven-home/ext/ruby/tesla-polyglot-ruby-0.1.1.jar
|
82
|
-
- lib/ruby-maven.rb
|
83
|
-
- lib/tesla_maven.rb
|
84
|
-
- lib/ruby_maven.rb
|
49
|
+
- .gitignore
|
50
|
+
- .mvn/extensions.xml
|
85
51
|
- lib/maven/ruby.rb
|
86
|
-
- lib/maven/ruby/version.rb
|
87
52
|
- lib/maven/ruby/maven.rb
|
88
53
|
- lib/maven/ruby/tasks.rb
|
89
|
-
-
|
90
|
-
- ruby-maven
|
91
|
-
-
|
92
|
-
|
54
|
+
- lib/maven/ruby/version.rb
|
55
|
+
- lib/ruby-maven.rb
|
56
|
+
- lib/ruby_maven.rb
|
57
|
+
- ruby-maven.gemspec
|
58
|
+
- spec/ruby_maven_spec.rb
|
59
|
+
- spec/setup.rb
|
60
|
+
- bin/rmvn
|
61
|
+
homepage: https://github.com/takari/ruby-maven
|
93
62
|
licenses:
|
94
63
|
- EPL
|
95
64
|
metadata: {}
|
@@ -106,9 +75,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
75
|
version: '0'
|
107
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
77
|
requirements:
|
109
|
-
- - '
|
78
|
+
- - '>'
|
110
79
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
80
|
+
version: 1.3.1
|
112
81
|
requirements: []
|
113
82
|
rubyforge_project:
|
114
83
|
rubygems_version: 2.1.9
|
data/bin/dumppom
DELETED
data/lib/tesla_maven.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'maven'
|
3
|
-
rescue LoadError
|
4
|
-
#allow to access the version anyways
|
5
|
-
end
|
6
|
-
|
7
|
-
module TeslaMaven
|
8
|
-
|
9
|
-
VERSION = '0.1.1'.freeze
|
10
|
-
|
11
|
-
def self.home
|
12
|
-
File.expand_path( File.join( File.dirname( File.expand_path( __FILE__ ) ), '../ruby-maven-home' ) )
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.bin( file = nil )
|
16
|
-
if file
|
17
|
-
File.join( path( 'bin' ), file )
|
18
|
-
else
|
19
|
-
path( 'bin' )
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.ext
|
24
|
-
path( 'ext' )
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.lib
|
28
|
-
path( 'lib' )
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.maven_home
|
32
|
-
Maven.home
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.maven_bin
|
36
|
-
Maven.bin
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.maven_lib
|
40
|
-
Maven.lib
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.maven_conf
|
44
|
-
Maven.conf
|
45
|
-
end
|
46
|
-
|
47
|
-
def self.maven_boot
|
48
|
-
Maven.boot
|
49
|
-
end
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
def self.path( name )
|
54
|
-
File.join( home, name )
|
55
|
-
end
|
56
|
-
end
|
data/ruby-maven-home/bin/m2.conf
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
main is org.apache.maven.cli.PolyglotMavenCli from plexus.core
|
2
|
-
|
3
|
-
set maven.home default ${user.home}/m2
|
4
|
-
set tesla.home default ${user.home}/m2
|
5
|
-
set tesla.ext default ${tesla.home}/ext
|
6
|
-
set tesla.lib default ${tesla.home}/lib
|
7
|
-
|
8
|
-
[plexus.core]
|
9
|
-
load ${maven.home}/conf/logging
|
10
|
-
load ${maven.home}/lib/*.jar
|
11
|
-
load ${tesla.ext}/ruby/*.jar
|
12
|
-
load ${tesla.lib}/tesla-*.jar
|
Binary file
|
Binary file
|
Binary file
|