Class: Vx::Builder::Script::Scala
- Inherits:
-
Struct
- Object
- Struct
- Vx::Builder::Script::Scala
- Includes:
- Helper::TraceShCommand
- Defined in:
- lib/vx/builder/script/scala.rb
Constant Summary collapse
- DEFAULT_SCALA =
'2.10.3'
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
Methods included from Helper::TraceShCommand
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
5 6 7 |
# File 'lib/vx/builder/script/scala.rb', line 5 def app @app end |
Instance Method Details
#call(env) ⇒ Object
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/scala.rb', line 11 def call(env) if enabled?(env) env.cache_key << "scala-#{scala env}" env.announce.tap do |i| i << trace_sh_command("export SCALA_VERSION=#{scala env}") end env.install.tap do |i| i << "if [[ -d project || -f build.sbt ]] ; then #{trace_sh_command "sbt ++#{scala env} update"} ; fi" end if env.source.script.empty? env.script.tap do |i| i << "if [[ -d project || -f build.sbt ]] ; then #{trace_sh_command "sbt ++#{scala env} test"} ; fi" end end if env.source.cached_directories != false env.cached_directories.push "~/.sbt" env.cached_directories.push "~/.ivy2" end end app.call(env) end |