Fix plugin loading order for publishing
This commit is contained in:
parent
9c12501a57
commit
133736f00f
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -20,11 +20,6 @@ open class KScienceCommonPlugin : Plugin<Project> {
|
|||||||
registerKScienceExtension()
|
registerKScienceExtension()
|
||||||
repositories.applyRepos()
|
repositories.applyRepos()
|
||||||
|
|
||||||
// apply dokka for all projects
|
|
||||||
if (!plugins.hasPlugin("org.jetbrains.dokka")) {
|
|
||||||
plugins.apply("org.jetbrains.dokka")
|
|
||||||
}
|
|
||||||
|
|
||||||
//Configuration for K-JVM plugin
|
//Configuration for K-JVM plugin
|
||||||
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
|
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
|
||||||
//logger.info("Applying KScience configuration for JVM project")
|
//logger.info("Applying KScience configuration for JVM project")
|
||||||
@ -43,6 +38,22 @@ open class KScienceCommonPlugin : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tasks.withType<KotlinJvmCompile> {
|
||||||
|
kotlinOptions {
|
||||||
|
useIR = true
|
||||||
|
jvmTarget = KScienceVersions.JVM_TARGET.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extensions.findByType<JavaPluginExtension>()?.apply {
|
||||||
|
targetCompatibility = KScienceVersions.JVM_TARGET
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.apply {
|
||||||
|
withType<Test> {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginManager.withPlugin("org.jetbrains.kotlin.js") {
|
pluginManager.withPlugin("org.jetbrains.kotlin.js") {
|
||||||
@ -123,25 +134,23 @@ open class KScienceCommonPlugin : Plugin<Project> {
|
|||||||
(tasks.findByName("jsProcessResources") as? Copy)?.apply {
|
(tasks.findByName("jsProcessResources") as? Copy)?.apply {
|
||||||
fromJsDependencies("jsRuntimeClasspath")
|
fromJsDependencies("jsRuntimeClasspath")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
afterEvaluate {
|
|
||||||
extensions.findByType<JavaPluginExtension>()?.apply {
|
extensions.findByType<JavaPluginExtension>()?.apply {
|
||||||
targetCompatibility = KScienceVersions.JVM_TARGET
|
targetCompatibility = KScienceVersions.JVM_TARGET
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.apply {
|
tasks.apply {
|
||||||
withType<KotlinJvmCompile> {
|
|
||||||
kotlinOptions {
|
|
||||||
useIR = true
|
|
||||||
jvmTarget = KScienceVersions.JVM_TARGET.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
withType<Test> {
|
withType<Test> {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// apply dokka for all projects
|
||||||
|
if (!plugins.hasPlugin("org.jetbrains.dokka")) {
|
||||||
|
plugins.apply("org.jetbrains.dokka")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,10 @@ private fun Project.isSnapshot() = version.toString().contains("dev") || version
|
|||||||
|
|
||||||
open class KSciencePublishingPlugin : Plugin<Project> {
|
open class KSciencePublishingPlugin : Plugin<Project> {
|
||||||
|
|
||||||
override fun apply(project: Project): Unit = project.run {
|
override fun apply(project: Project): Unit {
|
||||||
|
|
||||||
|
//Add publishing plugin and new publications
|
||||||
|
project.run {
|
||||||
if (plugins.findPlugin("maven-publish") == null) {
|
if (plugins.findPlugin("maven-publish") == null) {
|
||||||
plugins.apply("maven-publish")
|
plugins.apply("maven-publish")
|
||||||
}
|
}
|
||||||
@ -53,8 +56,11 @@ open class KSciencePublishingPlugin : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
project.afterEvaluate {
|
//configure publications after everything is set in the root project
|
||||||
|
project.rootProject.afterEvaluate {
|
||||||
|
project.run {
|
||||||
val githubOrg: String = project.findProperty("githubOrg") as? String ?: "mipt-npm"
|
val githubOrg: String = project.findProperty("githubOrg") as? String ?: "mipt-npm"
|
||||||
val githubProject: String? by project
|
val githubProject: String? by project
|
||||||
val vcs = findProperty("vcs") as? String
|
val vcs = findProperty("vcs") as? String
|
||||||
@ -211,5 +217,6 @@ open class KSciencePublishingPlugin : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user