Skip to content

Commit d108479

Browse files
committed
Put submodule tests in sbt onLoad.
1 parent 04eee0d commit d108479

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

project/Build.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ object ExposedValues extends AutoPlugin {
2424

2525
object Build {
2626

27-
projectChecks()
28-
2927
val scalacVersion = "2.11.11" // Do not rename, this is grepped in bin/common.
3028

3129
val dottyOrganization = "ch.epfl.lamp"
@@ -234,7 +232,7 @@ object Build {
234232
settings(commonNonBootstrappedSettings).
235233
settings(
236234
triggeredMessage in ThisBuild := Watched.clearWhenTriggered,
237-
235+
submoduleChecks,
238236
addCommandAlias("run", "dotty-compiler/run") ++
239237
addCommandAlias("legacyTests", "dotty-compiler/testOnly dotc.tests")
240238
)
@@ -995,14 +993,15 @@ object DottyInjectedPlugin extends AutoPlugin {
995993
))
996994
}
997995

998-
private def projectChecks(): Unit = {
996+
lazy val submoduleChecks = onLoad in Global := (onLoad in Global).value andThen { state =>
999997
val submodules = List(new File("scala-backend"), new File("scala-library"), new File("collection-strawman"))
1000998
if (!submodules.forall(f => f.exists && f.listFiles().nonEmpty)) {
1001-
println(
1002-
s"""[WARNING] Missing some of the submodules
999+
sLog.value.log(Level.Error,
1000+
s"""Missing some of the submodules
10031001
|You can initialize the modules with:
10041002
| > git submodule update --init
10051003
""".stripMargin)
10061004
}
1005+
state
10071006
}
10081007
}

0 commit comments

Comments
 (0)