JPS: Report "Cyclically dependent modules should have same compiler" as build error rather than exception
#KT-27285 Fixed
Original commit: 3c8b15ca54
This commit is contained in:
@@ -336,6 +336,14 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
val kotlinContext = context.kotlin
|
||||
val kotlinChunk = chunk.toKotlinChunk(context)!!
|
||||
|
||||
if (!kotlinChunk.haveSameCompiler) {
|
||||
messageCollector.report(
|
||||
ERROR,
|
||||
"Cyclically dependent modules ${kotlinChunk.presentableModulesToCompilersList} should have same compiler."
|
||||
)
|
||||
return ABORT
|
||||
}
|
||||
|
||||
if (representativeTarget is KotlinUnsupportedModuleBuildTarget) {
|
||||
val msg = "${representativeTarget.kind} is not yet supported in IDEA internal build system. " +
|
||||
"Please use Gradle to build ${kotlinChunk.presentableShortName}."
|
||||
|
||||
@@ -37,14 +37,10 @@ class KotlinChunk internal constructor(val context: KotlinCompileContext, val ta
|
||||
val representativeTarget
|
||||
get() = targets.first()
|
||||
|
||||
private val presentableModulesToCompilersList: String
|
||||
val presentableModulesToCompilersList: String
|
||||
get() = targets.joinToString { "${it.module.name} (${it.globalLookupCacheId})" }
|
||||
|
||||
init {
|
||||
check(targets.all { it.javaClass == representativeTarget.javaClass }) {
|
||||
"Cyclically dependent modules $presentableModulesToCompilersList should have same compiler."
|
||||
}
|
||||
}
|
||||
val haveSameCompiler = targets.all { it.javaClass == representativeTarget.javaClass }
|
||||
|
||||
private val defaultLanguageVersion = VersionView.RELEASED_VERSION
|
||||
|
||||
|
||||
Reference in New Issue
Block a user