Scripting: update scripts in source roots handling

#KT-52525 fixed
related to #KT-52735
This commit is contained in:
Ilya Chernikov
2022-05-27 16:31:11 +02:00
committed by teamcity
parent b2b13a0247
commit 855059b93c
21 changed files with 182 additions and 17 deletions
@@ -415,6 +415,9 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
@Argument(value = "-Xrender-internal-diagnostic-names", description = "Render internal names of warnings and errors")
var renderInternalDiagnosticNames: Boolean by FreezableVar(false)
@Argument(value = "-Xallow-any-scripts-in-source-roots", description = "Allow to compile any scripts along with regular Kotlin sources")
var allowAnyScriptsInSourceRoots: Boolean by FreezableVar(false)
@OptIn(IDEAPluginsCompatibilityAPI::class)
open fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap<AnalysisFlag<*>, Any> {
return HashMap<AnalysisFlag<*>, Any>().apply {
@@ -508,6 +511,10 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
}
}
if (allowAnyScriptsInSourceRoots) {
put(LanguageFeature.SkipStandaloneScriptsInSourceRoots, LanguageFeature.State.DISABLED)
}
// Internal arguments should go last, because it may be useful to override
// some feature state via -XX (even if some -X flags were passed)
if (internalArguments.isNotEmpty()) {