Module: JBundler

Defined in:
lib/jbundler/classpath_file.rb,
lib/jbundler.rb,
lib/jbundler/cli.rb,
lib/jbundler/pom.rb,
lib/jbundler/lazy.rb,
lib/jbundler/show.rb,
lib/jbundler/tree.rb,
lib/jbundler/aether.rb,
lib/jbundler/config.rb,
lib/jbundler/vendor.rb,
lib/jbundler/context.rb,
lib/jbundler/lock_down.rb,
lib/jbundler/executable.rb,
lib/jbundler/pom_runner.rb,
lib/jbundler/configurator.rb,
lib/jbundler/gemfile_lock.rb,
lib/jbundler/jruby_complete.rb

Overview

Copyright © 2013 Christian Meier

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: Lazy Classes: AetherRuby, ClasspathFile, Cli, Config, Configurator, Context, Executable, GemfileLock, JRubyComplete, LockDown, Pom, PomRunner, Show, Tree, Vendor

Class Method Summary collapse

Class Method Details

.contextObject



26
27
28
# File 'lib/jbundler.rb', line 26

def self.context
  @context ||= JBundler::Context.new
end

.require_jarsObject



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/jbundler.rb', line 58

def self.require_jars
  if context.vendor.vendored?
    jars = context.vendor.require_jars
    if context.config.verbose
      warn "jbundler classpath:"
      jars.each do |path|
        warn "\t#{path}"
      end
    end
  elsif context.classpath.exists? && context.jarfile.exists_lock?
    require 'java'
    context.classpath.require_classpath
    if context.config.verbose
      warn "jbundler classpath:"
      JBUNDLER_CLASSPATH.each do |path|
          warn "\t#{path}"
      end
    end
    Jars.freeze_loading
  end
end

.setupObject



80
81
82
83
84
85
86
87
# File 'lib/jbundler.rb', line 80

def self.setup
  if context.config.skip
    warn "skip jbundler setup" if context.config.verbose
  else
    update
    require_jars
  end
end

.setup_testObject



30
31
32
33
# File 'lib/jbundler.rb', line 30

def self.setup_test
  context.classpath.require_test_classpath
  context.config
end

.updateObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/jbundler.rb', line 35

def self.update
  if( context.classpath.needs_update?( context.jarfile, 
                                       context.gemfile_lock ) and
      not context.vendor.vendored? )
    
    warn ''
    warn 'jar bundle is outdated - use jbundle install to update bundle'
    warn ''

    aether = JBundler::AetherRuby.new( context.config )
    
    context.jarfile.populate_unlocked( aether )
    context.gemfile_lock.populate_dependencies( aether )
    context.jarfile.populate_locked( aether )
    
    aether.resolve
    
    context.classpath.generate( aether.classpath_array, [], [], 
                                context.config.local_repository )
    context.jarfile.generate_lockfile( aether.resolved_coordinates )
  end
end