Class: IronWorkerNG::Feature::Java::MergeJar::Feature

Inherits:
Base
  • Object
show all
Defined in:
lib/iron_worker_ng/feature/java/merge_jar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#container_add, #rebase

Constructor Details

#initialize(code, path) ⇒ Feature

Returns a new instance of Feature.



8
9
10
11
12
# File 'lib/iron_worker_ng/feature/java/merge_jar.rb', line 8

def initialize(code, path)
  super(code)

  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/iron_worker_ng/feature/java/merge_jar.rb', line 6

def path
  @path
end

Instance Method Details

#build_commandObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/iron_worker_ng/feature/java/merge_jar.rb', line 22

def build_command
  if @code.remote_build_command || @code.full_remote_build
    if @code.full_remote_build && IronWorkerNG::Fetcher.remote?(rebase(@path))
      "jar '#{rebase(@path)}'"
    else
      "jar '#{@code.dest_dir}#{File.basename(@path)}'"
    end
  else
    nil
  end
end

#bundle(container) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/iron_worker_ng/feature/java/merge_jar.rb', line 14

def bundle(container)
  IronCore::Logger.debug 'IronWorkerNG', "Bundling java jar with path='#{@path}'"

  if (not @code.full_remote_build) || (not IronWorkerNG::Fetcher.remote?(rebase(@path)))
    container_add(container, File.basename(@path), rebase(@path))
  end
end

#code_for_classpathObject



34
35
36
# File 'lib/iron_worker_ng/feature/java/merge_jar.rb', line 34

def code_for_classpath
  File.basename(@path)
end