Repository navigation
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
57 lines (52 loc) · 3.05 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
57 lines (52 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.jetpack.compose).apply(false)
alias(libs.plugins.kotlin.native.desktop).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
alias(libs.plugins.kotlin.multiplatform).apply(false)
alias(libs.plugins.kotlin.jvm).apply(false)
alias(libs.plugins.ksp).apply(false)
}
// One published version for every artifact (#70): "$pythonVersion-$libraryVersionSuffix", the same
// value python-multiplatform and the included Gradle-plugin build derive from gradle.properties.
val publishedVersion = "${property("pythonVersion")}-${property("libraryVersionSuffix")}"
allprojects {
group = "org.thisisthepy"
version = publishedVersion
}
// Fails the build when any project in this build publishes under another version; the plugin build
// checks its own the same way (python-multiplatform-gradle-plugin/build.gradle.kts).
gradle.projectsEvaluated {
val wrong = rootProject.allprojects.filter { it.version.toString() != publishedVersion }
check(wrong.isEmpty()) {
"published versions disagree (#70): expected $publishedVersion, got " +
wrong.joinToString { "${it.path}=${it.version}" }
}
}
// ROADMAP §15a/§15e item 3: `python-multiplatform-gradle-plugin` is a separate included build
// (see `pluginManagement { includeBuild(...) }` in settings.gradle.kts), so its tasks never join
// the root task graph -- `./gradlew tasks --all` from here lists none of them, and a coordinator
// publishing only what the root build shows would silently skip it. This task does not change how
// any of the three components publish (each already has its own `maven-publish` config); it only
// gives the root build one entry point that reaches all three.
tasks.register("publishAllToMavenLocal") {
group = "publishing"
description = "Publishes python-multiplatform, python-multiplatform-ksp, and " +
"python-multiplatform-gradle-plugin (including its plugin-marker publication) to mavenLocal()."
dependsOn(":python-multiplatform:publishToMavenLocal")
dependsOn(":python-multiplatform-ksp:publishToMavenLocal")
dependsOn(gradle.includedBuild("python-multiplatform-gradle-plugin").task(":publishToMavenLocal"))
}
// The build's single Kotlin/Wasm npm lock (one workspace for every wasm module) lives next to the
// version catalog instead of a root `kotlin-js-store/` (issue #110). KGP only allows this on the
// root project; the `*Property` forms are the non-deprecated API from Kotlin 2.4 on. Mismatch
// reporting keeps its default (FAIL), so CI notices a drifted lock.
plugins.withType<org.jetbrains.kotlin.gradle.targets.wasm.yarn.WasmYarnPlugin> {
extensions.getByType<org.jetbrains.kotlin.gradle.targets.wasm.yarn.WasmYarnRootExtension>().apply {
lockFileDirectoryProperty.set(layout.projectDirectory.dir("gradle"))
lockFileNameProperty.set("wasm-yarn.lock")
}
}