Fix MPP CI issues (#1645)

* Fix compilation of SplitPane

* Fix Gradle tests
This commit is contained in:
Alexey Tsvetkov
2021-12-28 11:55:37 +03:00
committed by Alexey Tsvetkov
parent 8e335c9d21
commit 11918f3e8a
18 changed files with 46 additions and 112 deletions

View File

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

View File

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

View File

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

View File

@@ -19,13 +19,15 @@ class TestProject(
private val name: String,
private val testEnvironment: TestEnvironment
) {
private val testProjectsRootDir = File("src/test/test-projects")
private val additionalArgs = listOf(
"--stacktrace",
"--init-script", testProjectsRootDir.resolve("init.gradle").absolutePath,
"-P${ComposeProperties.VERBOSE}=true"
)
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}" }
}
for (orig in originalTestRoot.walk()) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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"
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -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")
}
}

View File

@@ -5,13 +5,6 @@ plugins {
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 {
js(IR) {
browser()

View File

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