Sha256: 70f40e59f01b093d48c2d00a01203eb9c68c90339032e3ec2b82eb83f3e712c2

Contents?: true

Size: 914 Bytes

Versions: 16

Compression:

Stored size: 914 Bytes

Contents

require_relative '../feature/java/merge_jar'
require_relative '../feature/java/merge_exec'

module IronWorkerNG
  module Code
    class Java < IronWorkerNG::Code::Base
      include IronWorkerNG::Feature::Java::MergeJar::InstanceMethods
      include IronWorkerNG::Feature::Java::MergeExec::InstanceMethods

      def run_code
        classpath_array = []
      
        @features.each do |f|
          if f.respond_to?(:code_for_classpath)
            classpath_array << f.send(:code_for_classpath)
          end
        end

        classpath = classpath_array.join(':')

        IronCore::Logger.info 'IronWorkerNG', "Collected '#{classpath}' classpath"
        
        <<RUN_CODE
java -cp #{classpath} #{@exec.klass.nil? ? "-jar #{File.basename(@exec.path)}" : @exec.klass} "$@"
RUN_CODE
      end
    end
  end
end

IronWorkerNG::Code::Base.register_type(:name => 'java', :klass => IronWorkerNG::Code::Java)

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
iron_worker_ng-0.7.4 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.7.3 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.7.2 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.7.1 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.7.0 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.6.8 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.6.7 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.6.6 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.6.5 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.6.4 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.6.3 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.6.2 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.6.1 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.6.0 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.5.1 lib/iron_worker_ng/code/java.rb
iron_worker_ng-0.5.0 lib/iron_worker_ng/code/java.rb