forked from Kotlin/binary-compatibility-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test inputJar property overriding inputClassesDirs
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/functionalTest/kotlin/kotlinx/validation/test/InputJarTest.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,39 @@ | ||
/* | ||
* Copyright 2016-2022 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.junit.* | ||
|
||
class InputJarTest : BaseKotlinGradleTest() { | ||
|
||
@Test | ||
fun testOverrideInputJar() { | ||
val runner = test { | ||
buildGradleKts { | ||
resolve("examples/gradle/base/withPlugin.gradle.kts") | ||
resolve("examples/gradle/configuration/jarAsInput/inputJar.gradle.kts") | ||
} | ||
|
||
kotlin("Properties.kt") { | ||
resolve("examples/classes/Properties.kt") | ||
} | ||
|
||
apiFile(projectName = rootProjectDir.name) { | ||
resolve("examples/classes/PropertiesJarTransformed.dump") | ||
} | ||
|
||
runner { | ||
arguments.add(":apiCheck") | ||
} | ||
} | ||
|
||
runner.build().apply { | ||
assertTaskSuccess(":jar") | ||
assertTaskSuccess(":apiCheck") | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/functionalTest/resources/examples/classes/PropertiesJarTransformed.dump
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,8 @@ | ||
public final class foo/ClassWithProperties { | ||
public fun <init> ()V | ||
public final fun getBar1 ()I | ||
public final fun getBar2 ()I | ||
public final fun setBar1 (I)V | ||
public final fun setBar2 (I)V | ||
} | ||
|
9 changes: 9 additions & 0 deletions
9
src/functionalTest/resources/examples/gradle/configuration/jarAsInput/inputJar.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,9 @@ | ||
tasks { | ||
jar { | ||
exclude("foo/HiddenField.class") | ||
exclude("foo/HiddenProperty.class") | ||
} | ||
apiBuild { | ||
inputJar.value(jar.flatMap { it.archiveFile }) | ||
} | ||
} |