From d3cdc81ae40b355d59fedfa523030c0bae888aa9 Mon Sep 17 00:00:00 2001 From: dkimitsa Date: Tue, 16 Apr 2024 18:29:25 +0300 Subject: [PATCH] * idea: fixed -- manual adding of RoboVM SDK from File/Project structure ## Fix: - It was failing due version was not returned - SDK paths were configured not on Writable scope --- .../main/java/org/robovm/idea/sdk/RoboVmSdkType.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/idea/src/main/java/org/robovm/idea/sdk/RoboVmSdkType.java b/plugins/idea/src/main/java/org/robovm/idea/sdk/RoboVmSdkType.java index 613ed88d3..f744e0e56 100755 --- a/plugins/idea/src/main/java/org/robovm/idea/sdk/RoboVmSdkType.java +++ b/plugins/idea/src/main/java/org/robovm/idea/sdk/RoboVmSdkType.java @@ -75,6 +75,13 @@ public String suggestSdkName(String currentSdkName, String sdkHome) { return SDK_NAME + " " + Version.getCompilerVersion(); } + @Override + public @Nullable String getVersionString(@NotNull String sdkHome) { + if (sdkHome.equals(suggestHomePath())) + return Version.getCompilerVersion(); + else return null; + } + @Nullable @Override public AdditionalDataConfigurable createAdditionalDataConfigurable(@NotNull SdkModel sdkModel, @NotNull SdkModificator sdkModificator) { @@ -123,7 +130,9 @@ private void setupSdkRoots(Sdk sdk) { sdkModificator.setHomePath(RoboVmPlugin.getSdkHome().getAbsolutePath()); // commit changes and let IDEA handle the rest - sdkModificator.commitChanges(); + ApplicationManager.getApplication().invokeAndWait(() -> + ApplicationManager.getApplication().runWriteAction(sdkModificator::commitChanges) + ); } public static void createSdkIfNotExists() {