Commit 68903ebb authored by Arthur Bit-Monnot's avatar Arthur Bit-Monnot

Updated mill build

parent 6fce88d5
......@@ -126,7 +126,7 @@ lazy val recursion = project
))
lazy val model = project
.in(file("model"))
.in(file("core/model"))
.dependsOn(utils, recursion, algebra)
.settings(name := "dahu-model")
.settings(commonSettings ++ utestSettings: _*)
......@@ -136,7 +136,7 @@ lazy val model = project
))
lazy val solvers = project
.in(file("solvers"))
.in(file("core/solvers"))
.dependsOn(utils, model)
.settings(name := "dahu-solvers")
.settings(commonSettings ++ utestSettings: _*)
......@@ -146,7 +146,7 @@ lazy val solvers = project
))
lazy val z3 = project
.in(file("z3"))
.in(file("core/solvers/z3"))
.dependsOn(utils, model, solvers)
.settings(name := "dahu-z3")
.settings(commonSettings ++ utestSettings: _*)
......
import coursier.maven.MavenRepository
import mill._
import mill.define.Task
import mill.scalalib._
import ammonite.ops._
trait Module extends SbtModule {
def scalaVersion = "2.12.4"
def compileIvyDeps = Agg(ivy"org.spire-math::kind-projector:0.9.6")
def scalacPluginIvyDeps = Agg(ivy"org.spire-math::kind-projector:0.9.6")
def scalacOptions = Seq(
"-target:jvm-1.8",
"-encoding",
"UTF-8",
"-unchecked",
"-deprecation",
// "-Xfuture",
"-Ypartial-unification",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
// "-Ywarn-unused",
"-feature",
"-language:higherKinds",
"-language:existentials",
// experimental option to speed up the build
// "-Ycache-plugin-class-loader:last-modified",
// "-Ycache-macro-class-loader:last-modified"
)
def scalaVersion = "2.12.6"
def compileIvyDeps = Agg(ivy"org.spire-math::kind-projector:0.9.6")
def scalacPluginIvyDeps = Agg(ivy"org.spire-math::kind-projector:0.9.6")
def scalacOptions = Seq(
"-target:jvm-1.8",
"-encoding",
"UTF-8",
"-unchecked",
"-deprecation",
"-Ypartial-unification",
// "-Yno-adapted-args",
// "-Ywarn-dead-code",
// "-Ywarn-numeric-widen",
// "-Ywarn-value-discard",
// "-Ywarn-unused",
"-feature",
"-language:higherKinds",
"-language:existentials",
// experimental option to speed up the build
"-Ycache-plugin-class-loader:last-modified",
"-Ycache-macro-class-loader:last-modified",
"-Ybackend-parallelism", "3"
)
def unmanagedClasspath = T {
val own =
if (!ammonite.ops.exists(millSourcePath / "lib")) Agg()
else Agg.from(ammonite.ops.ls(millSourcePath / "lib").map(PathRef(_)))
own ++ Task.traverse(moduleDeps)(_.unmanagedClasspath)().flatten
}
def unmanagedClasspath = T {
if (!ammonite.ops.exists(millSourcePath / "lib")) Agg() else
Agg.from(ammonite.ops.ls(millSourcePath / "lib").map(PathRef(_)))
}
override def repositories = super.repositories ++ Seq(
MavenRepository("file:///home/arthur/.m2/repository")
)
}
object anml extends Module {
def mainClass = Some("copla.lang.ParserApp")
def ivyDeps = Agg(
ivy"com.lihaoyi::fastparse:1.0.0",
ivy"com.github.scopt::scopt:3.7.0",
ivy"com.chuusai::shapeless:2.3.3",
ivy"org.typelevel::spire:0.14.1"
)
object tests extends Tests {
def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.0.5")
def testFrameworks = Seq("org.scalatest.tools.Framework")
trait ModuleTests extends Module {
object test extends Tests {
override def ivyDeps = Agg(deps.utest, deps.scalatest, deps.scalacheck)
override def testFrameworks = Seq("utest.runner.Framework", "org.scalatest.tools.Framework")
}
}
object recursion extends Module {
def moduleDeps = Seq(utils)
def ivyDeps = Agg(
ivy"org.typelevel::cats-core:1.1.0",
ivy"org.typelevel::cats-free:1.1.0"
)
object tests extends Tests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.6.4")
def testFrameworks = Seq("utest.runner.Framework")
}
trait EmptyModule extends mill.Module {}
object deps {
val cats = ivy"org.typelevel::cats-core:1.1.0"
val catsFree = ivy"org.typelevel::cats-free:1.1.0"
val catsEffect = ivy"org.typelevel::cats-effect:1.0.0-RC"
val spire = ivy"org.typelevel::spire:0.14.1"
val shapeless = ivy"com.chuusai::shapeless:2.3.3"
val fastparse = ivy"com.lihaoyi::fastparse:1.0.0"
val scopt = ivy"com.github.scopt::scopt:3.7.0"
val debox = ivy"org.spire-math::debox:0.8.0"
val pddl4j = ivy"fr.uga:pddl4j:3.6.0"
val utest = ivy"com.lihaoyi::utest:0.6.4"
val scalatest = ivy"org.scalatest::scalatest:3.0.5"
val scalacheck = ivy"org.scalacheck::scalacheck:1.13.5"
}
import deps._
object utils extends Module {
def ivyDeps = Agg(
ivy"org.spire-math::debox:0.8.0",
ivy"org.typelevel::cats-core:1.1.0"
)
object tests extends Tests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.6.4")
def testFrameworks = Seq("utest.runner.Framework")
object core extends EmptyModule {
object algebra extends Module {
override def ivyDeps = Agg(cats, spire)
}
}
object model extends Module {
def moduleDeps = Seq(utils, recursion)
def ivyDeps = Agg(ivy"com.chuusai::shapeless:2.3.3")
object model extends ModuleTests {
def moduleDeps = Seq(algebra, utils, recursion)
def ivyDeps = Agg(shapeless)
}
object solvers extends ModuleTests {
def moduleDeps = Seq(model)
object tests extends Tests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.6.4")
def testFrameworks = Seq("utest.runner.Framework")
object z3 extends Module {
def moduleDeps = Seq(utils, model, solvers)
}
}
}
object solvers extends Module {
def moduleDeps = Seq(utils, model)
object tests extends Tests {
def ivyDeps = Agg(
ivy"com.lihaoyi::utest:0.6.4",
ivy"org.scalacheck::scalacheck:1.13.5"
)
def testFrameworks = Seq("utest.runner.Framework")
object planning extends EmptyModule {
object model extends Module {
def moduleDeps = Seq(core.algebra)
def ivyDeps = Agg(spire, shapeless)
}
object planner extends Module {
def moduleDeps = Seq(planning.model, core.solvers, core.solvers.z3)
def ivyDeps = Agg(catsEffect)
}
object anml extends EmptyModule {
object parser extends ModuleTests {
def moduleDeps = Seq(planning.model)
def ivyDeps = Agg(fastparse, scopt)
def mainClass = Some("dahu.planning.anml.parser.ParserApp")
}
object planner extends Module {
def moduleDeps = Seq(planning.anml.parser, planning.planner)
def ivyDeps = Agg(scopt)
def mainClass = Some("dahu.planning.anml.planner.Main")
}
}
object pddl extends EmptyModule {
object parser extends Module {
def moduleDeps = Seq(planning.model, utils)
def ivyDeps = Agg(pddl4j)
}
object planner extends Module {
def moduleDeps = Seq(planning.pddl.parser, planning.planner)
def ivyDeps = Agg(scopt)
def mainClass = Some("dahu.planning.pddl.planner.Main")
}
}
}
object z3 extends Module {
def moduleDeps = Seq(utils, model, solvers)
object recursion extends ModuleTests {
def moduleDeps = Seq(utils)
def ivyDeps = Agg(cats, catsFree)
}
object planner extends Module {
def moduleDeps = Seq(anml, solvers, z3)
def mainClass = Some("dahu.planner.Main")
def ivyDeps = Agg(
ivy"com.github.scopt::scopt:3.7.0",
ivy"io.monix::monix:3.0.0-RC1"
)
object tests extends Tests {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.6.4")
def testFrameworks = Seq("utest.runner.Framework")
}
def bundle() = T.command {
val fatjar: PathRef = assembly()
val dest = T.ctx.dest
val z3Dir = Path("/home/arthur/work/ext/z3-4.6.0-x64-ubuntu-16.04/bin")
cp(fatjar.path, dest / "lcp.jar")
mkdir(dest / "z3")
cp(z3Dir / "libz3.so", dest / "z3" / "libz3.so")
cp(z3Dir / "libz3java.so", dest / "z3" / "libz3java.so")
cp(z3Dir / "com.microsoft.z3.jar", dest / "z3" / "com.microsoft.z3.jar")
write(dest / "lcp",
"""#!/bin/bash
|
|DIR=$(dirname "$0")
|export LD_LIBRARY_PATH=$DIR/z3:$LD_LIBRARY_PATH
|
|java -cp $DIR/z3/com.microsoft.z3.jar:$DIR/lcp.jar dahu.planner.Main "$@"
""".stripMargin)
//cp(Path("/home/arthur/work/fape/planning/domains/tmp"), dest / "domains")
println(s"Bundled in ${T.ctx.dest}")
}
}
\ No newline at end of file
object utils extends ModuleTests {
def ivyDeps = Agg(debox, cats)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment