Add separate test project for warn on different classloaders test

After this update  to have different classpath hash in subprojects,
they should have different sets of plugins applied. But KGP could be
in all of them.

^KT-49227 In Progress
This commit is contained in:
Yahor Berdnikau
2022-02-11 11:56:20 +01:00
committed by Space
parent 9f0df8f6b5
commit b87075c344
10 changed files with 150 additions and 1 deletions
@@ -998,7 +998,7 @@ class KotlinGradleIT : BaseGradleIT() {
}
@Test
fun testDetectingDifferentClassLoaders() = with(Project("kt-27059-pom-rewriting", GradleVersionRequired.FOR_MPP_SUPPORT)) {
fun testDetectingDifferentClassLoaders() = with(Project("differentClassloaders", GradleVersionRequired.FOR_MPP_SUPPORT)) {
setupWorkingDir()
val originalRootBuildScript = gradleBuildScript().readText()
@@ -0,0 +1,10 @@
plugins {
id "org.jetbrains.kotlin.multiplatform" version "<pluginMarkerVersion>" apply false
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}
@@ -0,0 +1,41 @@
plugins {
id "kotlin2js"
id "maven-publish"
id "org.jetbrains.kotlin.plugin.serialization"
}
group = "com.example"
version = "1.0"
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
}
if (project.findProperty("mppProjectDependency") == "true") {
dependencies {
api project(":mpp-lib")
}
} else {
repositories {
maven { setUrl "${rootProject.buildDir}/repo" }
}
dependencies {
api "com.example:mpp-lib:1.0"
}
}
publishing {
publications {
main(MavenPublication) {
from components.java
}
}
repositories {
maven { setUrl("${rootProject.buildDir}/repo") }
}
}
@@ -0,0 +1,5 @@
import com.example.mpp.lib.*
fun main() {
println(hello())
}
@@ -0,0 +1,41 @@
plugins {
id "org.jetbrains.kotlin.jvm"
id "maven-publish"
id "org.jetbrains.kotlin.plugin.allopen"
}
group = "com.example"
version = "1.0"
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
}
if (project.findProperty("mppProjectDependency") == "true") {
dependencies {
api project(":mpp-lib")
}
} else {
repositories {
maven { setUrl "${rootProject.buildDir}/repo" }
}
dependencies {
api "com.example:mpp-lib:1.0"
}
}
publishing {
publications {
main(MavenPublication) {
from components.java
}
}
repositories {
maven { setUrl("${rootProject.buildDir}/repo") }
}
}
@@ -0,0 +1,5 @@
import com.example.mpp.lib.*
fun main() {
println(hello())
}
@@ -0,0 +1,42 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "maven-publish"
}
group = "com.example"
version = "1.0"
kotlin {
jvm()
js()
sourceSets {
commonMain {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-common'
}
}
jvmMain {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
}
}
jsMain {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-js'
}
}
}
}
publishing {
publications {
jvm {
artifactId = "mpp-lib-myjvm"
}
}
repositories {
maven { setUrl("${rootProject.buildDir}/repo") }
}
}
@@ -0,0 +1,3 @@
package com.example.mpp.lib
fun hello(): String = "hello"
@@ -0,0 +1 @@
include(":mpp-lib", ":jvm-app", ":js-app")