add some hacks to try and stop 'Projects must be configuring' bug

This commit is contained in:
Adam 2022-05-14 12:23:58 +02:00
parent ffe9bcb9a8
commit 6618a92a66
5 changed files with 145 additions and 20 deletions

View file

@ -77,9 +77,13 @@ kotlin {
implementation(project.dependencies.platform(libs.kotest.bom))
implementation("io.kotest:kotest-framework-engine")
implementation("io.kotest:kotest-assertions-core")
implementation("io.kotest:kotest-property")
implementation("io.kotest:kotest-assertions-json")
// implementation("io.kotest:kotest-assertions-core")
// implementation("io.kotest:kotest-property")
// implementation("io.kotest:kotest-assertions-json")
implementation(libs.kotest.core)
implementation(libs.kotest.datatest)
implementation(libs.kotest.prop)
implementation(libs.kotest.json)
}
}
@ -155,30 +159,35 @@ val generateTypescript by tasks.registering(GenerateTypescriptTask::class) {
// }
//}
val schemaTsDistributionName = providers.provider {
val schemaTsDistributionName : Provider<String> = providers.provider {
"${rootProject.name}-${project.name}"
}
val generateTypescriptOutputFiles: Provider<FileTree> = generateTypescript.map { it.outputs.files.asFileTree }
val schemaTs by distributions.registering {
distributionBaseName.set(schemaTsDistributionName)
contents {
from(generateTypescript.map { it.outputs.files.asFileTree })
from(generateTypescriptOutputFiles)
}
}
val schemaTsZipTask = tasks.named<Zip>("${schemaTs.name}DistZip")
val schemaTsZipTask: TaskProvider<Zip> = tasks.named<Zip>("${schemaTs.name}DistZip")
val schemaTsZipTaskArchiveFile: Provider<RegularFile> = schemaTsZipTask.flatMap { it.archiveFile }
val typescriptModelGenerated: Configuration by configurations.creating {
asProvider()
typescriptAttributes(objects)
outgoing.artifact(schemaTsZipTask.flatMap { it.archiveFile })
outgoing.artifact(schemaTsZipTaskArchiveFile)
}
tasks.matching {
it.name == "jsGenerateExternalsIntegrated"
}.configureEach {
@Suppress("UnstableApiUsage")
notCompatibleWithConfigurationCache("try to prevent 'Projects must be configuring' error")
}
//tasks.matching {
// it.name == "jsGenerateExternalsIntegrated"
//}.configureEach {
// @Suppress("UnstableApiUsage")
// notCompatibleWithConfigurationCache("try to prevent 'Projects must be configuring' error")
//// outputs.upToDateWhen { true }
// dependsOn(":kotlinNpmInstall")
//}

View file

@ -3,13 +3,29 @@ import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
plugins {
dev.adamko.kafkatorio.lang.`kotlin-js`
// dev.adamko.kafkatorio.lang.`kotlin-js`
dev.adamko.kafkatorio.lang.`kotlin-multiplatform`
kotlin("plugin.serialization")
id("io.kvision")
}
project.ext.set("io.kvision.plugin.enableGradleTasks", false)
project.ext.set("io.kvision.plugin.enableWorkerTasks", false)
project.ext.set("io.kvision.plugin.enableWebpackVersions", false)
project.ext.set("io.kvision.plugin.enableHiddenKotlinJsStore", false)
project.ext.set("io.kvision.plugin.enableSecureResolutions", false)
project.ext.set("io.kvision.plugin.enableBackendTasks", false)
kotlin {
js(IR) {
browser()
binaries.executable()
}
js("frontend", IR) {
// nodejs()
browser {
runTask {
@ -22,7 +38,7 @@ kotlin {
"/kv/*" to "http://localhost:8080",
"/kvws/*" to mapOf("target" to "ws://localhost:8080", "ws" to true)
),
static = mutableListOf("$buildDir/processedResources/js/main")
static = mutableListOf("$buildDir/processedResources/frontend/main")
)
}
webpackTask {
@ -37,6 +53,10 @@ kotlin {
binaries.executable()
}
jvm("backend") {
}
sourceSets {
all {
@ -46,7 +66,22 @@ kotlin {
}
}
main {
val commonMain by getting {
dependencies {
implementation(dependencies.platform(libs.kotlinx.coroutines.bom))
implementation(dependencies.platform(libs.kotlin.jsWrappers.bom))
implementation(libs.kotlinx.coroutines.core)
implementation(projects.modules.eventsSchema)
implementation(libs.kotlinx.html)
}
}
val jsMain by getting {
dependsOn(commonMain)
dependencies {
implementation(projects.modules.eventsSchema)
@ -77,11 +112,20 @@ kotlin {
implementation(dependencies.platform(npm("node-forge", "^1.3.0")))
}
val webDir = file("src/main/web")
resources.srcDir(webDir)
// val webDir = file("src/main/web")
resources.srcDir("src/main/web")
resources.srcDir("src/main/resources")
kotlin.srcDir("src/main/kotlin")
}
test {
val frontendMain by getting {
dependsOn(jsMain)
// resources.srcDir("src/main/web")
// resources.srcDir("src/main/resources")
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
@ -89,6 +133,8 @@ kotlin {
// implementation(npm("karma", "^6.3.16"))
}
kotlin.srcDir("src/test/kotlin")
}
}
}
@ -114,3 +160,30 @@ fun KotlinDependencyHandler.kvision(
// resolution("node-forge", "1.3.0")
// }
//}
afterEvaluate {
rootProject.tasks.named("rootPackageJson").configure {
outputs.upToDateWhen { false }
inputs.property("cacheBuster", System.currentTimeMillis())
}
rootProject.tasks.named("kotlinYarnSetup").configure {
outputs.upToDateWhen { false }
inputs.property("cacheBuster", System.currentTimeMillis())
}
rootProject.tasks.named("kotlinNpmCachesSetup").configure {
outputs.upToDateWhen { false }
inputs.property("cacheBuster", System.currentTimeMillis())
}
rootProject.tasks.named("kotlinStoreYarnLock").configure {
outputs.upToDateWhen { false }
inputs.property("cacheBuster", System.currentTimeMillis())
}
}
tasks.configureEach {
inputs.property("pRoJeCtS-mUsT-bE-cOnFiGuRiNg", System.currentTimeMillis())
}
rootProject.tasks.configureEach {
inputs.property("pRoJeCtS-mUsT-bE-cOnFiGuRiNg", System.currentTimeMillis())
}