Class: Vx::Builder::ScriptBuilderV2::Scala

Inherits:
Base
  • Object
show all
Defined in:
lib/vx/builder/script_builder_v2/scala.rb

Constant Summary collapse

DEFAULT_SCALA =
'2.10.3'

Instance Attribute Summary

Attributes inherited from Base

#app

Instance Method Summary collapse

Methods inherited from Base

#deploy?, #do_after_deploy, #do_before_deploy, #do_before_script, #do_cache_key, #do_cached_directories, #do_database, #do_deploy_script, #do_install, #do_script

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/vx/builder/script_builder_v2/scala.rb', line 9

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

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

    env.stage("install").tap do |i|
      i.add_task 'scala', 'action' => 'install', 'scala' => scala(env)
      do_install(env) do
        i.add_task 'scala', "sbt:update"
      end
    end

    do_script(env) do
      env.stage("script").tap do |i|
        i.add_task 'scala', 'sbt:test'
      end
    end

  end

  app.call(env)
end