Wednesday, February 1, 2012

Small script to update & compile a list of svn project

Scala script skeleton to update a set of subversion projects.
exec scala -deprecation -savecompiled "$0" "$@"

// ======================================================================
import sys.process.Process
import sys.process.ProcessBuilder._

case class CurDir(
implicit def stringToCurDir(d:String) = CurDir(new
implicit def stringToProcess(cmd: String)(implicit curDir:CurDir) = Process(cmd, curDir.cwd)
implicit def stringSeqToProcess(cmd:Seq[String])(implicit curDir:CurDir) = Process(cmd, curDir.cwd)

implicit var cwd:CurDir=scala.util.Properties.userDir
def cd(dir:String=util.Properties.userDir) = cwd=dir
// ======================================================================

val updateList=List("project1", "project2", "project3")

for(dir<- updateList) {
  println("Processing %s".format(dir))


  "svn update" !

  "sbt eclipse compile" !

No comments:

Post a Comment