Sha256: 3d423f74fae4abfd8851d5fa82ba8e27d6d423f27e5bdbbcd0c8361a4943387e

Contents?: true

Size: 560 Bytes

Versions: 20

Compression:

Stored size: 560 Bytes

Contents

module Vx
  module Builder
    class Script

      Java = Struct.new(:app) do

        include Helper::TraceShCommand

        def call(env)
          if java(env)
            env.cache_key << "jdk-#{java env}"

            env.before_install.tap do |i|
              i << "source $(which jdk_switcher.sh)"
              i << trace_sh_command("jdk_switcher use #{java env}")
            end
          end

          app.call(env)
        end

        private

          def java(env)
            env.source.jdk.first
          end

      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
vx-builder-0.1.8 lib/vx/builder/script/java.rb
vx-builder-0.1.7 lib/vx/builder/script/java.rb
vx-builder-0.1.6 lib/vx/builder/script/java.rb
vx-builder-0.1.5 lib/vx/builder/script/java.rb
vx-builder-0.1.4 lib/vx/builder/script/java.rb
vx-builder-0.1.3 lib/vx/builder/script/java.rb
vx-builder-0.1.2 lib/vx/builder/script/java.rb
vx-builder-0.1.1 lib/vx/builder/script/java.rb
vx-builder-0.1.0 lib/vx/builder/script/java.rb
vx-builder-0.0.29 lib/vx/builder/script/java.rb
vx-builder-0.0.28 lib/vx/builder/script/java.rb
vx-builder-0.0.27 lib/vx/builder/script/java.rb
vx-builder-0.0.26 lib/vx/builder/script/java.rb
vx-builder-0.0.25 lib/vx/builder/script/java.rb
vx-builder-0.0.24 lib/vx/builder/script/java.rb
vx-builder-0.0.23 lib/vx/builder/script/java.rb
vx-builder-0.0.22 lib/vx/builder/script/java.rb
vx-builder-0.0.21 lib/vx/builder/script/java.rb
vx-builder-0.0.20 lib/vx/builder/script/java.rb
vx-builder-0.0.19 lib/vx/builder/script/java.rb