jbundler 0.5.5 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84995673fbb7c47e7f3ad1b2b8c6973dc97feb43
4
- data.tar.gz: 002ded9ef8e351737ac6e0202beec5fab700f643
3
+ metadata.gz: f22bab089dc37576e6c78f1f5eef96ac2f1182e3
4
+ data.tar.gz: 8a3075075fd3eeae9c043c690d756db1200ce068
5
5
  SHA512:
6
- metadata.gz: 63904f8bb1cc95824bbe7d57deeedc7edb510ec17dd0a2aea2cdf7877945565a41733d446f5557ecdff71e518b9894bac1d19f650cdd070c2d4e23079c7b33ee
7
- data.tar.gz: e3e4d92cd282bace89e3ea1f29a6d9d63809b087cd1b91532c855c57d990ad2ba93328423e02c00915370750c21856557882c4cb2377eda7b1bff9464e369da9
6
+ metadata.gz: 4c48cd7ff3eef42dfeab093e8c026848a7e344537d845c2bce981749c05253e14bbc81e9572ae003b3da8fd57f8d9d5a2d46492c251911f6208b48c09a3d6d8e
7
+ data.tar.gz: 9417e8203b945b66f06d0a451f1496059acb5b6ae8b7aaa5721bea9c0ac60bf86ba8ffa1efc28ddb2534ca9acdb9ee27d721fc636827095e87db0e4c747b22b0
data/Gemfile.lock CHANGED
@@ -1,36 +1,47 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jbundler (0.5.5)
4
+ jbundler (0.6.0)
5
5
  bundler (~> 1.5)
6
- ruby-maven (>= 3.1.1.0.1, < 3.1.2)
6
+ jar-dependencies (~> 0.0.4)
7
+ ruby-maven (>= 3.1.1.0.3, < 3.1.2)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- backports (3.4.0)
12
- copyright-header (1.0.8)
13
- descendants_tracker (0.0.3)
14
- maven-tools (0.34.2)
15
- virtus (~> 0.5)
16
- minitest (4.7.5)
17
- rake (10.1.0)
18
- ruby-maven (3.1.1.0.2)
19
- maven-tools (~> 0.33)
12
+ axiom-types (0.1.1)
13
+ descendants_tracker (~> 0.0.4)
14
+ ice_nine (~> 0.11.0)
15
+ thread_safe (~> 0.3, >= 0.3.1)
16
+ coercible (1.0.0)
17
+ descendants_tracker (~> 0.0.1)
18
+ descendants_tracker (0.0.4)
19
+ thread_safe (~> 0.3, >= 0.3.1)
20
+ equalizer (0.0.9)
21
+ ice_nine (0.11.0)
22
+ jar-dependencies (0.0.4)
23
+ maven-tools (1.0.0.rc6)
24
+ virtus (~> 1.0)
25
+ minitest (5.3.3)
26
+ rake (10.3.1)
27
+ ruby-maven (3.1.1.0.5)
28
+ maven-tools (~> 1.0.0.rc4)
20
29
  ruby-maven-libs (= 3.1.1)
21
30
  ruby-maven-libs (3.1.1)
22
31
  thor (0.18.1)
23
- virtus (0.5.5)
24
- backports (~> 3.3)
25
- descendants_tracker (~> 0.0.1)
32
+ thread_safe (0.3.4-java)
33
+ virtus (1.0.2)
34
+ axiom-types (~> 0.1)
35
+ coercible (~> 1.0)
36
+ descendants_tracker (~> 0.0.3)
37
+ equalizer (~> 0.0.9)
26
38
 
27
39
  PLATFORMS
28
40
  java
29
- ruby
30
41
 
31
42
  DEPENDENCIES
32
43
  copyright-header (= 1.0.8)
33
44
  jbundler!
34
- minitest (~> 4.0)
45
+ minitest (~> 5.3)
35
46
  rake (~> 10.0)
36
47
  thor (~> 0.18.0)
data/Gemfile.lock~ CHANGED
@@ -1,33 +1,47 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jbundler (0.5.0)
5
- bundler (~> 1.2)
6
- ruby-maven (~> 3.1.0.0)
4
+ jbundler (0.6.0)
5
+ bundler (~> 1.5)
6
+ jar-dependencies (~> 0.0.3)
7
+ ruby-maven (>= 3.1.1.0.3, < 3.1.2)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- backports (3.3.3)
12
- descendants_tracker (0.0.1)
13
- maven-tools (0.33.1)
14
- virtus (~> 0.5)
15
- minitest (4.7.5)
16
- rake (10.1.0)
17
- ruby-maven (3.1.0.0.1)
18
- maven-tools (~> 0.33)
19
- ruby-maven-libs (= 3.1.0)
20
- ruby-maven-libs (3.1.0)
21
- thor (0.15.4)
22
- virtus (0.5.5)
23
- backports (~> 3.3)
12
+ axiom-types (0.1.1)
13
+ descendants_tracker (~> 0.0.4)
14
+ ice_nine (~> 0.11.0)
15
+ thread_safe (~> 0.3, >= 0.3.1)
16
+ coercible (1.0.0)
24
17
  descendants_tracker (~> 0.0.1)
18
+ descendants_tracker (0.0.4)
19
+ thread_safe (~> 0.3, >= 0.3.1)
20
+ equalizer (0.0.9)
21
+ ice_nine (0.11.0)
22
+ jar-dependencies (0.0.3)
23
+ maven-tools (1.0.0.rc4)
24
+ virtus (~> 1.0)
25
+ minitest (5.3.3)
26
+ rake (10.3.1)
27
+ ruby-maven (3.1.1.0.3)
28
+ maven-tools (~> 1.0.0.rc4)
29
+ ruby-maven-libs (= 3.1.1)
30
+ ruby-maven-libs (3.1.1)
31
+ thor (0.18.1)
32
+ thread_safe (0.3.3-java)
33
+ virtus (1.0.2)
34
+ axiom-types (~> 0.1)
35
+ coercible (~> 1.0)
36
+ descendants_tracker (~> 0.0.3)
37
+ equalizer (~> 0.0.9)
25
38
 
26
39
  PLATFORMS
27
40
  java
28
41
 
29
42
  DEPENDENCIES
43
+ copyright-header (= 1.0.8)
30
44
  jbundler!
31
- minitest (~> 4.0)
45
+ minitest (~> 5.3)
32
46
  rake (~> 10.0)
33
- thor (> 0.14.0, < 0.16.0)
47
+ thor (~> 0.18.0)
data/bin/jbundle CHANGED
@@ -11,10 +11,13 @@ if ARGV[0] == 'help'
11
11
 
12
12
  else
13
13
 
14
- ARGV << 'install' if ARGV.size == 0
14
+ if ARGV == [] || ARGV.all?{ |a| a.match( /^-/ ) }
15
+ ARGV.unshift 'install'
16
+ end
15
17
 
16
18
  if ARGV[0] == 'console'
17
19
  require 'irb'
20
+ require 'jbundler'
18
21
  require 'jbundler/lazy'
19
22
  include JBundler::Lazy
20
23
  end
@@ -22,37 +25,24 @@ else
22
25
  require 'jbundler/config'
23
26
  config = JBundler::Config.new
24
27
 
25
- if ['install', 'update', 'show', 'console'].member?( ARGV[0] )
28
+ if ['lock_down', 'install', 'update', 'show', 'console'].member?( ARGV[0] )
26
29
  begin
27
- file = File.join( ENV['HOME'], '.bundle', 'config' )
28
- if File.exists?( file )
29
- require 'yaml'
30
- bundle_config = YAML.load_file( file )
31
- mirrors = bundle_config.select { |k,v| nil != (k =~ /BUNDLE_MIRROR__/) }
32
- if config.rubygems_mirror || mirrors.size > 0
33
- mirrors.each do |k,v|
34
- ENV[ k ] = v
35
- end
36
- if config.rubygems_mirror
37
- ENV['BUNDLE_MIRROR__HTTP://RUBYGEMS.ORG'] = config.rubygems_mirror
38
- ENV['BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG'] = config.rubygems_mirror
39
- end
40
-
41
- begin
42
- load Gem.bin_path('nexus', 'nbundle')
43
- rescue Gem::GemNotFoundException
44
- warn ''
45
- warn 'to use a rubygems mirror you need to install the nexus gem'
46
- warn ' $ gem install nexus'
47
- warn ''
48
- warn 'rubygems mirror ignored !'
49
- end
50
- else
51
- load Gem.bin_path('bundler', 'bundle')
52
- end
53
- else
54
- load Gem.bin_path('bundler', 'bundle')
55
- end
30
+ is_lock_down = ARGV.delete( 'lock_down' )
31
+ ARGV.delete( 0 ) if is_lock_down
32
+ is_vendor = ARGV.delete( '--vendor' )
33
+ is_debug = ARGV.delete( '--debug' )
34
+ is_verbose = ARGV.delete( '--verbose' )
35
+ ARGV.delete( '--skip-vendor' )
36
+ ARGV.delete( '--skip-debug' )
37
+ ARGV.delete( '--skip-verbose' )
38
+
39
+ load Gem.bin_path('bundler', 'bundle')
40
+
41
+ ARGV.insert( 0, 'lock_down' ) if is_lock_down
42
+ ARGV.insert( 1, '--debug' ) if is_debug
43
+ ARGV.insert( 1, '--vendor' ) if is_vendor
44
+ ARGV.insert( 1, '--verbose' ) if is_verbose
45
+
56
46
  require 'jbundler/cli'
57
47
  JBundler::Cli.start
58
48
  rescue Exception => e
data/lib/jbundler.jar CHANGED
Binary file
data/lib/jbundler.rb CHANGED
@@ -18,62 +18,70 @@
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/tools/jarfile'
22
- require 'jbundler/classpath_file'
23
- require 'jbundler/vendor'
24
- require 'jbundler/gemfile_lock'
25
- require 'jbundler/aether'
21
+
22
+ require 'jbundler/context'
26
23
 
27
24
  module JBundler
28
25
 
29
- def setup_test
30
- config = JBundler::Config.new
31
- JBundler::ClasspathFile.new(config.classpath_file).require_test_classpath
32
- config
26
+ def self.context
27
+ @context ||= JBundler::Context.new
33
28
  end
34
29
 
35
- end
36
-
37
- config = JBundler::Config.new
38
-
39
- jarfile = Maven::Tools::Jarfile.new(config.jarfile)
40
- if config.skip
41
- warn "skip jbundler setup"
42
- else
43
- vendor = JBundler::Vendor.new(config.vendor_dir)
44
- classpath_file = JBundler::ClasspathFile.new(config.classpath_file)
45
- gemfile_lock = JBundler::GemfileLock.new(jarfile, config.gemfile_lock)
30
+ def self.setup_test
31
+ context.classpath.require_test_classpath
32
+ context.config
33
+ end
46
34
 
47
- if classpath_file.needs_update?(jarfile, gemfile_lock) && ! vendor.vendored?
48
- aether = JBundler::AetherRuby.new(config)
49
-
50
- jarfile.populate_unlocked(aether)
51
- gemfile_lock.populate_dependencies(aether)
52
- jarfile.populate_locked(aether)
53
-
54
- aether.resolve
55
-
56
- classpath_file.generate(aether.classpath_array)
57
- jarfile.generate_lockfile(aether.resolved_coordinates)
35
+ def self.update
36
+ if( context.classpath.needs_update?( context.jarfile,
37
+ context.gemfile_lock ) and
38
+ not context.vendor.vendored? )
39
+
40
+ warn 'deprecated - use jbundle install to update bundle'
41
+ aether = JBundler::AetherRuby.new( context.config )
42
+
43
+ context.jarfile.populate_unlocked( aether )
44
+ context.gemfile_lock.populate_dependencies( aether )
45
+ context.jarfile.populate_locked( aether )
46
+
47
+ aether.resolve
48
+
49
+ context.classpath.generate( aether.classpath_array, [], [],
50
+ context.config.local_repository )
51
+ context.jarfile.generate_lockfile( aether.resolved_coordinates )
52
+ end
58
53
  end
59
54
 
60
- if vendor.vendored?
61
- jars = vendor.require_jars
62
- if config.verbose
63
- warn "jbundler classpath:"
64
- jars.each do |path|
65
- warn "\t#{path}"
55
+ def self.require_jars
56
+ if context.vendor.vendored?
57
+ jars = context.vendor.require_jars
58
+ if context.config.verbose
59
+ warn "jbundler classpath:"
60
+ jars.each do |path|
61
+ warn "\t#{path}"
62
+ end
66
63
  end
67
- end
68
- elsif classpath_file.exists? && jarfile.exists_lock?
69
- require 'java'
70
- classpath_file.require_classpath
71
- if config.verbose
72
- warn "jbundler classpath:"
73
- JBUNDLER_CLASSPATH.each do |path|
74
- warn "\t#{path}"
64
+ elsif context.classpath.exists? && context.jarfile.exists_lock?
65
+ require 'java'
66
+ context.classpath_file.require_classpath
67
+ if context.config.verbose
68
+ warn "jbundler classpath:"
69
+ JBUNDLER_CLASSPATH.each do |path|
70
+ warn "\t#{path}"
71
+ end
75
72
  end
73
+ Jars.freeze_loading
74
+ end
75
+ end
76
+
77
+ def self.setup
78
+ if context.config.skip
79
+ warn "skip jbundler setup" if context.config.verbose
80
+ else
81
+ update
82
+ require_jars
76
83
  end
77
84
  end
78
-
79
85
  end
86
+
87
+ JBundler.setup
@@ -20,7 +20,7 @@
20
20
  #
21
21
  require 'yaml'
22
22
  require 'jbundler/config'
23
- require 'maven'
23
+ require 'maven/ruby'
24
24
 
25
25
  module JBundler
26
26
 
@@ -26,13 +26,17 @@ module JBundler
26
26
  @classpathfile = classpathfile
27
27
  end
28
28
 
29
- def require_classpath
29
+ def load_classpath
30
30
  load File.expand_path @classpathfile
31
+ end
32
+
33
+ def require_classpath
34
+ load_classpath
31
35
  JBUNDLER_CLASSPATH.each { |c| require c }
32
36
  end
33
37
 
34
38
  def require_test_classpath
35
- load File.expand_path @classpathfile unless defined? JBUNLDER_TEST_CLASSPATH
39
+ load_classpath
36
40
  JBUNDLER_TEST_CLASSPATH.each { |c| require c }
37
41
  end
38
42
 
@@ -44,26 +48,51 @@ module JBundler
44
48
  File.exists?(@classpathfile)
45
49
  end
46
50
 
51
+ def missing?( jarfile )
52
+ !exists? || !jarfile.exists_lock?
53
+ end
54
+
55
+ def jarfile_newer?( jarfile )
56
+ jarfile.exists? && (jarfile.mtime > mtime)
57
+ end
58
+
59
+ def jarlock_newer?( jarfile )
60
+ jarfile.exists_lock? && (jarfile.mtime_lock > mtime)
61
+ end
62
+
47
63
  def needs_update?(jarfile, gemfile_lock)
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)))
64
+ if jarfile.exists? || gemfile_lock.exists? || jarfile.exists_lock?
65
+ missing?( jarfile ) || jarfile_newer?( jarfile ) || jarlock_newer?( jarfile ) || gemfile_lock.newer?( mtime )
66
+ else
67
+ false
68
+ end
49
69
  end
50
70
 
51
- def generate( classpath_array, test_array = [], jruby_array = [] )
71
+ def generate( classpath_array, test_array = [], jruby_array = [], local_repo = nil )
52
72
  FileUtils.mkdir_p(File.dirname(@classpathfile))
53
73
  File.open(@classpathfile, 'w') do |f|
54
- dump_array( f, jruby_array || [], 'JRUBY_' )
55
- dump_array( f, test_array || [], 'TEST_' )
56
- dump_array( f, classpath_array || [], '' )
57
- f.puts "JBUNDLER_CLASSPATH.each { |c| require c }"
74
+ if local_repo
75
+ local_repo = File.expand_path( local_repo )
76
+ f.puts "require 'jar_dependencies'"
77
+ f.puts "JBUNDLER_LOCAL_REPO = Jars.home"
78
+ end
79
+ dump_array( f, jruby_array || [], 'JRUBY_', local_repo )
80
+ dump_array( f, test_array || [], 'TEST_', local_repo )
81
+ dump_array( f, classpath_array || [], '', local_repo )
58
82
  f.close
59
83
  end
60
84
  end
61
85
 
62
86
  private
63
- def dump_array( file, array, prefix )
87
+ def dump_array( file, array, prefix, local_repo )
64
88
  file.puts "JBUNDLER_#{prefix}CLASSPATH = []"
65
89
  array.each do |path|
66
- file.puts "JBUNDLER_#{prefix}CLASSPATH << '#{path}'" unless path =~ /pom$/
90
+ if local_repo
91
+ path.sub!( /#{local_repo}/, '' )
92
+ file.puts "JBUNDLER_#{prefix}CLASSPATH << (JBUNDLER_LOCAL_REPO + '#{path}')" unless path =~ /pom$/
93
+ else
94
+ file.puts "JBUNDLER_#{prefix}CLASSPATH << '#{path}'" unless path =~ /pom$/
95
+ end
67
96
  end
68
97
  file.puts "JBUNDLER_#{prefix}CLASSPATH.freeze"
69
98
  end
data/lib/jbundler/cli.rb CHANGED
@@ -23,6 +23,7 @@ require 'jbundler/config'
23
23
  require 'jbundler/executable'
24
24
  require 'jbundler/tree'
25
25
  require 'jbundler/lock_down'
26
+ require 'jbundler/jruby_complete'
26
27
  module JBundler
27
28
  class Cli < Thor
28
29
  no_tasks do
@@ -30,27 +31,38 @@ module JBundler
30
31
  @config ||= JBundler::Config.new
31
32
  end
32
33
 
33
- def do_show
34
- require 'java'
35
- require 'jbundler/classpath_file'
36
- require 'jbundler/vendor'
37
- classpath_file = JBundler::ClasspathFile.new( config.classpath_file )
34
+ def unvendor
35
+ vendor = JBundler::Vendor.new( config.vendor_dir )
36
+ vendor.clear
37
+ end
38
+
39
+ def vendor
38
40
  vendor = JBundler::Vendor.new( config.vendor_dir )
39
41
  if vendor.vendored?
40
- puts "JBundler classpath:"
41
- vendor.require_jars.each do |path|
42
- puts " * #{path}"
43
- end
44
- elsif classpath_file.exists?
45
- classpath_file.require_classpath unless defined? JBUNDLER_CLASSPATH
46
- puts "JBundler classpath:"
47
- JBUNDLER_CLASSPATH.each do |path|
48
- puts " * #{path}"
49
- end
42
+ raise "already vendored. please 'jbundle install --no-deployment before."
50
43
  else
51
- puts "JBundler classpath is not installed."
44
+ vendor.setup( JBundler::ClasspathFile.new( config.classpath_file ) )
52
45
  end
53
46
  end
47
+
48
+ def say_bundle_complete
49
+ puts ''
50
+ puts 'Your jbundle is complete! Use `jbundle show` to see where the bundled jars are installed.'
51
+ end
52
+ end
53
+
54
+ desc 'jruby_complete', 'pack a jruby-complete jar with custom dependencies and maybe adjust jruby dependencies like newer versions of joda-time or snakeyaml', :hide => true
55
+ method_option :clean, :type => :boolean, :default => false
56
+ method_option :verbose, :type => :boolean, :default => false
57
+ method_option :debug, :type => :boolean, :default => false
58
+ method_option :show, :type => :boolean, :default => false, :desc => 'show versions of all libraries from jruby'
59
+ def jruby_complete
60
+ jc = JBundler::JRubyComplete.new( config, options )
61
+ if options[ :show ]
62
+ jc.show_versions
63
+ else
64
+ jc.packit
65
+ end
54
66
  end
55
67
 
56
68
  desc 'tree', 'display a graphical representation of the dependency tree'
@@ -59,12 +71,30 @@ module JBundler
59
71
  JBundler::Tree.new( config ).show_it
60
72
  end
61
73
 
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
74
+ 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 most options. the install command is also the default when no command is given."
75
+ method_option :vendor, :type => :boolean, :default => false, :desc => 'vendor jars into vendor directory (jbundler only).'
76
+ method_option :debug, :type => :boolean, :default => false, :desc => 'enable maven debug output (jbundler only).'
77
+ method_option :verbose, :type => :boolean, :default => false, :desc => 'enable maven output (jbundler only).'
78
+ 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 !"
79
+ method_option :no_deployment, :type => :boolean, :default => false, :desc => 'clears the vendored jars'
80
+ method_option :path, :type => :string
81
+ method_option :without, :type => :array
82
+ method_option :system, :type => :boolean
83
+ method_option :local, :type => :boolean
84
+ method_option :binstubs, :type => :string
85
+ method_option :trust_policy, :type => :string
86
+ method_option :gemfile, :type => :string
87
+ method_option :jobs, :type => :string
88
+ method_option :retry, :type => :string
89
+ method_option :no_cache, :type => :boolean
90
+ method_option :quiet, :type => :boolean
91
+ def install
66
92
  JBundler::LockDown.new( config ).lock_down( options[ :vendor ],
67
- options[ :debug ] )
93
+ options[ :debug ] ,
94
+ options[ :verbose ] )
95
+ config.verbose = ! options[ :quiet ]
96
+ Show.new( config ).show_classpath
97
+ puts 'jbundle complete' unless options[ :quiet ]
68
98
  end
69
99
 
70
100
  desc 'executable', 'create an executable jar with a given bootstrap.rb file\nLIMITATION: only for jruby 1.6.x and newer'
@@ -82,7 +112,7 @@ module JBundler
82
112
  # dummy - never executed !!!
83
113
  end
84
114
 
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."
115
+ desc 'lock_down', "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. that is kept as fall back in cases where the new install does not work as before."
86
116
  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 !"
87
117
  method_option :no_deployment, :type => :boolean, :default => false, :desc => 'clears the vendored jars'
88
118
  method_option :path, :type => :string
@@ -96,43 +126,39 @@ module JBundler
96
126
  method_option :retry, :type => :string
97
127
  method_option :no_cache, :type => :boolean
98
128
  method_option :quiet, :type => :boolean
99
- def install
129
+ def lock_down
100
130
  require 'jbundler'
101
- if options[ :no_deployment ]
102
- vendor = JBundler::Vendor.new( config.vendor_dir )
103
- vendor.clear
104
- end
105
- if options[ :deployment ]
106
- vendor = JBundler::Vendor.new( config.vendor_dir )
107
- if vendor.vendored?
108
- raise "already vendored. please 'jbundle install --no-deployment before."
109
- else
110
- vendor.setup( JBundler::ClasspathFile.new( config.classpath_file ) )
111
- end
112
- end
113
- do_show
114
- puts 'Your jbundle is complete! Use `jbundle show` to see where the bundled jars are installed.'
131
+
132
+ unvendor if options[ :no_deployment ]
133
+
134
+ vendor if options[ :deployment ]
135
+
136
+ config.verbose = ! options[ :quiet ]
137
+
138
+ Show.new( config ).show_classpath
139
+
140
+ say_bundle_complete unless options[ :quiet ]
115
141
  end
116
142
 
117
143
  desc 'update', "first `bundle update` is called and if there are no options then the jar dependencies will be updated. for more details see `bundle help update`."
144
+ method_option :debug, :type => :boolean, :default => false, :desc => 'enable maven debug output (jbundler only).'
145
+ method_option :verbose, :type => :boolean, :default => false, :desc => 'enable maven output (jbundler only).'
118
146
  def update
119
- if ARGV.size == 1
120
- require 'java'
121
- config = JBundler::Config.new
122
- FileUtils.rm_f(config.jarfile_lock)
147
+ return unless ARGV.size == 1
123
148
 
124
- require 'jbundler'
125
- do_show
126
- puts ''
127
- puts 'Your jbundle is updated! Use `jbundle show` to see where the bundled jars are installed.'
128
- end
149
+ JBundler::LockDown.new( config ).update( options[ :debug ] ,
150
+ options[ :verbose ] )
151
+
152
+ config.verbose = ! options[ :quiet ]
153
+ Show.new( config ).show_classpath
154
+ puts ''
155
+ puts 'Your jbundle is updated! Use `jbundle show` to see where the bundled jars are installed.'
129
156
  end
130
157
 
131
158
  desc 'show', "first `bundle show` is called and if there are no options then the jar dependencies will be displayed. for more details see `bundle help show`."
132
159
  def show
133
- if ARGV.size == 1
134
- do_show
135
- end
160
+ config.verbose = true
161
+ Show.new( config ).show_classpath
136
162
  end
137
163
  end
138
164
  end