diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/diagnosticsRenderingSmoke/expectedOutput.txt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/diagnosticsRenderingSmoke/expectedOutput.txt index 24117776056..23f856d8266 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/diagnosticsRenderingSmoke/expectedOutput.txt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/diagnosticsRenderingSmoke/expectedOutput.txt @@ -9,13 +9,15 @@ Read the details here: https://kotlinlang.org/docs/multiplatform-compatibility-g e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare dependsOn on other source sets #diagnostic-end -w: [KotlinDefaultHierarchyFallbackDependsOnUsageDetected | WARNING] The Default Kotlin Hierarchy was not applied to 'project ':subprojectA'': -Manual .dependsOn() edges were configured for the following source sets: +w: [KotlinDefaultHierarchyFallbackDependsOnUsageDetected | WARNING] The Default Kotlin Hierarchy Template was not applied to 'project ':subprojectA'': +Explicit .dependsOn() edges were configured for the following source sets: [commonMain] -To suppress the 'Default Hierarchy Template' add +Consider removing dependsOn-calls or disabling the default template by adding 'kotlin.mpp.applyDefaultHierarchyTemplate=false' to your gradle.properties + +Learn more about hierarchy templates: https://kotl.in/hierarchy-template #diagnostic-end @@ -23,13 +25,15 @@ to your gradle.properties e: [CommonMainOrTestWithDependsOnDiagnostic | ERROR] commonMain can't declare dependsOn on other source sets #diagnostic-end -w: [KotlinDefaultHierarchyFallbackDependsOnUsageDetected | WARNING] The Default Kotlin Hierarchy was not applied to 'project ':subprojectB'': -Manual .dependsOn() edges were configured for the following source sets: +w: [KotlinDefaultHierarchyFallbackDependsOnUsageDetected | WARNING] The Default Kotlin Hierarchy Template was not applied to 'project ':subprojectB'': +Explicit .dependsOn() edges were configured for the following source sets: [commonMain] -To suppress the 'Default Hierarchy Template' add +Consider removing dependsOn-calls or disabling the default template by adding 'kotlin.mpp.applyDefaultHierarchyTemplate=false' to your gradle.properties + +Learn more about hierarchy templates: https://kotl.in/hierarchy-template #diagnostic-end w: [UnusedSourceSetsWarning | WARNING] The Kotlin source set unusedCreatedInAfterEvaluate was configured but not added to any Kotlin compilation. diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/diagnostics/KotlinToolingDiagnostics.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/diagnostics/KotlinToolingDiagnostics.kt index c6fb41ca681..806f9e2d045 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/diagnostics/KotlinToolingDiagnostics.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/diagnostics/KotlinToolingDiagnostics.kt @@ -215,7 +215,7 @@ object KotlinToolingDiagnostics { """ The 'org.jetbrains.kotlin.platform.*' plugins are no longer available. Please migrate the project to the 'org.jetbrains.kotlin.multiplatform' plugin. - See: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html + See: https://kotl.in/legacy-multiplatform-plugins """.trimIndent() ) } @@ -327,7 +327,7 @@ object KotlinToolingDiagnostics { |kotlin { | js { | // To build distributions for and run tests on browser or Node.js use one or both of: - | ${availableEnvironments.joinToString(separator = "\n")} + | ${availableEnvironments.joinToString(separator = "\n ")} | } |} """.trimMargin() @@ -455,10 +455,10 @@ object KotlinToolingDiagnostics { | iosX64() | iosArm64() | iosSimulatorArm64() - | - | /* Use convention + | + | /* Use convention */ | sourceSets.${sourceSet.name}.dependencies { - | + | | } | } """.trimMargin(), @@ -469,13 +469,15 @@ object KotlinToolingDiagnostics { object KotlinDefaultHierarchyFallbackDependsOnUsageDetected : ToolingDiagnosticFactory(WARNING) { operator fun invoke(project: Project, sourceSetsWithDependsOnEdges: Iterable) = build( """ - The Default Kotlin Hierarchy was not applied to '${project.displayName}': - Manual .dependsOn() edges were configured for the following source sets: + The Default Kotlin Hierarchy Template was not applied to '${project.displayName}': + Explicit .dependsOn() edges were configured for the following source sets: ${sourceSetsWithDependsOnEdges.toSet().map { it.name }} - To suppress the 'Default Hierarchy Template' add + Consider removing dependsOn-calls or disabling the default template by adding '$KOTLIN_MPP_APPLY_DEFAULT_HIERARCHY_TEMPLATE=false' to your gradle.properties + + Learn more about hierarchy templates: https://kotl.in/hierarchy-template """.trimIndent() ) } @@ -483,14 +485,14 @@ object KotlinToolingDiagnostics { object KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected : ToolingDiagnosticFactory(WARNING) { internal operator fun invoke(project: Project, trace: NativeTargetShortcutTrace) = build( """ - The Default Kotlin Hierarchy was not applied to '${project.displayName}': + The Default Kotlin Hierarchy Template was not applied to '${project.displayName}': Deprecated '${trace.shortcut}()' shortcut was used: kotlin { ${trace.shortcut}() } - - Could be replaced by declaring the supported ${trace.shortcut} targets directly: + + Please declare the required targets explicitly: kotlin { ${trace.shortcut}X64() @@ -502,6 +504,8 @@ object KotlinToolingDiagnostics { To suppress the 'Default Hierarchy Template' add '$KOTLIN_MPP_APPLY_DEFAULT_HIERARCHY_TEMPLATE=false' to your gradle.properties + + Learn more about hierarchy templates: https://kotl.in/hierarchy-template """.trimIndent(), throwable = trace ) @@ -510,13 +514,15 @@ object KotlinToolingDiagnostics { object KotlinDefaultHierarchyFallbackIllegalTargetNames : ToolingDiagnosticFactory(WARNING) { operator fun invoke(project: Project, illegalTargetNamesUsed: Iterable) = build( """ - The Default Kotlin Hierarchy was not applied to '${project.displayName}': - Illegal target names were found: + The Default Kotlin Hierarchy Template was not applied to '${project.displayName}': + Source sets created by the following targets will clash with source sets created by the template: ${illegalTargetNamesUsed.toSet()} - To suppress the 'Default Hierarchy Template' add + Consider renaming the targets or disabling the default template by adding '$KOTLIN_MPP_APPLY_DEFAULT_HIERARCHY_TEMPLATE=false' to your gradle.properties + + Learn more about hierarchy templates: https://kotl.in/hierarchy-template """.trimIndent() ) } diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/AndroidSourceSetV1Deprecation.txt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/AndroidSourceSetV1Deprecation.txt index ac0372d7cf2..22ecd4525b1 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/AndroidSourceSetV1Deprecation.txt +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/AndroidSourceSetV1Deprecation.txt @@ -2,13 +2,15 @@ Learn how to migrate to the version 2 source set layout at: https://kotl.in/android-source-set-layout-v2 ---- -[KotlinDefaultHierarchyFallbackDependsOnUsageDetected | WARNING] The Default Kotlin Hierarchy was not applied to 'root project 'test'': -Manual .dependsOn() edges were configured for the following source sets: +[KotlinDefaultHierarchyFallbackDependsOnUsageDetected | WARNING] The Default Kotlin Hierarchy Template was not applied to 'root project 'test'': +Explicit .dependsOn() edges were configured for the following source sets: [androidAndroidTest, androidMain, androidTest] -To suppress the 'Default Hierarchy Template' add +Consider removing dependsOn-calls or disabling the default template by adding 'kotlin.mpp.applyDefaultHierarchyTemplate=false' to your gradle.properties + +Learn more about hierarchy templates: https://kotl.in/hierarchy-template ---- [KotlinSourceSetTreeDependsOnMismatch | WARNING] Kotlin Source Set 'androidAndroidTest' can't depend on 'commonTest' as they are from different Source Set Trees. -Please remove this dependency edge. \ No newline at end of file +Please remove this dependency edge. diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/IosSourceSetConventionUsedWithoutIosTarget.txt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/IosSourceSetConventionUsedWithoutIosTarget.txt index bdc91933998..12fad928d8f 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/IosSourceSetConventionUsedWithoutIosTarget.txt +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/IosSourceSetConventionUsedWithoutIosTarget.txt @@ -5,7 +5,7 @@ iosArm64() iosSimulatorArm64() - /* Use convention + /* Use convention */ sourceSets.iosMain.dependencies { } @@ -18,7 +18,7 @@ iosArm64() iosSimulatorArm64() - /* Use convention + /* Use convention */ sourceSets.iosTest.dependencies { } diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackDependsOnUsageDetected.txt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackDependsOnUsageDetected.txt index 45fd7c441a4..5628990a3da 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackDependsOnUsageDetected.txt +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackDependsOnUsageDetected.txt @@ -1,7 +1,9 @@ -[KotlinDefaultHierarchyFallbackDependsOnUsageDetected | WARNING] The Default Kotlin Hierarchy was not applied to 'root project 'test'': -Manual .dependsOn() edges were configured for the following source sets: +[KotlinDefaultHierarchyFallbackDependsOnUsageDetected | WARNING] The Default Kotlin Hierarchy Template was not applied to 'root project 'test'': +Explicit .dependsOn() edges were configured for the following source sets: [intermediateMain, jvmMain] -To suppress the 'Default Hierarchy Template' add +Consider removing dependsOn-calls or disabling the default template by adding 'kotlin.mpp.applyDefaultHierarchyTemplate=false' -to your gradle.properties \ No newline at end of file +to your gradle.properties + +Learn more about hierarchy templates: https://kotl.in/hierarchy-template diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackIllegalTargetNames.txt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackIllegalTargetNames.txt index 6993ac5cbda..f536b4d220c 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackIllegalTargetNames.txt +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackIllegalTargetNames.txt @@ -1,7 +1,9 @@ -[KotlinDefaultHierarchyFallbackIllegalTargetNames | WARNING] The Default Kotlin Hierarchy was not applied to 'root project 'test'': -Illegal target names were found: +[KotlinDefaultHierarchyFallbackIllegalTargetNames | WARNING] The Default Kotlin Hierarchy Template was not applied to 'root project 'test'': +Source sets created by the following targets will clash with source sets created by the template: [Native, linux] -To suppress the 'Default Hierarchy Template' add +Consider renaming the targets or disabling the default template by adding 'kotlin.mpp.applyDefaultHierarchyTemplate=false' -to your gradle.properties \ No newline at end of file +to your gradle.properties + +Learn more about hierarchy templates: https://kotl.in/hierarchy-template diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-ios.txt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-ios.txt index ec50ad10542..c9c98af6109 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-ios.txt +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-ios.txt @@ -1,11 +1,11 @@ -[KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected | WARNING] The Default Kotlin Hierarchy was not applied to 'root project 'test'': +[KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected | WARNING] The Default Kotlin Hierarchy Template was not applied to 'root project 'test'': Deprecated 'ios()' shortcut was used: kotlin { ios() } -Could be replaced by declaring the supported ios targets directly: +Please declare the required targets explicitly: kotlin { iosX64() @@ -17,3 +17,5 @@ Could be replaced by declaring the supported ios targets directly: To suppress the 'Default Hierarchy Template' add 'kotlin.mpp.applyDefaultHierarchyTemplate=false' to your gradle.properties + +Learn more about hierarchy templates: https://kotl.in/hierarchy-template diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-tvos.txt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-tvos.txt index 5f12d6dd4a0..e3a8a7ba7c8 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-tvos.txt +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-tvos.txt @@ -1,11 +1,11 @@ -[KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected | WARNING] The Default Kotlin Hierarchy was not applied to 'root project 'test'': +[KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected | WARNING] The Default Kotlin Hierarchy Template was not applied to 'root project 'test'': Deprecated 'tvos()' shortcut was used: kotlin { tvos() } -Could be replaced by declaring the supported tvos targets directly: +Please declare the required targets explicitly: kotlin { tvosX64() @@ -17,3 +17,5 @@ Could be replaced by declaring the supported tvos targets directly: To suppress the 'Default Hierarchy Template' add 'kotlin.mpp.applyDefaultHierarchyTemplate=false' to your gradle.properties + +Learn more about hierarchy templates: https://kotl.in/hierarchy-template diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-watchos.txt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-watchos.txt index e6139eedbd1..e595e3b3149 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-watchos.txt +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/resources/expectedDiagnostics/KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected-watchos.txt @@ -1,11 +1,11 @@ -[KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected | WARNING] The Default Kotlin Hierarchy was not applied to 'root project 'test'': +[KotlinDefaultHierarchyFallbackNativeTargetShortcutUsageDetected | WARNING] The Default Kotlin Hierarchy Template was not applied to 'root project 'test'': Deprecated 'watchos()' shortcut was used: kotlin { watchos() } -Could be replaced by declaring the supported watchos targets directly: +Please declare the required targets explicitly: kotlin { watchosX64() @@ -17,3 +17,5 @@ Could be replaced by declaring the supported watchos targets directly: To suppress the 'Default Hierarchy Template' add 'kotlin.mpp.applyDefaultHierarchyTemplate=false' to your gradle.properties + +Learn more about hierarchy templates: https://kotl.in/hierarchy-template