Skip to content

Commit

Permalink
Test inputJar property overriding inputClassesDirs
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-g committed Oct 20, 2022
1 parent ea76222 commit c5408ed
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/functionalTest/kotlin/kotlinx/validation/test/InputJarTest.kt
@@ -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")
}
}
}
@@ -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
}

@@ -0,0 +1,9 @@
tasks {
jar {
exclude("foo/HiddenField.class")
exclude("foo/HiddenProperty.class")
}
apiBuild {
inputJar.value(jar.flatMap { it.archiveFile })
}
}

0 comments on commit c5408ed

Please sign in to comment.