Skip to content

Commit c5408ed

Browse files
committed
Test inputJar property overriding inputClassesDirs
1 parent ea76222 commit c5408ed

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2016-2022 JetBrains s.r.o.
3+
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
4+
*/
5+
6+
package kotlinx.validation.test
7+
8+
import kotlinx.validation.api.*
9+
import org.junit.*
10+
11+
class InputJarTest : BaseKotlinGradleTest() {
12+
13+
@Test
14+
fun testOverrideInputJar() {
15+
val runner = test {
16+
buildGradleKts {
17+
resolve("examples/gradle/base/withPlugin.gradle.kts")
18+
resolve("examples/gradle/configuration/jarAsInput/inputJar.gradle.kts")
19+
}
20+
21+
kotlin("Properties.kt") {
22+
resolve("examples/classes/Properties.kt")
23+
}
24+
25+
apiFile(projectName = rootProjectDir.name) {
26+
resolve("examples/classes/PropertiesJarTransformed.dump")
27+
}
28+
29+
runner {
30+
arguments.add(":apiCheck")
31+
}
32+
}
33+
34+
runner.build().apply {
35+
assertTaskSuccess(":jar")
36+
assertTaskSuccess(":apiCheck")
37+
}
38+
}
39+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public final class foo/ClassWithProperties {
2+
public fun <init> ()V
3+
public final fun getBar1 ()I
4+
public final fun getBar2 ()I
5+
public final fun setBar1 (I)V
6+
public final fun setBar2 (I)V
7+
}
8+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
tasks {
2+
jar {
3+
exclude("foo/HiddenField.class")
4+
exclude("foo/HiddenProperty.class")
5+
}
6+
apiBuild {
7+
inputJar.value(jar.flatMap { it.archiveFile })
8+
}
9+
}

0 commit comments

Comments
 (0)