Skip to content

Commit

Permalink
Experimental fix for #11
Browse files Browse the repository at this point in the history
  • Loading branch information
lefou committed May 12, 2022
1 parent d367200 commit dc937f5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
10 changes: 10 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import mill.scalalib.publish._

import de.tobiasroeser.mill.integrationtest._
import de.tobiasroeser.mill.vcs.version._
import mill.define.{Target, Task}

trait Setup {
val millPlatform: String
Expand Down Expand Up @@ -91,5 +92,14 @@ class ItestCross(itestVersion: String) extends MillIntegrationTestModule {

def millTestVersion = T(itestVersion)
def pluginsUnderTest = Seq(jbake(setup.millPlatform))

override def testInvocations: Target[Seq[(PathRef, Seq[TestInvocation.Targets])]] = T {
Seq(
PathRef(millSourcePath / "src" / "01-simple-site") -> Seq(
TestInvocation.Targets(Seq("verify")),
TestInvocation.Targets(Seq("site.jbake"))
)
)
}
}

4 changes: 3 additions & 1 deletion itest/src/01-simple-site/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import org.scalatest.Assertions

object site extends JBakeModule {

def jbakeVersion = "2.6.4"
override def jbakeVersion = "2.6.4"

override def jbakeProcessMode = JBakeModule.SubProcess

}

Expand Down
9 changes: 6 additions & 3 deletions jbake/src/de/tobiasroeser/mill/jbake/JBakeModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ trait JBakeModule extends Module with TaskModule {
* Bake the site with JBake.
*/
def jbake: T[PathRef] = T {
val targetDir = T.ctx().dest
jbakeWorker().runJbakeMain(targetDir, sources().head.path, targetDir)
val targetDir = T.dest
val srcDir = sources().head.path
jbakeWorker().runJbakeMain(targetDir, srcDir, targetDir)
PathRef(targetDir)
}

Expand All @@ -100,7 +101,9 @@ trait JBakeModule extends Module with TaskModule {
* FIXME: This doesn't work for JBake versions since 2.6.2.
*/
def jbakeServe(): Command[Unit] = T.command {
jbakeWorker().runJbakeMain(T.ctx().dest, "-s", jbake().path)
val srcDir = sources().head.path
val outPath = jbake().path
jbakeWorker().runJbakeMain(T.ctx().dest, "-s", srcDir, outPath)
}

/**
Expand Down

0 comments on commit dc937f5

Please sign in to comment.