Commit 6e6ccb78 authored by Arthur Bit-Monnot's avatar Arthur Bit-Monnot

Updated both mill and sbt builds

parent 527c81aa
......@@ -15,7 +15,7 @@ case class Config(mode: Mode = ParsingMode,
full: Boolean = false,
abstractionHierarchyType: AbstractionHierarchyType = DetailedKnoblock)
object ParserApp extends App {
object ParserApp {
val optionsParser = new scopt.OptionParser[Config]("copla-lang") {
head("""copla-lang is a set of libraries and command line utilities
......@@ -61,27 +61,29 @@ object ParserApp extends App {
}
}
optionsParser.parse(args, Config()) match {
case Some(conf) if conf.mode == ParsingMode && conf.full =>
handleResult(parseToFull(conf.anmlFile),
(m: full.Model) => println(Formatter[full.Model].format(m)))
case Some(conf) if conf.mode == ParsingMode =>
handleResult(parse(conf.anmlFile),
(m: core.CoreModel) => println(Formatter[core.CoreModel].format(m)))
case Some(conf) if conf.mode == AbstractionHierarchyMode =>
handleResult(
parse(conf.anmlFile),
(m: core.CoreModel) => {
println(
analysis
.abstractionHierarchy(m, conf.abstractionHierarchyType)
.toSeq
.map { case (fluent, lvl) => s"$lvl $fluent" }
.sorted
.mkString("\n"))
}
)
case None =>
sys.exit(1)
def main(args: Array[String]): Unit = {
optionsParser.parse(args, Config()) match {
case Some(conf) if conf.mode == ParsingMode && conf.full =>
handleResult(parseToFull(conf.anmlFile),
(m: full.Model) => println(Formatter[full.Model].format(m)))
case Some(conf) if conf.mode == ParsingMode =>
handleResult(parse(conf.anmlFile),
(m: core.CoreModel) => println(Formatter[core.CoreModel].format(m)))
case Some(conf) if conf.mode == AbstractionHierarchyMode =>
handleResult(
parse(conf.anmlFile),
(m: core.CoreModel) => {
println(
analysis
.abstractionHierarchy(m, conf.abstractionHierarchyType)
.toSeq
.map { case (fluent, lvl) => s"$lvl $fluent" }
.sorted
.mkString("\n"))
}
)
case None =>
sys.exit(1)
}
}
}
......@@ -56,8 +56,8 @@ lazy val root = project
)
lazy val anml = project
.in(file("copla-lang"))
.settings(name := "copla-lang")
.in(file("anml"))
.settings(name := "dahu-anml")
.settings(commonSettings: _*)
.settings(libraryDependencies ++= Seq(
"com.lihaoyi" %% "fastparse" % "1.0.0",
......@@ -67,7 +67,7 @@ lazy val anml = project
))
lazy val utils = project
.in(file("dahu-utils"))
.in(file("utils"))
.settings(name := "dahu-utils")
.settings(commonSettings ++ utestSettings: _*)
.settings(
......@@ -86,7 +86,7 @@ lazy val recursion = project
))
lazy val model = project
.in(file("dahu-model"))
.in(file("model"))
.dependsOn(utils, recursion)
.settings(name := "dahu-model")
.settings(commonSettings ++ utestSettings: _*)
......@@ -96,7 +96,7 @@ lazy val model = project
))
lazy val solvers = project
.in(file("dahu-solvers"))
.in(file("solvers"))
.dependsOn(utils, model)
.settings(name := "dahu-solvers")
.settings(commonSettings ++ utestSettings: _*)
......@@ -106,18 +106,18 @@ lazy val solvers = project
))
lazy val z3 = project
.in(file("dahu-z3"))
.in(file("z3"))
.dependsOn(utils, model, solvers)
.settings(name := "dahu-z3")
.settings(commonSettings ++ utestSettings: _*)
lazy val benchmarks = project
.in(file("dahu-benchmarks"))
.in(file("benchmarks"))
.dependsOn(utils, solvers, z3)
.settings(commonSettings ++ utestSettings: _*)
lazy val planner = project
.in(file("dahu-planner"))
.in(file("planner"))
.dependsOn(anml, solvers, z3)
.settings(commonSettings ++ utestSettings: _*)
.settings(
......
......@@ -28,6 +28,11 @@ trait Module extends SbtModule {
"-Ycache-plugin-class-loader:last-modified",
"-Ycache-macro-class-loader:last-modified"
)
def unmanagedClasspath = T {
if (!ammonite.ops.exists(millSourcePath / "lib")) Agg() else
Agg.from(ammonite.ops.ls(millSourcePath / "lib").map(PathRef(_)))
}
}
object anml extends Module {
......@@ -74,4 +79,34 @@ object model extends Module {
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.6.4")
def testFrameworks = Seq("utest.runner.Framework")
}
}
\ No newline at end of file
}
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 z3 extends Module {
def moduleDeps = Seq(utils, model, solvers)
}
object planner extends Module {
def moduleDeps = Seq(anml, solvers, z3)
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")
}
}
\ 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