[Gradle] Minor, rename task
EnsureNoKotlinGradlePluginErrors -> CheckKotlinGradlePluginConfigurationErrors
This commit is contained in:
committed by
Space Team
parent
7cc72f096a
commit
a65953a7fb
+1
-1
@@ -3,6 +3,6 @@ e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare de
|
|||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|
||||||
|
|
||||||
> Task :ensureNoKotlinGradlePluginErrors FAILED
|
> Task :checkKotlinGradlePluginConfigurationErrors FAILED
|
||||||
e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare dependsOn on other source sets
|
e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare dependsOn on other source sets
|
||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
> Task :ensureNoKotlinGradlePluginErrors FAILED
|
> Task :checkKotlinGradlePluginConfigurationErrors FAILED
|
||||||
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|||||||
+1
-1
@@ -3,6 +3,6 @@ e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotli
|
|||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|
||||||
|
|
||||||
> Task :ensureNoKotlinGradlePluginErrors FAILED
|
> Task :checkKotlinGradlePluginConfigurationErrors FAILED
|
||||||
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|||||||
+1
-1
@@ -12,6 +12,6 @@ e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare de
|
|||||||
|
|
||||||
> Configure project :healthyProject
|
> Configure project :healthyProject
|
||||||
|
|
||||||
> Task :brokenProjectA:ensureNoKotlinGradlePluginErrors FAILED
|
> Task :brokenProjectA:checkKotlinGradlePluginConfigurationErrors FAILED
|
||||||
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|||||||
+1
-1
@@ -12,6 +12,6 @@ e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare de
|
|||||||
|
|
||||||
> Configure project :healthyProject
|
> Configure project :healthyProject
|
||||||
|
|
||||||
> Task :brokenProjectB:ensureNoKotlinGradlePluginErrors FAILED
|
> Task :brokenProjectB:checkKotlinGradlePluginConfigurationErrors FAILED
|
||||||
e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare dependsOn on other source sets
|
e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare dependsOn on other source sets
|
||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|||||||
+1
-1
@@ -12,4 +12,4 @@ e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare de
|
|||||||
|
|
||||||
> Configure project :healthyProject
|
> Configure project :healthyProject
|
||||||
|
|
||||||
> Task :healthyProject:ensureNoKotlinGradlePluginErrors
|
> Task :healthyProject:checkKotlinGradlePluginConfigurationErrors
|
||||||
|
|||||||
+3
-3
@@ -12,14 +12,14 @@ e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare de
|
|||||||
|
|
||||||
> Configure project :healthyProject
|
> Configure project :healthyProject
|
||||||
|
|
||||||
> Task :brokenProjectA:ensureNoKotlinGradlePluginErrors FAILED
|
> Task :brokenProjectA:checkKotlinGradlePluginConfigurationErrors FAILED
|
||||||
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|
||||||
|
|
||||||
> Task :brokenProjectB:ensureNoKotlinGradlePluginErrors FAILED
|
> Task :brokenProjectB:checkKotlinGradlePluginConfigurationErrors FAILED
|
||||||
e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare dependsOn on other source sets
|
e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare dependsOn on other source sets
|
||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|
||||||
|
|
||||||
> Task :healthyProject:ensureNoKotlinGradlePluginErrors
|
> Task :healthyProject:checkKotlinGradlePluginConfigurationErrors
|
||||||
|
|||||||
+1
-1
@@ -12,6 +12,6 @@ e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare de
|
|||||||
|
|
||||||
> Configure project :healthyProject
|
> Configure project :healthyProject
|
||||||
|
|
||||||
> Task :brokenProjectA:ensureNoKotlinGradlePluginErrors FAILED
|
> Task :brokenProjectA:checkKotlinGradlePluginConfigurationErrors FAILED
|
||||||
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
e: [DeprecatedKotlinNativeTargetsDiagnostic | ERROR] The following removed Kotlin/Native targets were used in the project: linuxMips32
|
||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|||||||
+1
-1
@@ -9,4 +9,4 @@ Stability and future compatibility of the build is not guaranteed.
|
|||||||
#diagnostic-end
|
#diagnostic-end
|
||||||
|
|
||||||
|
|
||||||
> Task :ensureNoKotlinGradlePluginErrors
|
> Task :checkKotlinGradlePluginConfigurationErrors
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
> Configure project :
|
> Configure project :
|
||||||
|
|
||||||
> Task :ensureNoKotlinGradlePluginErrors
|
> Task :checkKotlinGradlePluginConfigurationErrors
|
||||||
|
|||||||
+1
-2
@@ -33,7 +33,6 @@ import org.jetbrains.kotlin.gradle.internal.KOTLIN_MODULE_GROUP
|
|||||||
import org.jetbrains.kotlin.gradle.logging.kotlinDebug
|
import org.jetbrains.kotlin.gradle.logging.kotlinDebug
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformAndroidGradlePluginCompatibilityHealthCheck.runMultiplatformAndroidGradlePluginCompatibilityHealthCheckWhenAndroidIsApplied
|
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformAndroidGradlePluginCompatibilityHealthCheck.runMultiplatformAndroidGradlePluginCompatibilityHealthCheckWhenAndroidIsApplied
|
||||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.*
|
import org.jetbrains.kotlin.gradle.plugin.diagnostics.*
|
||||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.EnsureNoKotlinGradlePluginErrors
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.ToolingDiagnosticRenderingOptions
|
import org.jetbrains.kotlin.gradle.plugin.diagnostics.ToolingDiagnosticRenderingOptions
|
||||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.UsesKotlinToolingDiagnostics
|
import org.jetbrains.kotlin.gradle.plugin.diagnostics.UsesKotlinToolingDiagnostics
|
||||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.kotlinToolingDiagnosticsCollectorProvider
|
import org.jetbrains.kotlin.gradle.plugin.diagnostics.kotlinToolingDiagnosticsCollectorProvider
|
||||||
@@ -287,7 +286,7 @@ private fun Project.setupDiagnosticsChecksAndReporting() {
|
|||||||
launchKotlinGradleProjectCheckers()
|
launchKotlinGradleProjectCheckers()
|
||||||
|
|
||||||
// Setup a task that will abort the build if errors will be reported. This task should be the first in the taskgraph
|
// Setup a task that will abort the build if errors will be reported. This task should be the first in the taskgraph
|
||||||
project.locateOrRegisterEnsureNoKotlinGradlePluginErrors()
|
project.locateOrRegisterCheckKotlinGradlePluginErrorsTask()
|
||||||
|
|
||||||
// Schedule diagnostics rendering
|
// Schedule diagnostics rendering
|
||||||
launch {
|
launch {
|
||||||
|
|||||||
+6
-6
@@ -19,7 +19,7 @@ import org.jetbrains.kotlin.gradle.tasks.withType
|
|||||||
@DisableCachingByDefault(
|
@DisableCachingByDefault(
|
||||||
because = "This task renders reported diagnostics; caching this task will hide diagnostics and obscure issues in the build"
|
because = "This task renders reported diagnostics; caching this task will hide diagnostics and obscure issues in the build"
|
||||||
)
|
)
|
||||||
internal abstract class EnsureNoKotlinGradlePluginErrors : DefaultTask() {
|
internal abstract class CheckKotlinGradlePluginConfigurationErrors : DefaultTask() {
|
||||||
@get:Input
|
@get:Input
|
||||||
abstract val errorDiagnostics: ListProperty<ToolingDiagnostic>
|
abstract val errorDiagnostics: ListProperty<ToolingDiagnostic>
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ internal abstract class EnsureNoKotlinGradlePluginErrors : DefaultTask() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
internal const val TASK_NAME = "ensureNoKotlinGradlePluginErrors"
|
internal const val TASK_NAME = "checkKotlinGradlePluginConfigurationErrors"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,10 +43,10 @@ private const val DESCRIPTION =
|
|||||||
"Checks that Kotlin Gradle Plugin hasn't reported project configuration errors, failing otherwise. " +
|
"Checks that Kotlin Gradle Plugin hasn't reported project configuration errors, failing otherwise. " +
|
||||||
"This task always runs before compileKotlin* or similar tasks."
|
"This task always runs before compileKotlin* or similar tasks."
|
||||||
|
|
||||||
internal fun Project.locateOrRegisterEnsureNoKotlinGradlePluginErrors(): TaskProvider<EnsureNoKotlinGradlePluginErrors> {
|
internal fun Project.locateOrRegisterCheckKotlinGradlePluginErrorsTask(): TaskProvider<CheckKotlinGradlePluginConfigurationErrors> {
|
||||||
val taskProvider = tasks.register(
|
val taskProvider = tasks.register(
|
||||||
EnsureNoKotlinGradlePluginErrors.TASK_NAME,
|
CheckKotlinGradlePluginConfigurationErrors.TASK_NAME,
|
||||||
EnsureNoKotlinGradlePluginErrors::class.java
|
CheckKotlinGradlePluginConfigurationErrors::class.java
|
||||||
) { task ->
|
) { task ->
|
||||||
task.errorDiagnostics.set(
|
task.errorDiagnostics.set(
|
||||||
provider {
|
provider {
|
||||||
@@ -74,6 +74,6 @@ internal fun Project.locateOrRegisterEnsureNoKotlinGradlePluginErrors(): TaskPro
|
|||||||
* The intuition here is that if the build manages to do something useful for a user without compiling any .kt-sources,
|
* The intuition here is that if the build manages to do something useful for a user without compiling any .kt-sources,
|
||||||
* then it's OK for KGP to let that build pass even if it reported ERROR-diagnostics.
|
* then it's OK for KGP to let that build pass even if it reported ERROR-diagnostics.
|
||||||
*/
|
*/
|
||||||
private fun TaskProvider<EnsureNoKotlinGradlePluginErrors>.addDependsOnFromTasksThatShouldFailWhenErrorsReported(tasks: TaskContainer) {
|
private fun TaskProvider<CheckKotlinGradlePluginConfigurationErrors>.addDependsOnFromTasksThatShouldFailWhenErrorsReported(tasks: TaskContainer) {
|
||||||
tasks.withType<KotlinCompileTool>().configureEach { it.dependsOn(this) }
|
tasks.withType<KotlinCompileTool>().configureEach { it.dependsOn(this) }
|
||||||
}
|
}
|
||||||
+2
-2
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.gradle.internals
|
|||||||
import org.jetbrains.kotlin.compilerRunner.asFinishLogMessage
|
import org.jetbrains.kotlin.compilerRunner.asFinishLogMessage
|
||||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_NATIVE_IGNORE_DISABLED_TARGETS
|
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_NATIVE_IGNORE_DISABLED_TARGETS
|
||||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.DIAGNOSTIC_SEPARATOR
|
import org.jetbrains.kotlin.gradle.plugin.diagnostics.DIAGNOSTIC_SEPARATOR
|
||||||
import org.jetbrains.kotlin.gradle.plugin.diagnostics.EnsureNoKotlinGradlePluginErrors
|
import org.jetbrains.kotlin.gradle.plugin.diagnostics.CheckKotlinGradlePluginConfigurationErrors
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinProjectStructureMetadata
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinProjectStructureMetadata
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.MULTIPLATFORM_PROJECT_METADATA_JSON_FILE_NAME
|
import org.jetbrains.kotlin.gradle.plugin.mpp.MULTIPLATFORM_PROJECT_METADATA_JSON_FILE_NAME
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.parseKotlinSourceSetMetadataFromJson
|
import org.jetbrains.kotlin.gradle.plugin.mpp.parseKotlinSourceSetMetadataFromJson
|
||||||
@@ -22,7 +22,7 @@ val KOTLIN_NATIVE_IGNORE_DISABLED_TARGETS_PROPERTY = KOTLIN_NATIVE_IGNORE_DISABL
|
|||||||
|
|
||||||
const val VERBOSE_DIAGNOSTIC_SEPARATOR = DIAGNOSTIC_SEPARATOR
|
const val VERBOSE_DIAGNOSTIC_SEPARATOR = DIAGNOSTIC_SEPARATOR
|
||||||
|
|
||||||
const val ENSURE_NO_KOTLIN_GRADLE_PLUGIN_ERRORS_TASK_NAME = EnsureNoKotlinGradlePluginErrors.TASK_NAME
|
const val ENSURE_NO_KOTLIN_GRADLE_PLUGIN_ERRORS_TASK_NAME = CheckKotlinGradlePluginConfigurationErrors.TASK_NAME
|
||||||
|
|
||||||
val KotlinCompilerExecutionStrategy.asFinishLogMessage: String
|
val KotlinCompilerExecutionStrategy.asFinishLogMessage: String
|
||||||
get() = this.asFinishLogMessage
|
get() = this.asFinishLogMessage
|
||||||
|
|||||||
Reference in New Issue
Block a user