MPP: Reset JDK for JVM modules
#KT-26937 Fixed
This commit is contained in:
@@ -227,8 +227,8 @@ private val CommonCompilerArguments.ignoredFields: List<String>
|
|||||||
private fun Module.configureSdkIfPossible(compilerArguments: CommonCompilerArguments, modelsProvider: IdeModifiableModelsProvider) {
|
private fun Module.configureSdkIfPossible(compilerArguments: CommonCompilerArguments, modelsProvider: IdeModifiableModelsProvider) {
|
||||||
val allSdks = ProjectJdkTable.getInstance().allJdks
|
val allSdks = ProjectJdkTable.getInstance().allJdks
|
||||||
val sdk = if (compilerArguments is K2JVMCompilerArguments) {
|
val sdk = if (compilerArguments is K2JVMCompilerArguments) {
|
||||||
val jdkHome = compilerArguments.jdkHome ?: return
|
val jdkHome = compilerArguments.jdkHome
|
||||||
allSdks.firstOrNull { it.sdkType is JavaSdk && FileUtil.comparePaths(it.homePath, jdkHome) == 0 } ?: return
|
allSdks.firstOrNull { it.sdkType is JavaSdk && FileUtil.comparePaths(it.homePath, jdkHome) == 0 }
|
||||||
} else {
|
} else {
|
||||||
allSdks.firstOrNull { it.sdkType is KotlinSdkType }
|
allSdks.firstOrNull { it.sdkType is KotlinSdkType }
|
||||||
?: modelsProvider
|
?: modelsProvider
|
||||||
|
|||||||
Reference in New Issue
Block a user