diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-12 00:09:26 -0500 |
---|---|---|
committer | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-03-12 00:09:26 -0500 |
commit | b143c01a2e180b647eb27338cb7302aa38ef10c6 (patch) | |
tree | 9608d8ff36a80ac68f968aea8fcc31e4dae4150f /stage2/AdminTasks.scala | |
parent | fae67dc6124a12710599ede6e091e2de236079aa (diff) | |
parent | 55fff670befc97a871cf0f85c65764e108f3d3c1 (diff) | |
download | cbt-b143c01a2e180b647eb27338cb7302aa38ef10c6.tar.gz cbt-b143c01a2e180b647eb27338cb7302aa38ef10c6.tar.bz2 cbt-b143c01a2e180b647eb27338cb7302aa38ef10c6.zip |
Merge pull request #78 from cvogt/chris
Chris
Diffstat (limited to 'stage2/AdminTasks.scala')
-rw-r--r-- | stage2/AdminTasks.scala | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/stage2/AdminTasks.scala b/stage2/AdminTasks.scala index 2f7efe1..70b140e 100644 --- a/stage2/AdminTasks.scala +++ b/stage2/AdminTasks.scala @@ -1,12 +1,33 @@ package cbt +import scala.collection.immutable.Seq class AdminTasks(lib: Lib, args: Array[String]){ + implicit val logger: Logger = lib.logger def resolve = { ClassPath.flatten( - args(0).split(",").toVector.map{ + args(1).split(",").toVector.map{ d => val v = d.split(":") new MavenDependency(v(0),v(1),v(2))(lib.logger).classpath } ) } + def amm = ammonite + def ammonite = { + val version = args.lift(1).getOrElse(constants.scalaVersion) + val scalac = new ScalaCompilerDependency( version ) + val d = MavenDependency( + "com.lihaoyi","ammonite-repl_2.11.7",args.lift(1).getOrElse("0.5.6") + ) + // FIXME: this does not work quite yet, throws NoSuchFileException: /ammonite/repl/frontend/ReplBridge$.class + lib.runMain( + "ammonite.repl.Main", Seq(), d.classLoader + ) + } + def scala = { + val version = args.lift(1).getOrElse(constants.scalaVersion) + val scalac = new ScalaCompilerDependency( version ) + lib.runMain( + "scala.tools.nsc.MainGenericRunner", Seq("-cp", scalac.classpath.string), scalac.classLoader + ) + } } |