Skip to content

Commit af1b204

Browse files
committed
compilePRRaw and checkPRRaw don't clean the project. only regular versions of commands
1 parent 2460fc9 commit af1b204

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

build.sbt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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.")
246247
compilePRRaw := 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.")
255255
checkPRRaw := 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

284292
commands += Command.command("buildDebPackages") { state =>
285293
"set node / Debian / packageArchitecture := \"arm64\"" ::

node/tests/src/test/scala/com/wavesplatform/finalization/ExtensionAppenderAfterFinalizationSpec.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class ExtensionAppenderAfterFinalizationSpec extends BaseFinalizationSpec {
5858
log.debug("Append block 2 - the first common block")
5959
val altChainBlock1 = d.createBlock(generator = committedGenerator2, strictTime = true)
6060
appendBlock()
61-
val commonBlockHeight = Height(d.blockchain.height)
6261

6362
log.debug("Append block 3 (activation height)")
6463
val altChainBlock2 = d.createBlock(ref = altChainBlock1.id().some, generator = committedGenerator2, strictTime = true)
@@ -109,8 +108,8 @@ class ExtensionAppenderAfterFinalizationSpec extends BaseFinalizationSpec {
109108

110109
{
111110
given Prettifier = {
112-
case o: IndexedSeq[Seq[GeneratorEntry]] => o.mkString("\n")
113-
case o => o.toString
111+
case o: IndexedSeq[?] => o.mkString("\n")
112+
case o => o.toString
114113
}
115114

116115
mainChainBlockGeneratorsAfterRestore shouldBe mainChainBlockGenerators

0 commit comments

Comments
 (0)