-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
660 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
version=0.15.0-SNAPSHOT | ||
version=0.16.4-SNAPSHOT | ||
|
||
kotlin.stdlib.default.dependency=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
src/functionalTest/kotlin/kotlinx/validation/test/GradleCompatibilityTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Copyright 2016-2024 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
package kotlinx.validation.test | ||
|
||
import kotlinx.validation.api.* | ||
import org.assertj.core.api.Assertions | ||
import org.gradle.testkit.runner.GradleRunner | ||
import org.junit.Assume | ||
import org.junit.Test | ||
import kotlin.test.assertTrue | ||
|
||
class GradleCompatibilityTest : BaseKotlinGradleTest() { | ||
|
||
@Test | ||
fun test8Dot0() { | ||
checkDumpWithGradle("8.0") | ||
} | ||
|
||
@Test | ||
fun test7Dot0() { | ||
checkDumpWithGradle("7.0") | ||
} | ||
|
||
@Test | ||
fun testMin() { | ||
val runner = test(gradleVersion = "6.1.1", injectPluginClasspath = false) { | ||
buildGradleKts { | ||
resolve("/examples/gradle/base/withPluginMinKotlin.gradle.kts") | ||
} | ||
kotlin("AnotherBuildConfig.kt") { | ||
resolve("/examples/classes/AnotherBuildConfig.kt") | ||
} | ||
|
||
runner(withConfigurationCache = false) { | ||
arguments.add(":apiDump") | ||
} | ||
} | ||
|
||
skipInDebug(runner) | ||
|
||
runner.build().apply { | ||
assertTaskSuccess(":apiDump") | ||
|
||
assertTrue(rootProjectApiDump.exists(), "api dump file should exist") | ||
|
||
val expected = readFileList("/examples/classes/AnotherBuildConfig.dump") | ||
Assertions.assertThat(rootProjectApiDump.readText()).isEqualToIgnoringNewLines(expected) | ||
} | ||
} | ||
|
||
private fun skipInDebug(runner: GradleRunner) { | ||
Assume.assumeFalse( | ||
"The test requires a separate Gradle distributive " + | ||
"so it could not be executed with debug turned on.", | ||
runner.isDebug | ||
) | ||
} | ||
|
||
private fun checkDumpWithGradle(gradleVersion: String) { | ||
val runner = test(gradleVersion = gradleVersion, injectPluginClasspath = false) { | ||
buildGradleKts { | ||
resolve("/examples/gradle/base/withPlugin.gradle.kts") | ||
} | ||
kotlin("AnotherBuildConfig.kt") { | ||
resolve("/examples/classes/AnotherBuildConfig.kt") | ||
} | ||
|
||
runner { | ||
arguments.add(":apiDump") | ||
} | ||
} | ||
|
||
skipInDebug(runner) | ||
|
||
runner.build().apply { | ||
assertTaskSuccess(":apiDump") | ||
|
||
assertTrue(rootProjectApiDump.exists(), "api dump file should exist") | ||
|
||
val expected = readFileList("/examples/classes/AnotherBuildConfig.dump") | ||
Assertions.assertThat(rootProjectApiDump.readText()).isEqualToIgnoringNewLines(expected) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/functionalTest/resources/examples/gradle/base/withNativePluginK2.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright 2016-2023 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
plugins { | ||
kotlin("multiplatform") version "2.0.0" | ||
id("org.jetbrains.kotlinx.binary-compatibility-validator") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kotlin { | ||
linuxX64() | ||
linuxArm64() | ||
mingwX64() | ||
androidNativeArm32() | ||
androidNativeArm64() | ||
androidNativeX64() | ||
androidNativeX86() | ||
|
||
sourceSets { | ||
val commonMain by getting | ||
val commonTest by getting { | ||
dependencies { | ||
implementation(kotlin("stdlib")) | ||
implementation(kotlin("test-common")) | ||
implementation(kotlin("test-annotations-common")) | ||
} | ||
} | ||
} | ||
} | ||
|
||
apiValidation { | ||
klib.enabled = true | ||
} |
17 changes: 17 additions & 0 deletions
17
src/functionalTest/resources/examples/gradle/base/withPluginK2.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright 2016-2020 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
plugins { | ||
kotlin("jvm") version "2.0.0" | ||
id("org.jetbrains.kotlinx.binary-compatibility-validator") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(kotlin("stdlib-jdk8")) | ||
} |
17 changes: 17 additions & 0 deletions
17
src/functionalTest/resources/examples/gradle/base/withPluginMinKotlin.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright 2016-2020 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
plugins { | ||
kotlin("jvm") version "1.6.20" | ||
id("org.jetbrains.kotlinx.binary-compatibility-validator") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(kotlin("stdlib-jdk8")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.