@@ -242,16 +242,16 @@ buildRIDERunnerForDocker := {
242242 )
243243}
244244
245- lazy val compilePRRaw = taskKey[Unit ](" Compile the project" )
245+ lazy val compilePRRaw =
246+ taskKey[Unit ](" Incremental compilation (Compile + Test) without cleanup. Useful for fixing warnings/errors in a fast feedback loop." )
246247compilePRRaw := Def
247248 .sequential(
248- clean.all(ScopeFilter (inAnyProject)),
249249 scalafmtCheck.all(ScopeFilter (inAnyProject, inConfigurations(Compile ))),
250250 compile.all(ScopeFilter (inAnyProject, inConfigurations(Test )))
251251 )
252252 .value
253253
254- lazy val checkPRRaw = taskKey[Unit ](" Compile the project and run unit tests" )
254+ lazy val checkPRRaw = taskKey[Unit ](" Incremental compilation without cleanup and running unit tests. Useful for quick test-fix iterations. " )
255255checkPRRaw := Def
256256 .sequential(
257257 compilePRRaw,
@@ -266,20 +266,28 @@ checkPRRaw := Def
266266 )
267267 .value
268268
269- def commandWithFatalWarnings (commandName : String , task : TaskKey [Unit ]): Command =
270- Command .command(commandName) { state =>
269+ def commandWithCleanupAndFatalWarnings (commandName : String , task : TaskKey [Unit ], help : Help ): Command =
270+ Command .command(commandName, help ) { state =>
271271 val extracted = Project .extract(state)
272272 val newState = extracted.appendWithoutSession(
273273 Seq (Global / scalacOptions ++= Seq (" -Werror" )),
274274 state
275275 )
276276
277- Project .extract( newState).runTask (task, newState )
277+ Command .process( " clean " , newState, onParseError = _ => ()).unsafeRunTask (task)
278278 state
279279 }
280280
281- def compilePR : Command = commandWithFatalWarnings(" compilePR" , compilePRRaw)
282- def checkPR : Command = commandWithFatalWarnings(" checkPR" , checkPRRaw)
281+ def compilePR : Command = commandWithCleanupAndFatalWarnings(
282+ " compilePR" ,
283+ compilePRRaw,
284+ Help .briefOnly(Seq (" compilePR" -> " Compile with scalafmt." ))
285+ )
286+ def checkPR : Command = commandWithCleanupAndFatalWarnings(
287+ " checkPR" ,
288+ checkPRRaw,
289+ Help .briefOnly(Seq (" checkPR" -> " Compile with scalafmt, build JavaScript artifacts, run unit tests." ))
290+ )
283291
284292commands += Command .command(" buildDebPackages" ) { state =>
285293 " set node / Debian / packageArchitecture := \" arm64\" " ::
0 commit comments