Igor Demin
2 years ago
27 changed files with 261 additions and 162 deletions
@ -0,0 +1,24 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
# Script to build most of the examples, to verify if they can compile. |
||||||
|
# Don't add examples, which don't depend on maven.pkg.jetbrains.space, because they won't be able to compile. |
||||||
|
|
||||||
|
set -euo pipefail |
||||||
|
|
||||||
|
if [ "$#" -ne 2 ]; then |
||||||
|
echo "Specify Compose and Kotlin version. For example: ./validateExamplesWithJs.sh 1.1.1 1.6.10" |
||||||
|
exit 1 |
||||||
|
fi |
||||||
|
COMPOSE_VERSION=$1 |
||||||
|
KOTLIN_VERSION=$2 |
||||||
|
|
||||||
|
|
||||||
|
runGradle() { |
||||||
|
pushd $1 |
||||||
|
./gradlew $2 -Pcompose.version=$COMPOSE_VERSION -Pkotlin.version=$KOTLIN_VERSION |
||||||
|
popd |
||||||
|
} |
||||||
|
|
||||||
|
runGradle web-compose-bird build |
||||||
|
runGradle web-landing build |
||||||
|
runGradle web-with-react build |
@ -0,0 +1,19 @@ |
|||||||
|
package org.jetbrains.compose |
||||||
|
|
||||||
|
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType |
||||||
|
|
||||||
|
internal object ComposeCompilerCompatability { |
||||||
|
fun compilerVersionFor(kotlinVersion: String): ComposeCompilerVersion? = when (kotlinVersion) { |
||||||
|
"1.7.10" -> ComposeCompilerVersion("1.3.0-alpha01") |
||||||
|
"1.7.20" -> ComposeCompilerVersion( |
||||||
|
"1.3.2-alpha01", |
||||||
|
unsupportedPlatforms = setOf(KotlinPlatformType.js) |
||||||
|
) |
||||||
|
else -> null |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
internal data class ComposeCompilerVersion( |
||||||
|
val version: String, |
||||||
|
val unsupportedPlatforms: Set<KotlinPlatformType> = emptySet() |
||||||
|
) |
@ -0,0 +1,56 @@ |
|||||||
|
/* |
||||||
|
* Copyright 2020-2022 JetBrains s.r.o. and respective authors and developers. |
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. |
||||||
|
*/ |
||||||
|
|
||||||
|
package org.jetbrains.compose.test.tests.integration |
||||||
|
|
||||||
|
import org.gradle.testkit.runner.TaskOutcome |
||||||
|
import org.gradle.testkit.runner.UnexpectedBuildFailure |
||||||
|
import org.jetbrains.compose.test.utils.GradlePluginTestBase |
||||||
|
import org.jetbrains.compose.test.utils.TestProjects |
||||||
|
import org.jetbrains.compose.test.utils.checks |
||||||
|
import org.junit.jupiter.api.Test |
||||||
|
import org.junit.jupiter.api.assertThrows |
||||||
|
|
||||||
|
class KotlinCompatabilityTest : GradlePluginTestBase() { |
||||||
|
@Test |
||||||
|
fun testKotlinMpp_1_7_10() = testMpp("1.7.10") |
||||||
|
|
||||||
|
@Test |
||||||
|
fun testKotlinJsMpp_1_7_10() = testJsMpp("1.7.10") |
||||||
|
|
||||||
|
@Test |
||||||
|
fun testKotlinMpp_1_7_20() = testMpp("1.7.20") |
||||||
|
|
||||||
|
@Test |
||||||
|
fun testKotlinJsMpp_1_7_20() { |
||||||
|
assertThrows<UnexpectedBuildFailure> { |
||||||
|
testJsMpp("1.7.20") |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private fun testMpp(kotlinVersion: String) = with( |
||||||
|
testProject( |
||||||
|
TestProjects.mpp, |
||||||
|
testEnvironment = defaultTestEnvironment.copy(kotlinVersion = kotlinVersion) |
||||||
|
) |
||||||
|
) { |
||||||
|
val logLine = "Kotlin MPP app is running!" |
||||||
|
gradle("run").build().checks { check -> |
||||||
|
check.taskOutcome(":run", TaskOutcome.SUCCESS) |
||||||
|
check.logContains(logLine) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private fun testJsMpp(kotlinVersion: String) = with( |
||||||
|
testProject( |
||||||
|
TestProjects.jsMpp, |
||||||
|
testEnvironment = defaultTestEnvironment.copy(kotlinVersion = kotlinVersion) |
||||||
|
) |
||||||
|
) { |
||||||
|
gradle(":compileKotlinJs").build().checks { check -> |
||||||
|
check.taskOutcome(":compileKotlinJs", TaskOutcome.SUCCESS) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,5 +1,4 @@ |
|||||||
COMPOSE_CORE_VERSION=1.2.0-beta02 |
compose.version=1.2.0-beta02 |
||||||
COMPOSE_WEB_VERSION=1.2.0-beta02 |
|
||||||
compose.web.buildSamples=false |
compose.web.buildSamples=false |
||||||
compose.web.tests.integration.withFirefox |
compose.web.tests.integration.withFirefox |
||||||
compose.web.tests.skip.benchmarks=false |
compose.web.tests.skip.benchmarks=false |
||||||
|
Loading…
Reference in new issue