Skip to content

Commit

Permalink
Merge pull request #18 from anboralabs/upgrade
Browse files Browse the repository at this point in the history
upgrade sdk.
  • Loading branch information
mergify[bot] authored Jan 21, 2024
2 parents f9928a8 + e2b1889 commit 559c531
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "1.9.0"
id("org.jetbrains.intellij") version "1.16.1"
id("org.jetbrains.intellij") version "1.17.0"
}

group = "co.anbora.labs.jmeter"
version = "1.2.4"
version = "1.2.5"

repositories {
mavenCentral()
Expand Down Expand Up @@ -111,7 +111,7 @@ tasks {

patchPluginXml {
sinceBuild.set("232")
untilBuild.set("233.*")
untilBuild.set("241.*")
changeNotes.set(file("src/main/html/change-notes.html").inputStream().readBytes().toString(Charsets.UTF_8))
pluginDescription.set(file("src/main/html/description.html").inputStream().readBytes().toString(Charsets.UTF_8))
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/html/change-notes.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Versions:
<ul>
<li>All Intellij products support: 1.2.4</li>
<li>All Intellij products support: 1.2.5</li>
</ul>
<br>
Plugin updates:
<ul>
<li><b>1.2.5</b> <em>(2024-01-20)</em> - upgrade sdk </li>
<li><b>1.2.4</b> <em>(2024-01-13)</em> - fix issue
<ul>
<li>fixed issue <a href="https://github.com/anboralabs/intellij-jmeter/issues/5">#5</a></li>
Expand Down
30 changes: 17 additions & 13 deletions src/main/java/org/apache/jmeter/gui/action/ExitIDECommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@

package org.apache.jmeter.gui.action;

import co.anbora.labs.jmeter.ide.actions.RestartIDEAction;
import co.anbora.labs.jmeter.ide.notifications.JMeterNotifications;
import com.google.auto.service.AutoService;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.updateSettings.impl.IdeRestartKt;
import java.awt.event.ActionEvent;
import java.util.HashSet;
import java.util.Set;
import javax.swing.*;
import kotlin.Unit;
import org.apache.jmeter.gui.GuiPackage;
import org.apache.jmeter.util.JMeterUtils;

@AutoService(Command.class)
public class ExitIDECommand extends AbstractActionWithNoRunningTest {
Expand Down Expand Up @@ -59,12 +58,17 @@ public Set<String> getActionNames() {
*/
@Override
public void doActionAfterCheck(ActionEvent e) {
ApplicationManager.getApplication().invokeLater(() -> {
IdeRestartKt.restartOrNotify(
ProjectManager.getInstance().getDefaultProject(), false, () -> {
ApplicationManager.getApplication().restart();
return Unit.INSTANCE;
});
});
Project[] project = ProjectManager.getInstance().getOpenProjects();

Notification notification = JMeterNotifications.createNotification(
"JMeter Plugin Setup", "Please restart the IDE",
NotificationType.INFORMATION, new RestartIDEAction());

if (project.length != 0) {
JMeterNotifications.showNotification(notification, project[0]);
} else {
JMeterNotifications.showNotification(
notification, ProjectManager.getInstance().getDefaultProject());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.project.Project

object JMeterNotifications {

@JvmStatic
fun createNotification(
title: String,
content: String,
Expand All @@ -27,6 +29,7 @@ object JMeterNotifications {
return notification
}

@JvmStatic
fun showNotification(notification: Notification, project: Project?) {
try {
notification.notify(project)
Expand Down

0 comments on commit 559c531

Please sign in to comment.