Browse Source

Fix MPP CI issues (#1645)

* Fix compilation of SplitPane

* Fix Gradle tests
pull/1658/head
Alexey Tsvetkov 3 years ago committed by Alexey Tsvetkov
parent
commit
11918f3e8a
  1. 4
      components/build.gradle.kts
  2. 7
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/gradle/GradlePluginTest.kt
  3. 7
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt
  4. 4
      gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestProject.kt
  5. 10
      gradle-plugins/compose/src/test/test-projects/application/defaultArgs/build.gradle
  6. 8
      gradle-plugins/compose/src/test/test-projects/application/javaLogger/build.gradle
  7. 2
      gradle-plugins/compose/src/test/test-projects/application/jvm/build.gradle
  8. 2
      gradle-plugins/compose/src/test/test-projects/application/jvmKotlinDsl/build.gradle.kts
  9. 8
      gradle-plugins/compose/src/test/test-projects/application/macOptions/build.gradle
  10. 8
      gradle-plugins/compose/src/test/test-projects/application/macSign/build.gradle
  11. 14
      gradle-plugins/compose/src/test/test-projects/application/moduleClashCli/build.gradle
  12. 9
      gradle-plugins/compose/src/test/test-projects/application/mpp/build.gradle
  13. 8
      gradle-plugins/compose/src/test/test-projects/application/optionsWithSpaces/build.gradle
  14. 8
      gradle-plugins/compose/src/test/test-projects/application/resources/build.gradle
  15. 8
      gradle-plugins/compose/src/test/test-projects/application/unpackSkiko/build.gradle
  16. 34
      gradle-plugins/compose/src/test/test-projects/init.gradle
  17. 7
      gradle-plugins/compose/src/test/test-projects/misc/jsMpp/build.gradle
  18. 10
      gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/build.gradle

4
components/build.gradle.kts

@ -17,6 +17,10 @@ subprojects {
} }
} }
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>() {
kotlinOptions.jvmTarget = "11"
}
plugins.withId("maven-publish") { plugins.withId("maven-publish") {
configureIfExists<PublishingExtension> { configureIfExists<PublishingExtension> {
repositories { repositories {

7
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/gradle/GradlePluginTest.kt

@ -24,12 +24,7 @@ import kotlin.concurrent.thread
class GradlePluginTest : GradlePluginTestBase() { class GradlePluginTest : GradlePluginTestBase() {
@Test @Test
fun jsMppIsNotBroken() = fun jsMppIsNotBroken() =
with( with(testProject(TestProjects.jsMpp)) {
testProject(
TestProjects.jsMpp,
testEnvironment = defaultTestEnvironment.copy(kotlinVersion = TestKotlinVersion.V1_5_20)
)
) {
gradle(":compileKotlinJs").build().checks { check -> gradle(":compileKotlinJs").build().checks { check ->
check.taskOutcome(":compileKotlinJs", TaskOutcome.SUCCESS) check.taskOutcome(":compileKotlinJs", TaskOutcome.SUCCESS)
} }

7
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestKotlinVersion.kt

@ -7,7 +7,6 @@ package org.jetbrains.compose.test
@Suppress("EnumEntryName") @Suppress("EnumEntryName")
enum class TestKotlinVersion(val versionString: String) { enum class TestKotlinVersion(val versionString: String) {
Default("1.6.10"), // __KOTLIN_COMPOSE_VERSION__
V1_5_31("1.5.31"), Default("1.6.10")
V1_5_20("1.5.20") }
}

4
gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/TestProject.kt

@ -19,13 +19,15 @@ class TestProject(
private val name: String, private val name: String,
private val testEnvironment: TestEnvironment private val testEnvironment: TestEnvironment
) { ) {
private val testProjectsRootDir = File("src/test/test-projects")
private val additionalArgs = listOf( private val additionalArgs = listOf(
"--stacktrace", "--stacktrace",
"--init-script", testProjectsRootDir.resolve("init.gradle").absolutePath,
"-P${ComposeProperties.VERBOSE}=true" "-P${ComposeProperties.VERBOSE}=true"
) )
init { init {
val originalTestRoot = File("src/test/test-projects").resolve(name).also { val originalTestRoot = testProjectsRootDir.resolve(name).also {
check(it.exists()) { "Test project is not found: ${it.absolutePath}" } check(it.exists()) { "Test project is not found: ${it.absolutePath}" }
} }
for (orig in originalTestRoot.walk()) { for (orig in originalTestRoot.walk()) {

10
gradle-plugins/compose/src/test/test-projects/application/defaultArgs/build.gradle

@ -5,14 +5,6 @@ plugins {
id "org.jetbrains.compose" id "org.jetbrains.compose"
} }
repositories {
google()
mavenCentral()
maven {
url "https://maven.pkg.jetbrains.space/public/p/compose/dev"
}
}
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation compose.desktop.currentOs implementation compose.desktop.currentOs
@ -27,4 +19,4 @@ compose.desktop {
packageName = "Test Package" packageName = "Test Package"
} }
} }
} }

8
gradle-plugins/compose/src/test/test-projects/application/javaLogger/build.gradle

@ -3,14 +3,6 @@ plugins {
id "org.jetbrains.compose" id "org.jetbrains.compose"
} }
repositories {
google()
mavenCentral()
maven {
url "https://maven.pkg.jetbrains.space/public/p/compose/dev"
}
}
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation compose.desktop.currentOs implementation compose.desktop.currentOs

2
gradle-plugins/compose/src/test/test-projects/application/jvm/build.gradle

@ -6,8 +6,6 @@ plugins {
} }
repositories { repositories {
google()
mavenCentral()
jetbrainsCompose() jetbrainsCompose()
} }

2
gradle-plugins/compose/src/test/test-projects/application/jvmKotlinDsl/build.gradle.kts

@ -7,8 +7,6 @@ plugins {
} }
repositories { repositories {
google()
mavenCentral()
jetbrainsCompose() jetbrainsCompose()
} }

8
gradle-plugins/compose/src/test/test-projects/application/macOptions/build.gradle

@ -5,14 +5,6 @@ plugins {
id "org.jetbrains.compose" id "org.jetbrains.compose"
} }
repositories {
google()
mavenCentral()
maven {
url "https://maven.pkg.jetbrains.space/public/p/compose/dev"
}
}
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation compose.desktop.currentOs implementation compose.desktop.currentOs

8
gradle-plugins/compose/src/test/test-projects/application/macSign/build.gradle

@ -5,14 +5,6 @@ plugins {
id "org.jetbrains.compose" id "org.jetbrains.compose"
} }
repositories {
google()
mavenCentral()
maven {
url "https://maven.pkg.jetbrains.space/public/p/compose/dev"
}
}
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation compose.desktop.currentOs implementation compose.desktop.currentOs

14
gradle-plugins/compose/src/test/test-projects/application/moduleClashCli/build.gradle

@ -1,14 +0,0 @@
plugins {
id "org.jetbrains.kotlin.jvm" apply false
id "org.jetbrains.compose" apply false
}
subprojects {
repositories {
google()
mavenCentral()
maven {
url "https://maven.pkg.jetbrains.space/public/p/compose/dev"
}
}
}

9
gradle-plugins/compose/src/test/test-projects/application/mpp/build.gradle

@ -5,14 +5,6 @@ plugins {
id "org.jetbrains.compose" id "org.jetbrains.compose"
} }
repositories {
google()
mavenCentral()
maven {
url "https://maven.pkg.jetbrains.space/public/p/compose/dev"
}
}
kotlin { kotlin {
jvm { jvm {
} }
@ -26,7 +18,6 @@ kotlin {
} }
} }
compose.desktop { compose.desktop {
application { application {
mainClass = "MainKt" mainClass = "MainKt"

8
gradle-plugins/compose/src/test/test-projects/application/optionsWithSpaces/build.gradle

@ -5,14 +5,6 @@ plugins {
id "org.jetbrains.compose" id "org.jetbrains.compose"
} }
repositories {
google()
mavenCentral()
maven {
url "https://maven.pkg.jetbrains.space/public/p/compose/dev"
}
}
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation compose.desktop.currentOs implementation compose.desktop.currentOs

8
gradle-plugins/compose/src/test/test-projects/application/resources/build.gradle

@ -5,14 +5,6 @@ plugins {
id "org.jetbrains.compose" id "org.jetbrains.compose"
} }
repositories {
google()
mavenCentral()
maven {
url "https://maven.pkg.jetbrains.space/public/p/compose/dev"
}
}
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation compose.desktop.currentOs implementation compose.desktop.currentOs

8
gradle-plugins/compose/src/test/test-projects/application/unpackSkiko/build.gradle

@ -5,14 +5,6 @@ plugins {
id "org.jetbrains.compose" id "org.jetbrains.compose"
} }
repositories {
google()
mavenCentral()
maven {
url "https://maven.pkg.jetbrains.space/public/p/compose/dev"
}
}
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation compose.desktop.currentOs implementation compose.desktop.currentOs

34
gradle-plugins/compose/src/test/test-projects/init.gradle

@ -0,0 +1,34 @@
def jvmTargetForKotlinCompile(Project project, String jvmTarget) {
project.tasks.all {
// tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) fails for init scripts
if (it.class.name == "org.jetbrains.kotlin.gradle.tasks.KotlinCompile_Decorated") {
kotlinOptions.jvmTarget = "11"
}
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
google()
}
plugins.withId("java-base") {
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
plugins.withId("org.jetbrains.kotlin.jvm") {
jvmTargetForKotlinCompile(project, "11")
}
plugins.withId("org.jetbrains.kotlin.multiplatform") {
jvmTargetForKotlinCompile(project, "11")
}
}

7
gradle-plugins/compose/src/test/test-projects/misc/jsMpp/build.gradle

@ -5,13 +5,6 @@ plugins {
id "org.jetbrains.compose" id "org.jetbrains.compose"
} }
repositories {
google()
mavenCentral()
maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
}
kotlin { kotlin {
js(IR) { js(IR) {
browser() browser()

10
gradle-plugins/compose/src/test/test-projects/misc/jvmPreview/build.gradle

@ -1,10 +0,0 @@
subprojects {
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://maven.pkg.jetbrains.space/public/p/compose/dev'
}
google()
}
}
Loading…
Cancel
Save