Sha256: 67128ccba81691198a462293eeccf9f5ca0c5b38c79332a4fee8fc2117f5eb7c

Contents?: true

Size: 897 Bytes

Versions: 4

Compression:

Stored size: 897 Bytes

Contents

module Perkins
  module Build
    class Script
      module Jdk
        def export
          super
          set 'TRAVIS_JDK_VERSION', config[:jdk], echo: false if uses_jdk?
        end

        def setup
          super
          cmd "jdk_switcher use #{config[:jdk]}", assert: true, timing: false if uses_jdk?
          self.if '-f build.gradle' do
            set 'TERM', 'dumb', echo: false
          end
        end

        def announce
          super
          if uses_java?
            cmd "java -version", timing: false
            cmd "javac -version", timing: false
          end
        end

        def cache_slug
          return super unless uses_jdk?
          super << "--jdk-" << config[:jdk].to_s
        end

        private

          def uses_java?
            true
          end

          def uses_jdk?
            !!config[:jdk]
          end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
perkins-0.0.5 lib/perkins/build/script/jdk.rb
perkins-0.0.3 lib/perkins/build/script/jdk.rb
perkins-0.0.2 lib/perkins/build/script/jdk.rb
perkins-0.0.1 lib/perkins/build/script/jdk.rb