Sha256: 0573eb1fee675e5bced5279af359e47b74a369d3a62f8d1e6bf12732c17da54e
Contents?: true
Size: 1.9 KB
Versions: 1
Compression:
Stored size: 1.9 KB
Contents
module Transcriptic class SBT class << self include Transcriptic::UI def compile ensure_installed sbt("package") end def stage ensure_installed if sbt("package") jars = Dir.glob("target/scala-2.10/*.jar") if jars.length == 0 output_with_arrow "Couldn't find compiled package! Is your code in the right directory?" false elsif jars.length > 1 output_with_arrow "Multiple packages found: I'm unsure which one is correct. Try `transcriptic clean` and recompiling." false else jars[0] end end end def update ensure_installed sbt("update") end def clean ensure_installed sbt("clean") end private def ensure_installed stat = `which sbt` if stat.empty? output_with_arrow "Downloading sbt..." Transcriptic::SBT::Installer.new(["/usr/local"], {}).invoke_all end end def sbt(action) base = Transcriptic.find_labfile.dirname output_with_arrow "Detected Scala sources in app..." output_with_arrow "Compiling..." display code = IO.popen("sbt #{action}") do |stream| stream.each do |line| output_with_indent line end end display if 0 == $? output_with_arrow "Compilation succeeded." true else output_with_arrow "Errors occurred!" false end end end class Installer < BaseGenerator def install get "http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.12.3/sbt-launch.jar", target.join("sbt/sbt-launch.jar") copy_file 'sbt', target.join('bin/sbt') chmod target.join('bin/sbt'), 0755 end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
transcriptic-0.2.10 | lib/transcriptic/sbt.rb |