jbundler 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile.lock +6 -6
- data/Readme.md +5 -3
- data/lib/jbundler.jar +0 -0
- data/lib/jbundler.rb +10 -0
- data/lib/jbundler/classpath_file.rb +18 -6
- data/lib/jbundler/cli.rb +20 -0
- data/lib/jbundler/config.rb +10 -2
- data/lib/jbundler/executable.rb +1 -2
- data/lib/jbundler/executable_pom.rb +3 -1
- data/lib/jbundler/lock_down.rb +105 -0
- data/lib/jbundler/lock_down_pom.rb +23 -0
- data/lib/jbundler/show.rb +43 -0
- data/lib/jbundler/tree.rb +4 -13
- data/lib/jbundler/tree_pom.rb +1 -1
- data/lib/jbundler/vendor.rb +9 -2
- data/spec/classpath_file_spec.rb +4 -0
- data/spec/config_spec.rb +1 -1
- metadata +14 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 84995673fbb7c47e7f3ad1b2b8c6973dc97feb43
|
4
|
+
data.tar.gz: 002ded9ef8e351737ac6e0202beec5fab700f643
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 63904f8bb1cc95824bbe7d57deeedc7edb510ec17dd0a2aea2cdf7877945565a41733d446f5557ecdff71e518b9894bac1d19f650cdd070c2d4e23079c7b33ee
|
7
|
+
data.tar.gz: e3e4d92cd282bace89e3ea1f29a6d9d63809b087cd1b91532c855c57d990ad2ba93328423e02c00915370750c21856557882c4cb2377eda7b1bff9464e369da9
|
data/Gemfile.lock
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jbundler (0.5.
|
5
|
-
bundler (~> 1.
|
4
|
+
jbundler (0.5.5)
|
5
|
+
bundler (~> 1.5)
|
6
6
|
ruby-maven (>= 3.1.1.0.1, < 3.1.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
backports (3.
|
11
|
+
backports (3.4.0)
|
12
12
|
copyright-header (1.0.8)
|
13
13
|
descendants_tracker (0.0.3)
|
14
14
|
maven-tools (0.34.2)
|
15
15
|
virtus (~> 0.5)
|
16
16
|
minitest (4.7.5)
|
17
17
|
rake (10.1.0)
|
18
|
-
ruby-maven (3.1.1.0.
|
18
|
+
ruby-maven (3.1.1.0.2)
|
19
19
|
maven-tools (~> 0.33)
|
20
20
|
ruby-maven-libs (= 3.1.1)
|
21
21
|
ruby-maven-libs (3.1.1)
|
22
|
-
thor (0.
|
22
|
+
thor (0.18.1)
|
23
23
|
virtus (0.5.5)
|
24
24
|
backports (~> 3.3)
|
25
25
|
descendants_tracker (~> 0.0.1)
|
@@ -33,4 +33,4 @@ DEPENDENCIES
|
|
33
33
|
jbundler!
|
34
34
|
minitest (~> 4.0)
|
35
35
|
rake (~> 10.0)
|
36
|
-
thor (
|
36
|
+
thor (~> 0.18.0)
|
data/Readme.md
CHANGED
@@ -129,15 +129,17 @@ jbundler does not completely obey the **$HOME/.m2/settings.xml** from maven wher
|
|
129
129
|
|
130
130
|
some tests did not work with RVM and/or rubygems-bundler - there are some weird classloader issue popping up. there is a problem with the way the classloader gets setup. but a manual jruby installion or using rbenv is just working fine.
|
131
131
|
|
132
|
-
those issue might pop up with ```
|
132
|
+
those issue might pop up with ```jbundle tree``` and ```jbundle executable```
|
133
133
|
|
134
134
|
## running tests ##
|
135
135
|
|
136
|
-
* ```rake``` will
|
136
|
+
* ```rake``` will execute all tests without integration tests
|
137
|
+
* ```rake all``` will execute all tests
|
137
138
|
* ```rake minitest``` runs the minitest specs
|
139
|
+
* ```rake integration``` runs the integration tests where poms are used (might fail due to hardcoded absolute paths)
|
138
140
|
* ```rake junit``` runs the junit java tests
|
139
141
|
* ```jruby spec/abc_spec.rb``` runs that given tests (just use the right file)
|
140
|
-
* ```mvn test``` will also run all tests
|
142
|
+
* ```mvn test``` will also run all tests
|
141
143
|
* ```rmvn test`` same as ```mvn test```
|
142
144
|
|
143
145
|
## update ##
|
data/lib/jbundler.jar
CHANGED
Binary file
|
data/lib/jbundler.rb
CHANGED
@@ -24,6 +24,16 @@ require 'jbundler/vendor'
|
|
24
24
|
require 'jbundler/gemfile_lock'
|
25
25
|
require 'jbundler/aether'
|
26
26
|
|
27
|
+
module JBundler
|
28
|
+
|
29
|
+
def setup_test
|
30
|
+
config = JBundler::Config.new
|
31
|
+
JBundler::ClasspathFile.new(config.classpath_file).require_test_classpath
|
32
|
+
config
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
27
37
|
config = JBundler::Config.new
|
28
38
|
|
29
39
|
jarfile = Maven::Tools::Jarfile.new(config.jarfile)
|
@@ -28,6 +28,12 @@ module JBundler
|
|
28
28
|
|
29
29
|
def require_classpath
|
30
30
|
load File.expand_path @classpathfile
|
31
|
+
JBUNDLER_CLASSPATH.each { |c| require c }
|
32
|
+
end
|
33
|
+
|
34
|
+
def require_test_classpath
|
35
|
+
load File.expand_path @classpathfile unless defined? JBUNLDER_TEST_CLASSPATH
|
36
|
+
JBUNDLER_TEST_CLASSPATH.each { |c| require c }
|
31
37
|
end
|
32
38
|
|
33
39
|
def mtime
|
@@ -42,18 +48,24 @@ module JBundler
|
|
42
48
|
(jarfile.exists? || gemfile_lock.exists? || jarfile.exists_lock?) && (!exists? || !jarfile.exists_lock? || (jarfile.exists? && (jarfile.mtime > mtime)) || (jarfile.exists_lock? && (jarfile.mtime_lock > mtime)) || (gemfile_lock.exists? && (gemfile_lock.mtime > mtime)))
|
43
49
|
end
|
44
50
|
|
45
|
-
def generate(classpath_array)
|
51
|
+
def generate( classpath_array, test_array = [], jruby_array = [] )
|
46
52
|
FileUtils.mkdir_p(File.dirname(@classpathfile))
|
47
53
|
File.open(@classpathfile, 'w') do |f|
|
48
|
-
f
|
49
|
-
|
50
|
-
|
51
|
-
end
|
52
|
-
f.puts "JBUNDLER_CLASSPATH.freeze"
|
54
|
+
dump_array( f, jruby_array || [], 'JRUBY_' )
|
55
|
+
dump_array( f, test_array || [], 'TEST_' )
|
56
|
+
dump_array( f, classpath_array || [], '' )
|
53
57
|
f.puts "JBUNDLER_CLASSPATH.each { |c| require c }"
|
54
58
|
f.close
|
55
59
|
end
|
56
60
|
end
|
57
61
|
|
62
|
+
private
|
63
|
+
def dump_array( file, array, prefix )
|
64
|
+
file.puts "JBUNDLER_#{prefix}CLASSPATH = []"
|
65
|
+
array.each do |path|
|
66
|
+
file.puts "JBUNDLER_#{prefix}CLASSPATH << '#{path}'" unless path =~ /pom$/
|
67
|
+
end
|
68
|
+
file.puts "JBUNDLER_#{prefix}CLASSPATH.freeze"
|
69
|
+
end
|
58
70
|
end
|
59
71
|
end
|
data/lib/jbundler/cli.rb
CHANGED
@@ -22,6 +22,7 @@ require 'thor'
|
|
22
22
|
require 'jbundler/config'
|
23
23
|
require 'jbundler/executable'
|
24
24
|
require 'jbundler/tree'
|
25
|
+
require 'jbundler/lock_down'
|
25
26
|
module JBundler
|
26
27
|
class Cli < Thor
|
27
28
|
no_tasks do
|
@@ -58,6 +59,14 @@ module JBundler
|
|
58
59
|
JBundler::Tree.new( config ).show_it
|
59
60
|
end
|
60
61
|
|
62
|
+
desc 'lock_down', 'using a different library to create the Jarfile.lock - experimental'
|
63
|
+
method_option :vendor, :type => :boolean, :default => false, :desc => 'vendor jars in given vendor directory.'
|
64
|
+
method_option :debug, :type => :boolean, :default => false, :desc => 'enable maven output'
|
65
|
+
def lock_down
|
66
|
+
JBundler::LockDown.new( config ).lock_down( options[ :vendor ],
|
67
|
+
options[ :debug ] )
|
68
|
+
end
|
69
|
+
|
61
70
|
desc 'executable', 'create an executable jar with a given bootstrap.rb file\nLIMITATION: only for jruby 1.6.x and newer'
|
62
71
|
method_option :bootstrap, :type => :string, :aliases => '-b', :required => true, :desc => 'file which will be executed when the jar gets executed'
|
63
72
|
method_option :compile, :type => :boolean, :aliases => '-c', :default => false, :desc => 'compile the ruby files from the lib directory'
|
@@ -76,6 +85,17 @@ module JBundler
|
|
76
85
|
desc 'install', "first `bundle install` is called and then the jar dependencies will be installed. for more details see `bundle help install`, jbundler will ignore all options. the install command is also the default when no command is given."
|
77
86
|
method_option :deployment, :type => :boolean, :default => false, :desc => "copy the jars into the vendor/jars directory (or as configured). these vendored jars have preference before the classpath jars !"
|
78
87
|
method_option :no_deployment, :type => :boolean, :default => false, :desc => 'clears the vendored jars'
|
88
|
+
method_option :path, :type => :string
|
89
|
+
method_option :without, :type => :array
|
90
|
+
method_option :system, :type => :boolean
|
91
|
+
method_option :local, :type => :boolean
|
92
|
+
method_option :binstubs, :type => :string
|
93
|
+
method_option :trust_policy, :type => :string
|
94
|
+
method_option :gemfile, :type => :string
|
95
|
+
method_option :jobs, :type => :string
|
96
|
+
method_option :retry, :type => :string
|
97
|
+
method_option :no_cache, :type => :boolean
|
98
|
+
method_option :quiet, :type => :boolean
|
79
99
|
def install
|
80
100
|
require 'jbundler'
|
81
101
|
if options[ :no_deployment ]
|
data/lib/jbundler/config.rb
CHANGED
@@ -102,24 +102,32 @@ module JBundler
|
|
102
102
|
|
103
103
|
def proxy
|
104
104
|
@proxy ||= jbundler_env('JBUNDLE_PROXY')
|
105
|
+
if @proxy
|
106
|
+
warn 'proxy config is deprecated, use settings.xml instead'
|
107
|
+
end
|
108
|
+
@proxy
|
105
109
|
end
|
106
110
|
|
107
111
|
def mirror
|
108
112
|
@mirror ||= jbundler_env('JBUNDLE_MIRROR')
|
109
113
|
# nice to have no leading slash
|
110
114
|
@mirror = @mirror.sub( /\/$/, '' ) if @mirror
|
115
|
+
if @mirror
|
116
|
+
warn 'mirror config is deprecated, use settings.xml instead'
|
117
|
+
end
|
111
118
|
@mirror
|
112
119
|
end
|
113
120
|
|
114
121
|
def rubygems_mirror
|
115
122
|
@rubygems_mirror ||= jbundler_env('BUNDLE_RUBYGEMS_MIRROR')
|
116
123
|
# here a leading slash is needed !!
|
117
|
-
|
124
|
+
@rubygems_mirror = @rubygems_mirror.sub( /([^\/])$/ , "\\1/" ) if @rubygems_mirror
|
125
|
+
warn 'reubygems mirror config is deprecated, use bundler >=1.5 and its mirror config'
|
118
126
|
@rubygems_mirror
|
119
127
|
end
|
120
128
|
|
121
129
|
def work_dir
|
122
|
-
@work_dir ||= jbundler_env('JBUNDLE_WORK_DIR') || '
|
130
|
+
@work_dir ||= jbundler_env('JBUNDLE_WORK_DIR') || 'pkg'
|
123
131
|
end
|
124
132
|
|
125
133
|
def vendor_dir
|
data/lib/jbundler/executable.rb
CHANGED
@@ -31,11 +31,10 @@ module JBundler
|
|
31
31
|
m.verbose = @config.verbose
|
32
32
|
m.package( '-P', @config.compile ? :compile : :no_compile )
|
33
33
|
|
34
|
-
#FileUtils.rm_f( 'dependency-reduced-pom.xml' )
|
35
34
|
puts
|
36
35
|
puts 'now you can execute your jar like this'
|
37
36
|
puts
|
38
|
-
puts "\tjava -jar #{
|
37
|
+
puts "\tjava -jar #{File.basename( File.expand_path( '.' ) )}_exec.jar"
|
39
38
|
puts
|
40
39
|
end
|
41
40
|
end
|
@@ -26,7 +26,7 @@ end
|
|
26
26
|
jfile.locked.each do |dep|
|
27
27
|
artifact( dep )
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
build.directory = jworkdir
|
31
31
|
resource do
|
32
32
|
directory jworkdir
|
@@ -49,6 +49,7 @@ Gem.loaded_specs.values.each do |s|
|
|
49
49
|
end
|
50
50
|
|
51
51
|
properties( 'maven.test.skip' => true,
|
52
|
+
'tesla.dump.pom' => 'pom.xml',
|
52
53
|
'project.build.sourceEncoding' => 'utf-8' )
|
53
54
|
|
54
55
|
jfile.populate_unlocked do |dsl|
|
@@ -104,6 +105,7 @@ profile :no_compile do
|
|
104
105
|
end
|
105
106
|
|
106
107
|
plugin( :shade, '2.1',
|
108
|
+
:outputFile => "${user.dir}/#{File.basename( File.expand_path( '.' ) )}_exec.jar",
|
107
109
|
:transformers => [ { '@implementation' => 'org.apache.maven.plugins.shade.resource.ManifestResourceTransformer',
|
108
110
|
:mainClass => 'org.jruby.JarBootstrapMain' } ] ) do
|
109
111
|
execute_goals( 'shade', :phase => 'package' )
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require 'jbundler/configurator'
|
2
|
+
require 'jbundler/classpath_file'
|
3
|
+
require 'jbundler/vendor'
|
4
|
+
require 'jbundler/gemfile_lock'
|
5
|
+
require 'jbundler/show'
|
6
|
+
require 'maven/tools/jarfile'
|
7
|
+
require 'maven/ruby/maven'
|
8
|
+
require 'fileutils'
|
9
|
+
module JBundler
|
10
|
+
class LockDown
|
11
|
+
|
12
|
+
def initialize( config )
|
13
|
+
@config = config
|
14
|
+
@configurator = Configurator.new( config )
|
15
|
+
end
|
16
|
+
|
17
|
+
def lock_down( needs_vendor = false, debug = false )
|
18
|
+
jarfile = Maven::Tools::Jarfile.new( @config.jarfile )
|
19
|
+
vendor = JBundler::Vendor.new( @config.vendor_dir )
|
20
|
+
classpath_file = JBundler::ClasspathFile.new( @config.classpath_file )
|
21
|
+
gemfile_lock = JBundler::GemfileLock.new( jarfile,
|
22
|
+
@config.gemfile_lock )
|
23
|
+
|
24
|
+
needs_update = classpath_file.needs_update?( jarfile, gemfile_lock )
|
25
|
+
if( ( ! needs_update ||
|
26
|
+
vendor.vendored? ) && ! vendor )
|
27
|
+
|
28
|
+
puts 'up to date'
|
29
|
+
|
30
|
+
else
|
31
|
+
|
32
|
+
puts '...'
|
33
|
+
|
34
|
+
exec_maven( debug )
|
35
|
+
|
36
|
+
deps_file = File.join( File.expand_path( @config.work_dir ),
|
37
|
+
'dependencies.txt' )
|
38
|
+
deps = StringIO.new
|
39
|
+
jars = {}
|
40
|
+
vendor_map = {}
|
41
|
+
File.read( deps_file ).each_line do |line|
|
42
|
+
if line.match /:jar:/
|
43
|
+
jar = line.sub( /.+:/, '' ).sub( /\s$/, '' )
|
44
|
+
unless line.match /:provided/
|
45
|
+
vendor_map[ line.sub( /:[^:]+:[^:]+$/, '' )
|
46
|
+
.sub( /^\s+/, '' ) ] = jar
|
47
|
+
end
|
48
|
+
case line
|
49
|
+
when /:provided:/
|
50
|
+
( jars[ :jruby ] ||= [] ) << jar
|
51
|
+
when /:test:/
|
52
|
+
( jars[ :test ] ||= [] ) << jar
|
53
|
+
else
|
54
|
+
( jars[ :runtime ] ||= [] ) << jar
|
55
|
+
end
|
56
|
+
end
|
57
|
+
# TODO make lock depend on jruby version as well on
|
58
|
+
# include test as well, i.e. keep the scope in place
|
59
|
+
if( line.match( /:compile:|:runtime:/ ) &&
|
60
|
+
! line.match( /^ruby.bundler:/ ) )
|
61
|
+
deps.puts line.sub( /:[^:]+:[^:]+$/, '' ).sub( /^\s+/, '' )
|
62
|
+
end
|
63
|
+
end
|
64
|
+
if needs_update
|
65
|
+
if deps.string.empty?
|
66
|
+
FileUtils.rm_f @config.jarfile_lock
|
67
|
+
else
|
68
|
+
File.open( @config.jarfile_lock, 'w' ) do |f|
|
69
|
+
f.print deps.string
|
70
|
+
end
|
71
|
+
end
|
72
|
+
classpath_file.generate( jars[ :runtime ],
|
73
|
+
jars[ :test ],
|
74
|
+
jars[ :jruby ] )
|
75
|
+
end
|
76
|
+
if needs_vendor
|
77
|
+
puts "vendor directory: #{@config.vendor_dir}"
|
78
|
+
vendor_map.each do |key, file|
|
79
|
+
vendor.copy_jar( key, file )
|
80
|
+
end
|
81
|
+
puts
|
82
|
+
end
|
83
|
+
if @config.verbose
|
84
|
+
Show.new( @config ).show_classpath
|
85
|
+
puts
|
86
|
+
end
|
87
|
+
puts 'jbundle complete'
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
private
|
92
|
+
|
93
|
+
def exec_maven( debug )
|
94
|
+
m = Maven::Ruby::Maven.new
|
95
|
+
m.options[ '-f' ] = File.join( File.dirname( __FILE__ ),
|
96
|
+
'lock_down_pom.rb' )
|
97
|
+
m.options[ '-q' ] = nil unless debug
|
98
|
+
m.verbose = debug
|
99
|
+
|
100
|
+
@configurator.configure( m )
|
101
|
+
|
102
|
+
m.exec
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
jfile = java.lang.System.getProperty( "jbundler.jarfile" )
|
2
|
+
gfile = java.lang.System.getProperty( "jbundler.gemfile" )
|
3
|
+
jworkdir = java.lang.System.getProperty( "jbundler.workdir" )
|
4
|
+
|
5
|
+
basedir( File.dirname( jfile ) )
|
6
|
+
|
7
|
+
gemfile( gfile ) if File.exists? gfile
|
8
|
+
|
9
|
+
jarfile( jfile )
|
10
|
+
|
11
|
+
build do
|
12
|
+
directory = jworkdir
|
13
|
+
default_goal 'dependency:list'
|
14
|
+
end
|
15
|
+
|
16
|
+
plugin( :dependency, '2.8',
|
17
|
+
:includeTypes => 'jar',
|
18
|
+
:outputAbsoluteArtifactFilename => true,
|
19
|
+
:outputFile => "#{jworkdir}/dependencies.txt" )
|
20
|
+
|
21
|
+
properties( 'project.build.sourceEncoding' => 'utf-8',
|
22
|
+
'tesla.dump.readOnly' => true,
|
23
|
+
'tesla.dump.pom' => 'lockdown.pom.xml' )
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'jbundler/configurator'
|
2
|
+
require 'jbundler/classpath_file'
|
3
|
+
require 'jbundler/vendor'
|
4
|
+
require 'jbundler/gemfile_lock'
|
5
|
+
require 'maven/tools/jarfile'
|
6
|
+
require 'maven/ruby/maven'
|
7
|
+
require 'fileutils'
|
8
|
+
module JBundler
|
9
|
+
class Show
|
10
|
+
|
11
|
+
def initialize( config )
|
12
|
+
@config = config
|
13
|
+
@classpath_file = JBundler::ClasspathFile.new( @config.classpath_file )
|
14
|
+
end
|
15
|
+
|
16
|
+
def do_it( debug = false )
|
17
|
+
jarfile = Maven::Tools::Jarfile.new( @config.jarfile )
|
18
|
+
vendor = JBundler::Vendor.new( @config.vendor_dir )
|
19
|
+
gemfile_lock = JBundler::GemfileLock.new( jarfile,
|
20
|
+
@config.gemfile_lock )
|
21
|
+
end
|
22
|
+
|
23
|
+
def show_classpath
|
24
|
+
@classpath_file.require_classpath
|
25
|
+
warn "jruby core classpath:"
|
26
|
+
JBUNDLER_JRUBY_CLASSPATH.each do |path|
|
27
|
+
warn "\t#{path}"
|
28
|
+
end
|
29
|
+
warn "jbundler runtime classpath:"
|
30
|
+
JBUNDLER_CLASSPATH.each do |path|
|
31
|
+
warn "\t#{path}"
|
32
|
+
end
|
33
|
+
warn "jbundler test classpath:"
|
34
|
+
if JBUNDLER_TEST_CLASSPATH.empty?
|
35
|
+
warn "\t--- empty ---"
|
36
|
+
else
|
37
|
+
JBUNDLER_TEST_CLASSPATH.each do |path|
|
38
|
+
warn "\t#{path}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/jbundler/tree.rb
CHANGED
@@ -1,14 +1,9 @@
|
|
1
1
|
require 'jbundler/configurator'
|
2
|
-
require 'maven/tools/jarfile'
|
3
|
-
require 'maven/tools/dsl'
|
4
|
-
require 'maven/tools/model'
|
5
2
|
require 'maven/ruby/maven'
|
6
3
|
require 'fileutils'
|
7
4
|
module JBundler
|
8
5
|
class Tree
|
9
6
|
|
10
|
-
include Maven::Tools::DSL
|
11
|
-
|
12
7
|
def initialize( config )
|
13
8
|
@config = Configurator.new( config )
|
14
9
|
end
|
@@ -16,21 +11,17 @@ module JBundler
|
|
16
11
|
def show_it( debug = false )
|
17
12
|
m = Maven::Ruby::Maven.new
|
18
13
|
m.options[ '-f' ] = File.join( File.dirname( __FILE__ ), 'tree_pom.rb' )
|
14
|
+
m.options[ '-q' ] = nil unless debug
|
15
|
+
m.verbose = debug
|
16
|
+
|
19
17
|
@config.configure( m )
|
20
18
|
|
21
|
-
|
22
|
-
# silence the output
|
23
|
-
old = java.lang.System.err
|
24
|
-
java.lang.System.err = java.io.PrintStream.new( java.io.ByteArrayOutputStream.new )
|
25
|
-
end
|
19
|
+
puts '...'
|
26
20
|
|
27
21
|
m.exec( 'org.apache.maven.plugins:maven-dependency-plugin:2.8:tree' )
|
28
22
|
|
29
23
|
puts File.read( File.join( File.expand_path( @config.work_dir ),
|
30
24
|
'tree.txt' ) )
|
31
|
-
|
32
|
-
ensure
|
33
|
-
java.lang.System.err = old if old
|
34
25
|
end
|
35
26
|
end
|
36
27
|
end
|
data/lib/jbundler/tree_pom.rb
CHANGED
data/lib/jbundler/vendor.rb
CHANGED
@@ -10,7 +10,7 @@ module JBundler
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def require_jars
|
13
|
-
Dir[ File.join( @dir, '*' ) ].each do |f|
|
13
|
+
Dir[ File.join( @dir, '**', '*' ) ].each do |f|
|
14
14
|
require f
|
15
15
|
end
|
16
16
|
end
|
@@ -18,7 +18,7 @@ module JBundler
|
|
18
18
|
def clear
|
19
19
|
FileUtils.mkdir_p( @dir )
|
20
20
|
Dir[ File.join( @dir, '*' ) ].each do |f|
|
21
|
-
FileUtils.
|
21
|
+
FileUtils.rm_rf( f )
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -31,6 +31,13 @@ module JBundler
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
def copy_jar( coord, file )
|
35
|
+
target = File.join( *coord.sub( /:jar:/, '-') .split( /:/ ) )
|
36
|
+
target_file = File.join( @dir, target ) + '.jar'
|
37
|
+
FileUtils.mkdir_p( File.dirname( target_file ) )
|
38
|
+
FileUtils.cp( file, target_file )
|
39
|
+
puts "\t#{coord} to #{target}"
|
40
|
+
end
|
34
41
|
end
|
35
42
|
end
|
36
43
|
|
data/spec/classpath_file_spec.rb
CHANGED
@@ -77,6 +77,10 @@ describe JBundler::ClasspathFile do
|
|
77
77
|
it 'generates a classpath ruby file' do
|
78
78
|
subject.generate("a:b:c:d:f:".split(File::PATH_SEPARATOR))
|
79
79
|
File.read(cpfile).must_equal <<-EOF
|
80
|
+
JBUNDLER_JRUBY_CLASSPATH = []
|
81
|
+
JBUNDLER_JRUBY_CLASSPATH.freeze
|
82
|
+
JBUNDLER_TEST_CLASSPATH = []
|
83
|
+
JBUNDLER_TEST_CLASSPATH.freeze
|
80
84
|
JBUNDLER_CLASSPATH = []
|
81
85
|
JBUNDLER_CLASSPATH << 'a'
|
82
86
|
JBUNDLER_CLASSPATH << 'b'
|
data/spec/config_spec.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jbundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Christian Meier
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: ruby-maven
|
@@ -21,7 +20,6 @@ dependencies:
|
|
21
20
|
- - <
|
22
21
|
- !ruby/object:Gem::Version
|
23
22
|
version: 3.1.2
|
24
|
-
none: false
|
25
23
|
requirement: !ruby/object:Gem::Requirement
|
26
24
|
requirements:
|
27
25
|
- - '>='
|
@@ -30,7 +28,6 @@ dependencies:
|
|
30
28
|
- - <
|
31
29
|
- !ruby/object:Gem::Version
|
32
30
|
version: 3.1.2
|
33
|
-
none: false
|
34
31
|
prerelease: false
|
35
32
|
type: :runtime
|
36
33
|
- !ruby/object:Gem::Dependency
|
@@ -39,14 +36,12 @@ dependencies:
|
|
39
36
|
requirements:
|
40
37
|
- - ~>
|
41
38
|
- !ruby/object:Gem::Version
|
42
|
-
version: '1.
|
43
|
-
none: false
|
39
|
+
version: '1.5'
|
44
40
|
requirement: !ruby/object:Gem::Requirement
|
45
41
|
requirements:
|
46
42
|
- - ~>
|
47
43
|
- !ruby/object:Gem::Version
|
48
|
-
version: '1.
|
49
|
-
none: false
|
44
|
+
version: '1.5'
|
50
45
|
prerelease: false
|
51
46
|
type: :runtime
|
52
47
|
- !ruby/object:Gem::Dependency
|
@@ -56,35 +51,25 @@ dependencies:
|
|
56
51
|
- - ~>
|
57
52
|
- !ruby/object:Gem::Version
|
58
53
|
version: '10.0'
|
59
|
-
none: false
|
60
54
|
requirement: !ruby/object:Gem::Requirement
|
61
55
|
requirements:
|
62
56
|
- - ~>
|
63
57
|
- !ruby/object:Gem::Version
|
64
58
|
version: '10.0'
|
65
|
-
none: false
|
66
59
|
prerelease: false
|
67
60
|
type: :development
|
68
61
|
- !ruby/object:Gem::Dependency
|
69
62
|
name: thor
|
70
63
|
version_requirements: !ruby/object:Gem::Requirement
|
71
64
|
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 0.16.0
|
75
|
-
- - '>'
|
65
|
+
- - ~>
|
76
66
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
78
|
-
none: false
|
67
|
+
version: 0.18.0
|
79
68
|
requirement: !ruby/object:Gem::Requirement
|
80
69
|
requirements:
|
81
|
-
- -
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: 0.16.0
|
84
|
-
- - '>'
|
70
|
+
- - ~>
|
85
71
|
- !ruby/object:Gem::Version
|
86
|
-
version: 0.
|
87
|
-
none: false
|
72
|
+
version: 0.18.0
|
88
73
|
prerelease: false
|
89
74
|
type: :development
|
90
75
|
- !ruby/object:Gem::Dependency
|
@@ -94,13 +79,11 @@ dependencies:
|
|
94
79
|
- - ~>
|
95
80
|
- !ruby/object:Gem::Version
|
96
81
|
version: '4.0'
|
97
|
-
none: false
|
98
82
|
requirement: !ruby/object:Gem::Requirement
|
99
83
|
requirements:
|
100
84
|
- - ~>
|
101
85
|
- !ruby/object:Gem::Version
|
102
86
|
version: '4.0'
|
103
|
-
none: false
|
104
87
|
prerelease: false
|
105
88
|
type: :development
|
106
89
|
description: |
|
@@ -118,8 +101,10 @@ files:
|
|
118
101
|
- lib/jbundler/classpath_file.rb
|
119
102
|
- lib/jbundler/tree_pom.rb
|
120
103
|
- lib/jbundler/tree.rb
|
104
|
+
- lib/jbundler/lock_down_pom.rb
|
121
105
|
- lib/jbundler/gemfile_lock.rb
|
122
106
|
- lib/jbundler/executable_pom.rb
|
107
|
+
- lib/jbundler/lock_down.rb
|
123
108
|
- lib/jbundler/configurator.rb
|
124
109
|
- lib/jbundler/cli.rb
|
125
110
|
- lib/jbundler/config.rb
|
@@ -127,6 +112,7 @@ files:
|
|
127
112
|
- lib/jbundler/lazy.rb
|
128
113
|
- lib/jbundler/executable.rb
|
129
114
|
- lib/jbundler/vendor.rb
|
115
|
+
- lib/jbundler/show.rb
|
130
116
|
- lib/jbundler.jar
|
131
117
|
- spec/config_spec.rb
|
132
118
|
- spec/vendor_spec.rb
|
@@ -142,6 +128,7 @@ files:
|
|
142
128
|
homepage: https://github.com/mkristian/jbundler
|
143
129
|
licenses:
|
144
130
|
- MIT
|
131
|
+
metadata: {}
|
145
132
|
post_install_message:
|
146
133
|
rdoc_options: []
|
147
134
|
require_paths:
|
@@ -151,18 +138,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
138
|
- - '>='
|
152
139
|
- !ruby/object:Gem::Version
|
153
140
|
version: '0'
|
154
|
-
none: false
|
155
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
142
|
requirements:
|
157
143
|
- - '>='
|
158
144
|
- !ruby/object:Gem::Version
|
159
145
|
version: '0'
|
160
|
-
none: false
|
161
146
|
requirements: []
|
162
147
|
rubyforge_project:
|
163
|
-
rubygems_version: 1.
|
148
|
+
rubygems_version: 2.1.9
|
164
149
|
signing_key:
|
165
|
-
specification_version:
|
150
|
+
specification_version: 4
|
166
151
|
summary: managing jar dependencies
|
167
152
|
test_files:
|
168
153
|
- spec/config_spec.rb
|