Fix plugin loading order for publishing

This commit is contained in:
Alexander Nozik 2021-02-23 10:43:15 +03:00
parent a871db0c15
commit 9c12501a57
3 changed files with 34 additions and 32 deletions

View File

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
### Fixed
- Plugin loading order for publishing
### Security

View File

@ -8,7 +8,7 @@ plugins {
}
group = "ru.mipt.npm"
version = "0.8.1"
version = "0.8.2"
description = "Build tools for DataForge and kscience projects"

View File

@ -15,13 +15,13 @@ private fun Project.isSnapshot() = version.toString().contains("dev") || version
open class KSciencePublishingPlugin : Plugin<Project> {
override fun apply(project: Project): Unit {
project.run {
override fun apply(project: Project): Unit = project.run {
if (plugins.findPlugin("maven-publish") == null) {
plugins.apply("maven-publish")
}
configure<PublishingExtension> {
plugins.withId("org.jetbrains.kotlin.js") {
plugins.withId("ru.mipt.npm.gradle.js") {
val kotlin = extensions.findByType<KotlinJsProjectExtension>()!!
val sourcesJar: Jar by project.tasks.creating(Jar::class) {
@ -37,7 +37,7 @@ open class KSciencePublishingPlugin : Plugin<Project> {
}
}
plugins.withId("org.jetbrains.kotlin.jvm") {
plugins.withId("ru.mipt.npm.gradle.jvm") {
val kotlin = extensions.findByType<KotlinJvmProjectExtension>()!!
val sourcesJar: Jar by project.tasks.creating(Jar::class) {
@ -53,10 +53,8 @@ open class KSciencePublishingPlugin : Plugin<Project> {
}
}
}
}
project.afterEvaluate {
val githubOrg: String = project.findProperty("githubOrg") as? String ?: "mipt-npm"
val githubProject: String? by project
val vcs = findProperty("vcs") as? String
@ -174,7 +172,8 @@ open class KSciencePublishingPlugin : Plugin<Project> {
val sonatypePassword: String? by project
val keyId: String? by project
val signingKey: String? = project.findProperty("signingKey") as? String ?: System.getenv("signingKey")
val signingKey: String? =
project.findProperty("signingKey") as? String ?: System.getenv("signingKey")
val signingKeyPassphrase: String? by project
if (sonatypePublish == "true" && sonatypeUser != null && sonatypePassword != null) {
@ -212,3 +211,5 @@ open class KSciencePublishingPlugin : Plugin<Project> {
}
}
}