Skip to content

Commit

Permalink
Improve readability of the build script
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrasnoff committed Jun 19, 2024
1 parent 096b9cc commit 814a5b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions atomicfu-maven-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ publishing.publications {
}
}

val mavenUserHome = System.getProperty("maven.user.home")
val mavenRepoLocal = System.getProperty("maven.repo.local")
val mavenUserHome: String? = System.getProperty("maven.user.home")
val mavenRepoLocal: String? = System.getProperty("maven.repo.local")

val generatePomFileForMavenPublication by tasks.getting(GenerateMavenPom::class)

// runs the plugin description generator
val generatePluginDescriptor by tasks.registering(Exec::class) {
dependsOn(generatePomFileForMavenPublication, project(":atomicfu-transformer").tasks.named("publishToMavenLocal"))

dependsOn(generatePomFileForMavenPublication)

dependsOn(project(":atomicfu-transformer").tasks.named("publishToMavenLocal"))

val pluginDescriptorFile = outputDir.file("META-INF/maven/plugin.xml")

workingDir = projectDir
Expand All @@ -49,7 +53,7 @@ val generatePluginDescriptor by tasks.registering(Exec::class) {
commandLine = args
doLast {
val descriptorFile = pluginDescriptorFile.get().asFile
assert(descriptorFile.exists()) { "$descriptorFile: was not generated" }
require(descriptorFile.exists()) { "$descriptorFile: was not generated" }
logger.info("Plugin descriptor is generated in $descriptorFile")
}
}
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {
alias(libs.plugins.kotlinx.binaryCompatibilityValidator)
}

val deploy by tasks.creating() {
val deploy: Task? by tasks.creating {
dependsOn(getTasksByName("publish", true))
dependsOn(getTasksByName("publishNpm", true))
}

// Right now it is used for switching nodejs version which is supports generated wasm bytecode
// Right now it is used for switching nodejs version which is supports generated wasm bytecode - Remove after updating to Kotlin 2.0
extensions.findByType(NodeJsRootExtension::class.java)?.let {
// canary nodejs that supports recent Wasm GC changes
it.nodeVersion = "21.0.0-v8-canary202309167e82ab1fa2"
Expand Down

0 comments on commit 814a5b7

Please sign in to comment.