[Gradle] Add expected K2 Kapt fallback warning

#KT-60588 In Progress
This commit is contained in:
Alexander.Likhachev
2023-08-18 16:31:08 +02:00
committed by Space Team
parent 3177df9ad8
commit c6b1d37476
5 changed files with 15 additions and 3 deletions
@@ -69,7 +69,9 @@ class BuildCacheRelocationIT : KGPBaseTest() {
secondProject,
listOf(":classes", ":testClasses"),
listOf(":kaptKotlin", ":kaptGenerateStubsKotlin", ":compileKotlin", ":compileTestKotlin", ":compileJava")
)
) {
assertNoBuildWarnings(expectedK2KaptWarnings)
}
}
@JsGradlePluginTests
@@ -294,16 +296,19 @@ class BuildCacheRelocationIT : KGPBaseTest() {
firstProject: TestProject,
secondProject: TestProject,
tasksToExecute: List<String>,
cacheableTasks: List<String>
cacheableTasks: List<String>,
additionalAssertions: BuildResult.() -> Unit = {},
) {
firstProject.build(*tasksToExecute.toTypedArray()) {
assertTasksPackedToCache(*cacheableTasks.toTypedArray())
additionalAssertions()
}
firstProject.build("clean")
secondProject.build(*tasksToExecute.toTypedArray()) {
assertTasksFromCache(*cacheableTasks.toTypedArray())
additionalAssertions()
}
}
@@ -76,6 +76,7 @@ class BuildServiceDeclarationIT : KGPBaseTest() {
enableStableConfigurationCachePreview()
build("build") {
assertOutputDoesNotContainBuildServiceDeclarationWarnings()
assertNoBuildWarnings(expectedK2KaptWarnings)
}
}
}
@@ -70,6 +70,7 @@ class UnnamedTaskInputsIT : KGPBaseTest() {
build("assemble") {
assertNoUnnamedInputsOutputs()
assertNoBuildWarnings(expectedK2KaptWarnings)
}
}
}
@@ -172,6 +172,11 @@ fun BuildResult.assertNoBuildWarnings(
}
}
val expectedK2KaptWarnings = setOf(
"w: [InternalKotlinGradlePluginPropertiesUsed | WARNING] ATTENTION! This build uses the following Kotlin Gradle Plugin properties:",
"w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9."
)
/**
* Asserts compilation is running via Kotlin daemon with given jvm arguments.
*/
@@ -19,5 +19,5 @@ dependencies {
}
tasks.named("compileKotlin", KotlinJvmCompile) {
compilerOptions.allWarningsAsErrors = true
compilerOptions.allWarningsAsErrors = false // compilation with LV=2.0 prints warning about kapt fallback
}