Skip to content

Commit

Permalink
* idea plugin: maintenance - 2024.1 eap support (MobiVM#769)
Browse files Browse the repository at this point in the history
* * idea plugin: maintenance - 2024.1 eap support
- commons-compress version updated as Idea bundles recent one with API not compatible
- removed dropped api (`startInTransaction`);
- handled `getActionUpdateThread` api as currently requested for actions that utilizes `update` call
- min supported version is updated to 2022.3

* * idea: corrected gradle file as well

---------

Co-authored-by: Tomski <[email protected]>

(cherry picked from commit 3ede0a7)
  • Loading branch information
dkimitsa committed Apr 12, 2024
1 parent 26a69d9 commit 3d22c0d
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion plugins/idea/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ dependencies {
exclude group: 'com.robovmx', module: 'robovm-templates-console'
}
robovm_dist "com.robovmx:robovm-dist:${roboVMVersion}:[email protected]"
implementation 'org.apache.commons:commons-compress:1.25.0'
}

intellij {
version = '2021.1' // we are compiles against this API version
version = '2022.3' // we are compiles against this API version
plugins = ['java', 'maven', 'gradle']
updateSinceUntilBuild = false
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/idea/src/main/java/org/robovm/idea/RoboVmPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import com.intellij.ui.content.Content;
import com.intellij.util.PlatformUtils;
import com.intellij.util.ui.UIUtil;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
Expand Down Expand Up @@ -317,7 +317,7 @@ private static void extractArchive(String archive, File dest) {
archive = "/" + archive;
try (TarArchiveInputStream in = new TarArchiveInputStream(new GZIPInputStream(RoboVmPlugin.class.getResourceAsStream(archive)))) {
boolean filesWereUpdated = false;
ArchiveEntry entry;
TarArchiveEntry entry;
while ((entry = in.getNextEntry()) != null) {
File f = new File(dest, entry.getName());
if (entry.isDirectory()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public class ASNewProjectAction extends AnAction {
public ASNewProjectAction() {
}

@Override
public boolean startInTransaction() {
return true;
}

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
NewProjectWizard wizard = new NewProjectWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.module.Module;
Expand Down Expand Up @@ -48,6 +49,11 @@ public void actionPerformed(@NotNull AnActionEvent e) {
}
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public void update(AnActionEvent e) {
e.getPresentation().setEnabled(!busy.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.progress.ProgressIndicator;
Expand All @@ -42,6 +43,11 @@ public void actionPerformed(AnActionEvent anActionEvent) {
ProgressManager.getInstance().run(new CleanTask());
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public void update(AnActionEvent e) {
e.getPresentation().setEnabled(!busy.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.robovm.idea.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.LangDataKeys;
Expand Down Expand Up @@ -56,6 +57,11 @@ private Module workaroundModuleGroupingIssue(Module module) {
return module;
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

@Override
public void update(AnActionEvent e) {
e.getPresentation().setEnabled(!RoboVmIbXcodeProjectTask.isBusy() && isValidModuleEvent(e));
Expand Down
2 changes: 1 addition & 1 deletion plugins/idea/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<depends optional="true" config-file="com.mobidevelop.robovm.intellij-maven.xml">org.jetbrains.idea.maven</depends>
<depends>org.jetbrains.plugins.gradle</depends>
<depends>com.intellij.modules.java</depends>
<idea-version since-build="221"/>
<idea-version since-build="223"/>

<name>MobiVM</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
<version>1.25.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.plist</groupId>
Expand Down

0 comments on commit 3d22c0d

Please sign in to comment.