[Gradle] Update test verifying MPP/Jvm project is working with Kapt
We have such test, but it was using long deprecated platform plugins. ^KT-61622 In Progress
This commit is contained in:
committed by
Space Team
parent
a2e148173d
commit
005e3c0939
+19
-4
@@ -950,13 +950,28 @@ open class Kapt3IT : Kapt3BaseIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@DisplayName("kapt works with old MPP")
|
||||
@DisplayName("Kapt with MPP/Jvm")
|
||||
@GradleTest
|
||||
open fun testMPPKaptPresence(gradleVersion: GradleVersion) {
|
||||
project("mpp-kapt-presence".withPrefix, gradleVersion) {
|
||||
project(
|
||||
"mpp-kapt-presence".withPrefix,
|
||||
gradleVersion,
|
||||
buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.DEBUG)
|
||||
) {
|
||||
|
||||
build("build") {
|
||||
assertTasksExecuted(":dac:jdk:kaptGenerateStubsKotlin", ":dac:jdk:compileKotlin")
|
||||
build(":dac:compileKotlinJvm") {
|
||||
assertTasksExecuted(
|
||||
":dac:kaptGenerateStubsKotlinJvm",
|
||||
":dac:kaptKotlinJvm",
|
||||
":dac:compileKotlinJvm"
|
||||
)
|
||||
|
||||
// KT-61622: checking if kapt tasks are getting common sources in default configuration
|
||||
val commonSources = arrayOf(
|
||||
"src/commonMain/kotlin/DocumentationService.kt",
|
||||
"src/commonMain/kotlin/Item.kt",
|
||||
)
|
||||
assertCompilerArguments(":dac:kaptGenerateStubsKotlinJvm", *commonSources)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -36,9 +36,6 @@ class Kapt4IT : Kapt3IT() {
|
||||
|
||||
@Disabled("Doesn't make sense in Kapt 4")
|
||||
override fun testRepeatableAnnotationsWithOldJvmBackend(gradleVersion: GradleVersion) {}
|
||||
|
||||
@Disabled("Doesn't work in 2.0. Neither with Kapt 3 nor with Kapt 4")
|
||||
override fun testMPPKaptPresence(gradleVersion: GradleVersion) {}
|
||||
}
|
||||
|
||||
@DisplayName("Kapt 4 with classloaders cache")
|
||||
|
||||
+3
-21
@@ -1,24 +1,6 @@
|
||||
buildscript {
|
||||
ext.deps = [
|
||||
'kotlin': [
|
||||
'stdlib': [
|
||||
'common': "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version",
|
||||
'jdk': "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
]
|
||||
],
|
||||
'other' : [
|
||||
'ap_example': "org.jetbrains.kotlin:annotation-processor-example:$kotlin_version"
|
||||
]
|
||||
]
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
plugins {
|
||||
id "org.jetbrains.kotlin.multiplatform" apply false
|
||||
id "org.jetbrains.kotlin.kapt" apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
|
||||
+12
-2
@@ -1,5 +1,15 @@
|
||||
apply plugin: 'org.jetbrains.kotlin.platform.common'
|
||||
plugins {
|
||||
id "org.jetbrains.kotlin.multiplatform"
|
||||
id "org.jetbrains.kotlin.kapt"
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
|
||||
jvm {
|
||||
withJava()
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation deps.kotlin.stdlib.common
|
||||
kapt "org.jetbrains.kotlin:annotation-processor-example:$kotlin_version"
|
||||
}
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
apply plugin: 'org.jetbrains.kotlin.platform.jvm'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
dependencies {
|
||||
expectedBy project(':dac')
|
||||
implementation deps.kotlin.stdlib.jdk
|
||||
kapt deps.other.ap_example
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package test.abc
|
||||
|
||||
actual interface DocumentationService {
|
||||
actual fun list(): List<Item>
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright 2010-2023 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.
|
||||
*/
|
||||
|
||||
package test.abc
|
||||
|
||||
actual interface DocumentationService {
|
||||
actual fun list(): List<Item>
|
||||
}
|
||||
Reference in New Issue
Block a user