Class: JarFiles

Inherits:
Rake::FileList
  • Object
show all
Includes:
RakeJavaUtil
Defined in:
lib/rakejava.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RakeJavaUtil

#path_esc, #path_sep, #popd, #pushd, #pushd_stack, #separate, #space_sep

Constructor Details

#initialize(*args) ⇒ JarFiles

Returns a new instance of JarFiles.



83
84
85
86
87
# File 'lib/rakejava.rb', line 83

def initialize *args
  @root = args.shift
  @resolving = false
  super
end

Instance Attribute Details

#rootObject

Returns the value of attribute root.



81
82
83
# File 'lib/rakejava.rb', line 81

def root
  @root
end

Instance Method Details

#resolveObject



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/rakejava.rb', line 89

def resolve
  unless @resolving
    @resolving = true
    pushd @root
    super
    puts "Resolving JarFiles list"
    # Hack time because the jar command is busted.  Every arg after the
    # first file listed after a -C needs to have paths relative to the
    # command-launch rather than the -C specified dir.  The first file arg
    # after a -C works but subsequent ones fail.
    hack = @items.shift
    @items.map! { |i| "#{@root}#{File::SEPARATOR}#{i}" }
    @items.unshift(hack)
    popd
    @resolving = false
  end
  self
end