Sha256: d6549b87db490d09a54fe9f3b484d8e3ea4d8ea45735eb13f2de940a032e2495

Contents?: true

Size: 1.11 KB

Versions: 76

Compression:

Stored size: 1.11 KB

Contents

module Vx
  module Builder
    class ScriptBuilder

      class Scala < Base

        DEFAULT_SCALA = '2.10.3'

        def call(env)
          if enabled?(env)
            do_cache_key(env) do |i|
              i << "scala-#{scala env}"
            end

            do_announce(env) do |i|
              i << trace_sh_command("export SCALA_VERSION=#{scala env}")
            end

            do_install(env) do |i|
              i << "if [[ -d project || -f build.sbt ]] ; then #{trace_sh_command "sbt ++#{scala env} update"} ; fi"
            end

            do_script(env) do |i|
              i << "if [[ -d project || -f build.sbt ]] ; then #{trace_sh_command "sbt ++#{scala env} test"} ; fi"
            end

            do_cached_directories(env) do |i|
              i << "~/.sbt"
              i << "~/.ivy2"
            end
          end

          app.call(env)
        end

        private

          def enabled?(env)
            env.source.scala.first || env.source.language == 'scala'
          end

          def scala(env)
            env.source.scala.first || DEFAULT_SCALA
          end


      end
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
vx-builder-0.5.61 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.60 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.59 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.58 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.57 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.56 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.55 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.54 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.53 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.52 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.51 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.50 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.49 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.48 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.47 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.46 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.45 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.44 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.43 lib/vx/builder/script_builder/scala.rb
vx-builder-0.5.42 lib/vx/builder/script_builder/scala.rb