Add test for KT-55019
This commit is contained in:
committed by
Space Team
parent
c5469d5fb5
commit
ad6582160b
+39
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@file:Suppress("FunctionName")
|
||||
|
||||
package org.jetbrains.kotlin.gradle
|
||||
|
||||
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.targets
|
||||
import kotlin.test.Test
|
||||
|
||||
class KotlinJvmFunctionalTest {
|
||||
@Test
|
||||
fun `test setting dependencies via compilation dependency handler`() {
|
||||
val project = buildProjectWithJvm {
|
||||
kotlinExtension.apply {
|
||||
val jvmTarget = this.targets.singleOrNull() ?: error("Expected single target for Kotlin JVM extension")
|
||||
|
||||
jvmTarget.compilations.getByName("main").dependencies {
|
||||
api(files())
|
||||
implementation(files())
|
||||
compileOnly(files())
|
||||
runtimeOnly(files())
|
||||
}
|
||||
|
||||
jvmTarget.compilations.getByName("test").dependencies {
|
||||
api(files())
|
||||
implementation(files())
|
||||
compileOnly(files())
|
||||
runtimeOnly(files())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
project.evaluate()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user