Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
FINALLY! It's now able to use scalate when being run as a SBT plugin!
  • Loading branch information
mads-hartmann committed Sep 8, 2011
1 parent fed3b48 commit 728ca90
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lifty-plugin/Lifty.scala
Expand Up @@ -17,6 +17,11 @@ object Lifty extends Plugin {

lazy val liftyCommand = Command.args("lifty","<help>") { (state, args) =>

val bytecodeDir =
new java.io.File(List(System.getProperty("user.home"),".lifty_workspace","classes").mkString(File.separator))

bytecodeDir.mkdirs()

// classpath

val cp = {
Expand Down Expand Up @@ -67,7 +72,7 @@ object Lifty extends Plugin {

compiler.apply(sources = List(file),
classpath = cp,
outputDirectory = new java.io.File(List(System.getProperty("user.home"),".lifty_workspace","classes").mkString(File.separator)),
outputDirectory = bytecodeDir,
options = Nil)
}
}
Expand All @@ -76,12 +81,13 @@ object Lifty extends Plugin {
override protected def createCompiler: Compiler = {
new SBTCompiler()
}
override def bytecodeDirectory = bytecodeDir
}

// create the special engine.
val engine = new SBTTemplateEngine()
engine.allowCaching = false
engine.workingDirectory = new java.io.File(List(System.getProperty("user.home"),".lifty_workspace").mkString(File.separator))


// Run the lifty instance.
new LiftyInstance(Some(engine)).run(args.toList).fold(
Expand Down

0 comments on commit 728ca90

Please sign in to comment.