diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed77bc..6b97937 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed +- Separate release tasks for each target ### Deprecated diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index da34c5f..e54f996 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -tools = "0.11.1-kotlin-1.6.10" +tools = "0.11.2-kotlin-1.6.10" kotlin = "1.6.10" atomicfu = "0.17.1" binary-compatibility-validator = "0.8.0" @@ -18,7 +18,7 @@ kotlinx-serialization = "1.3.2" ktor = "1.6.7" xmlutil = "0.84.0" yamlkt = "0.10.2" -jsBom = "0.0.1-pre.290-kotlin-1.6.10" +jsBom = "0.0.1-pre.313-kotlin-1.6.10" junit = "5.8.2" [libraries] diff --git a/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt b/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt index 913832d..f48f6d0 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt @@ -4,8 +4,6 @@ import kotlinx.validation.ApiValidationExtension import kotlinx.validation.BinaryCompatibilityValidatorPlugin import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.plugins.BasePluginExtension -import org.gradle.api.publish.maven.tasks.PublishToMavenLocal import org.gradle.api.publish.maven.tasks.PublishToMavenRepository import org.gradle.kotlin.dsl.* import org.jetbrains.changelog.ChangelogPlugin @@ -173,6 +171,11 @@ public open class KScienceProjectPlugin : Plugin { } } + val releaseAll by tasks.creating { + group = RELEASE_GROUP + description = "Publish development or production release based on version suffix" + } + allprojects { afterEvaluate { ksciencePublish.repositoryNames.forEach { repositoryName -> @@ -185,12 +188,14 @@ public open class KScienceProjectPlugin : Plugin { it.name.removePrefix("publish").removeSuffix("To${repositoryNameCapitalized}Repository") }" - val releaseTask = tasks.findByName(theName) ?: tasks.create(theName) { + val targetReleaseTask = tasks.findByName(theName) ?: tasks.create(theName) { group = RELEASE_GROUP - description = "Publish development or production release based on version suffix" + description = "Publish platform release artifact" } - releaseTask.dependsOn(it) + releaseAll.dependsOn(targetReleaseTask) + + targetReleaseTask.dependsOn(it) } } } diff --git a/src/main/kotlin/ru/mipt/npm/gradle/internal/publishing.kt b/src/main/kotlin/ru/mipt/npm/gradle/internal/publishing.kt index 9f5aefa..921631d 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/internal/publishing.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/internal/publishing.kt @@ -31,15 +31,14 @@ internal fun Project.setupPublication(mavenPomConfiguration: MavenPom.() -> Unit from(it.kotlin) } } - afterEvaluate { - publications.create("js") { - kotlin.js().components.forEach { - from(it) - } - - artifact(sourcesJar) + publications.create("js") { + kotlin.js().components.forEach { + from(it) } + + artifact(sourcesJar) } + } plugins.withId("org.jetbrains.kotlin.jvm") { @@ -68,37 +67,35 @@ internal fun Project.setupPublication(mavenPomConfiguration: MavenPom.() -> Unit } // Process each publication we have in this project - afterEvaluate { - publications.withType { - artifact(dokkaJar) + publications.withType { + artifact(dokkaJar) - pom { - name.set(project.name) - description.set(project.description ?: project.name) + pom { + name.set(project.name) + description.set(project.description ?: project.name) - licenses { - license { - name.set("The Apache Software License, Version 2.0") - url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") - distribution.set("repo") - } + licenses { + license { + name.set("The Apache Software License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + distribution.set("repo") } - - developers { - developer { - id.set("MIPT-NPM") - name.set("MIPT nuclear physics methods laboratory") - organization.set("MIPT") - organizationUrl.set("https://npm.mipt.ru") - } - } - - scm { - tag.set(project.version.toString()) - } - - mavenPomConfiguration() } + + developers { + developer { + id.set("MIPT-NPM") + name.set("MIPT nuclear physics methods laboratory") + organization.set("MIPT") + organizationUrl.set("https://npm.mipt.ru") + } + } + + scm { + tag.set(project.version.toString()) + } + + mavenPomConfiguration() } } }