1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-05-29 04:41:30 +00:00

Use skipTests instead of includeTests

This commit is contained in:
Karol Stasiak 2020-11-02 13:47:16 +01:00
parent 831be03167
commit f39810793b
2 changed files with 10 additions and 9 deletions

View File

@ -21,10 +21,10 @@ Setting up the test suite for Millfork is tricky, so if you don't need the tests
#### Steps
* run `sbt compile`
* run `sbt -DskipTests compile`
to compile the project
* run `sbt assembly`
* run `sbt -DskipTests assembly`
to build the executable jar file, it should appear in `target/scala-2.12`
### Building with tests
@ -55,9 +55,9 @@ Test suite is useful if you plan on modifying the compiler. Some test dependenci
* navigate to the project directory
* run `sbt -DincludeTests compile` to compile the project
* run `sbt compile` to compile the project
* run `sbt -DincludeTests assemble` to build the executable jar file, it should appear in `target/scala-2.12`
* run `sbt assemble` to build the executable jar file, it should appear in `target/scala-2.12`
### Building a native executable

View File

@ -31,22 +31,23 @@ val testDependencies = Seq(
"org.graalvm.js" % "js-scriptengine" % "20.2.0" % "test"
)
val includesTests = System.getProperty("includeTests") != null
val includesTests = System.getProperty("skipTests") == null
libraryDependencies ++=(
if (includesTests) {
println("Including test dependencies")
testDependencies
} else {
Seq()
Seq[ModuleID]()
}
)
(if (!includesTests) {
// Disable assembling tests
test in assembly := {}
// SBT doesn't like returning Unit, so return Seq
} else Seq())
sbt.internals.DslEntry.fromSettingsDef(test in assembly := {})
} else {
sbt.internals.DslEntry.fromSettingsDef(Seq[sbt.Def.Setting[_]]())
})
mainClass in Compile := Some("millfork.Main")