From 1206cb6f57694641a1399a0aabf8891254e42550 Mon Sep 17 00:00:00 2001 From: Demyan Kimitsa Date: Tue, 16 Apr 2024 18:36:58 +0300 Subject: [PATCH] * idea: fixed -- manual adding of RoboVM SDK from File/Project structure (#781) ## 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() {