add 'Projects must be configuring' workaround script

This commit is contained in:
Adam 2022-07-17 12:12:06 +02:00
parent b4f3fc87e5
commit 09b49ae21c
3 changed files with 37 additions and 3 deletions

View file

@ -7,7 +7,7 @@ plugins {
`project-report` `project-report`
`build-dashboard` `build-dashboard`
kotlin("multiplatform") apply false // try to stop error 'Projects must be configuring' // kotlin("multiplatform") apply false // try to stop error 'Projects must be configuring'
// kotlin("js") apply false // try to stop error 'Projects must be configuring' // kotlin("js") apply false // try to stop error 'Projects must be configuring'
} }
@ -101,3 +101,6 @@ val runFactorioClient by tasks.registering {
":modules:infra-factorio-client:processRun", ":modules:infra-factorio-client:processRun",
) )
} }
apply(from = "$projectDir/kt52647.gradle.kts")

View file

@ -10,7 +10,7 @@ org.gradle.unsafe.configuration-cache-problems=warn
org.gradle.kotlin.dsl.precompiled.accessors.strict=true org.gradle.kotlin.dsl.precompiled.accessors.strict=true
#org.gradle.parallel=true # helps with pRoJeCtS mUsT bE cOnFiGuRiNg org.gradle.parallel=true
# pRoJeCtS mUsT bE cOnFiGuRiNg # pRoJeCtS mUsT bE cOnFiGuRiNg
org.gradle.configureondemand=false #org.gradle.configureondemand=false

31
kt52647.gradle.kts Normal file
View file

@ -0,0 +1,31 @@
val projectsMustBeConfiguringBuster by tasks.registering {
val buildFile = layout.projectDirectory.file("kt52647.gradle.kts").asFile
doLast {
logger.warn("Applying 'Projects must be configuring' workaround - https://youtrack.jetbrains.com/issue/KT-52647")
val newLines = buildFile.readText().lines().joinToString("\n") { line ->
if (line.startsWith("// projects must be configuring buster")) {
"// projects must be configuring buster ${System.currentTimeMillis()}"
} else {
line
}
}
buildFile.writeText(newLines)
}
}
allprojects {
tasks
.matching { it.name != projectsMustBeConfiguringBuster.name }
.configureEach {
finalizedBy(projectsMustBeConfiguringBuster)
}
}
// projects must be configuring buster
// ^ this line will be edited by projectsMustBeConfiguringBuster