Fix gradle scripts detection in the sources

#KT-54325 fixed
This commit is contained in:
Ilya Chernikov
2022-10-27 13:49:58 +02:00
committed by Space Team
parent 2036b65b78
commit 5d968bc2f4
2 changed files with 4 additions and 2 deletions
@@ -157,7 +157,8 @@ private fun ScriptCompilationConfiguration.Builder.propertiesFromTemplate(
baseClass.replaceOnlyDefault(if (templateClass == baseClassType.fromClass) baseClassType else KotlinType(templateClass))
fileExtension.replaceOnlyDefault(mainAnnotation.fileExtension)
// TODO: remove this exception when gradle switches to the new definitions and sets the property accordingly
if (get(fileExtension) == "gradle.kts") {
// possible gradle script extensions - see PrecompiledScriptTemplates.kt in the gradle repository
if (get(fileExtension) in arrayOf("gradle.kts", "init.gradle.kts", "settings.gradle.kts")) {
isStandalone(false)
}
filePathPattern.replaceOnlyDefault(mainAnnotation.filePathPattern)
@@ -37,7 +37,8 @@ class ScriptCompilationConfigurationFromDefinition(
@Suppress("DEPRECATION")
compilerOptions.putIfAny(scriptDefinition.additionalCompilerArguments)
// TODO: remove this exception when gradle switches to the new definitions and sets the property accordingly
if (scriptDefinition.fileExtension == "gradle.kts") {
// possible gradle script extensions - see PrecompiledScriptTemplates.kt in the gradle repository
if (get(fileExtension) in arrayOf("gradle.kts", "init.gradle.kts", "settings.gradle.kts")) {
isStandalone(false)
}
ide {