Skip to content

Commit 136f9d2

Browse files
authored
Build setup cleanup (#4353)
* Remove atomicfu workaround * Cleanup build configuration
1 parent 03b81f4 commit 136f9d2

4 files changed

+11
-20
lines changed

buildSrc/src/main/kotlin/CacheRedirector.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ private fun Project.configureYarnAndNodeRedirects() {
108108
}
109109

110110
val nodeJsExtension = rootProject.extensions.findByType<NodeJsRootExtension>()
111-
nodeJsExtension?.nodeDownloadBaseUrl?.let {
112-
nodeJsExtension.nodeDownloadBaseUrl = CacheRedirector.maybeRedirect(it)
111+
nodeJsExtension?.downloadBaseUrl?.let {
112+
nodeJsExtension.downloadBaseUrl = CacheRedirector.maybeRedirect(it)
113113
}
114114
}
115115
}

buildSrc/src/main/kotlin/atomicfu-conventions.gradle.kts

-8
This file was deleted.

buildSrc/src/main/kotlin/configure-compilation-conventions.gradle.kts

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@ import org.jetbrains.kotlin.gradle.tasks.*
33
configure(subprojects) {
44
val project = this
55
if (name in sourceless) return@configure
6-
apply(plugin = "atomicfu-conventions")
6+
apply(plugin = "org.jetbrains.kotlinx.atomicfu")
77
tasks.withType<KotlinCompilationTask<*>>().configureEach {
88
val isMainTaskName = name.startsWith("compileKotlin")
99
compilerOptions {
10-
var versionsAreNotOverridden = true
1110
getOverriddenKotlinLanguageVersion(project)?.let {
1211
languageVersion = it
13-
versionsAreNotOverridden = false
1412
}
1513
getOverriddenKotlinApiVersion(project)?.let {
1614
apiVersion = it
17-
versionsAreNotOverridden = false
1815
}
1916
if (isMainTaskName && !unpublished.contains(project.name)) {
2017
allWarningsAsErrors = true

buildSrc/src/main/kotlin/kotlin-multiplatform-conventions.gradle.kts

+8-6
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ java {
1414
kotlin {
1515
jvm {
1616
compilations.all {
17-
compilerOptions.configure {
18-
jvmTarget = JvmTarget.JVM_1_8
17+
compileTaskProvider.configure {
18+
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
1919
}
2020
}
2121
}
@@ -53,7 +53,7 @@ kotlin {
5353
api("org.jetbrains.kotlinx:atomicfu-js:${version("atomicfu")}")
5454
}
5555
}
56-
@OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl::class)
56+
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
5757
wasmJs {
5858
// Module name should be different from the one from JS
5959
// otherwise IC tasks that start clashing different modules with the same module name
@@ -63,15 +63,17 @@ kotlin {
6363
api("org.jetbrains.kotlinx:atomicfu-wasm-js:${version("atomicfu")}")
6464
}
6565
}
66-
@OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl::class)
66+
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
6767
wasmWasi {
6868
nodejs()
6969
compilations["main"]?.dependencies {
7070
api("org.jetbrains.kotlinx:atomicfu-wasm-wasi:${version("atomicfu")}")
7171
}
7272
compilations.configureEach {
73-
compilerOptions.configure {
74-
optIn.add("kotlin.wasm.internal.InternalWasmApi")
73+
compileTaskProvider.configure {
74+
compilerOptions {
75+
optIn.add("kotlin.wasm.internal.InternalWasmApi")
76+
}
7577
}
7678
}
7779
}

0 commit comments

Comments
 (0)