diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-11-05 03:00:04 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-11-05 21:14:58 +0800 |
commit | bc9dc386625021fec517f2dbf0644ccafe1e32c2 (patch) | |
tree | 12db6817470708c7aa274aa231ef35eb79f2123a /contrib/tut/src | |
parent | 8afe79afe33be68f59f89b8410984e508c3e8d08 (diff) | |
download | mill-bc9dc386625021fec517f2dbf0644ccafe1e32c2.tar.gz mill-bc9dc386625021fec517f2dbf0644ccafe1e32c2.tar.bz2 mill-bc9dc386625021fec517f2dbf0644ccafe1e32c2.zip |
WIP migrating over from `ammonite.ops` to `os` module.
__.compile works, haven't run tests yet
Diffstat (limited to 'contrib/tut/src')
-rw-r--r-- | contrib/tut/src/mill/contrib/tut/TutModule.scala | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/tut/src/mill/contrib/tut/TutModule.scala b/contrib/tut/src/mill/contrib/tut/TutModule.scala index f051a465..e51a8d7b 100644 --- a/contrib/tut/src/mill/contrib/tut/TutModule.scala +++ b/contrib/tut/src/mill/contrib/tut/TutModule.scala @@ -1,7 +1,6 @@ package mill package contrib.tut -import ammonite.ops._ import coursier.MavenRepository import mill.scalalib._ import scala.util.matching.Regex @@ -51,7 +50,7 @@ trait TutModule extends ScalaModule { * A task which determines where the compiled documentation files will be placed. By default this is simply the Mill build's output folder for this task, * but this can be reconfigured so that documentation goes to the root of the module (e.g. `millSourcePath`) or to a dedicated folder (e.g. `millSourcePath / 'docs`) */ - def tutTargetDirectory: T[Path] = T { T.ctx().dest } + def tutTargetDirectory: T[os.Path] = T { T.ctx().dest } /** * A task which determines what classpath is used when compiling documentation. By default this is configured to use the same inputs as the [[mill.contrib.tut.TutModule#runClasspath]], @@ -115,18 +114,18 @@ trait TutModule extends ScalaModule { /** * Run Tut using the configuration specified in this module. The working directory used is the [[mill.contrib.tut.TutModule#millSourcePath]]. */ - def tut: T[CommandResult] = T { + def tut: T[os.CommandResult] = T { val in = tutSourceDirectory().head.path.toIO.getAbsolutePath val out = tutTargetDirectory().toIO.getAbsolutePath val re = tutNameFilter() val opts = tutScalacOptions() val pOpts = tutPluginJars().map(pathRef => "-Xplugin:" + pathRef.path.toIO.getAbsolutePath) val tutArgs = List(in, out, re.pattern.toString) ++ opts ++ pOpts - %%( + os.proc( 'java, "-cp", tutClasspath().map(_.path.toIO.getAbsolutePath).mkString(java.io.File.pathSeparator), "tut.TutMain", tutArgs - )(wd = millSourcePath) + ).call(millSourcePath) } } |