From 2c1221b935d0fa65bd985944f6953c323d72231b Mon Sep 17 00:00:00 2001 From: conterouz Date: Wed, 25 Aug 2021 14:00:21 +0300 Subject: [PATCH 1/2] Fixes. Make compatible will all IDEA version. Make editable 'class' and 'module' fields. Change all plugin output to STDERR to distinguish it from user code output --- build.gradle | 3 ++- .../RemoteExecutionConfigEditor.java | 4 ++-- .../RemoteExecutionProcessHandler.java | 5 +++-- .../RemoteExecutionSettingsDialog.java | 2 +- src/main/resources/META-INF/plugin.xml | 14 ++++++-------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 47ac5f2..88cc438 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,9 @@ plugins { version = System.getenv("TRAVIS_TAG") intellij { - version '2021.1' + version '2020.1' plugins 'java' + updateSinceUntilBuild false } compileJava { diff --git a/src/main/java/jheister/idearemoteexecute/RemoteExecutionConfigEditor.java b/src/main/java/jheister/idearemoteexecute/RemoteExecutionConfigEditor.java index e2fb273..7e4cd1d 100644 --- a/src/main/java/jheister/idearemoteexecute/RemoteExecutionConfigEditor.java +++ b/src/main/java/jheister/idearemoteexecute/RemoteExecutionConfigEditor.java @@ -8,8 +8,8 @@ import java.awt.*; class RemoteExecutionConfigEditor extends SettingsEditor { - private JLabel classToRun = new JLabel(""); - private JLabel module = new JLabel(""); + private JTextField classToRun = new JTextField(""); + private JTextField module = new JTextField(""); private JTextField commandArgs = new JTextField(); private JTextField jvmArgs = new JTextField(); private JTextField remoteHost = new JTextField(); diff --git a/src/main/java/jheister/idearemoteexecute/RemoteExecutionProcessHandler.java b/src/main/java/jheister/idearemoteexecute/RemoteExecutionProcessHandler.java index 86e2b18..d8e82f3 100644 --- a/src/main/java/jheister/idearemoteexecute/RemoteExecutionProcessHandler.java +++ b/src/main/java/jheister/idearemoteexecute/RemoteExecutionProcessHandler.java @@ -59,9 +59,10 @@ public void startNotify() { runningProcess = Executors.newSingleThreadExecutor().submit(() -> { notifyTextAvailable("Going to run on " + hostName + " with " + javaExec + "\n", STDERR); - int result = executeCommand(syncCommand(requiredFiles), SYSTEM); + int result = executeCommand(syncCommand(requiredFiles), STDERR); if (result != 0) { notifyTextAvailable("Sync failed: " + result + "\n", STDERR); + notifyProcessTerminated(result); throw new RuntimeException("Sync failed"); } @@ -129,7 +130,7 @@ private int executeCommand(String[] cmd, Key outType) { private Process execute(String[] cmd, Key outType) { try { - notifyTextAvailable(asList(cmd).stream().collect(joining(" ")) + "\n", SYSTEM); + notifyTextAvailable(asList(cmd).stream().collect(joining(" ")) + "\n", STDERR); Process process = new ProcessBuilder(cmd).start(); delegateOrDropOutput.setOutput(process.getOutputStream()); diff --git a/src/main/java/jheister/idearemoteexecute/RemoteExecutionSettingsDialog.java b/src/main/java/jheister/idearemoteexecute/RemoteExecutionSettingsDialog.java index 3b2dbe1..54a2ebf 100644 --- a/src/main/java/jheister/idearemoteexecute/RemoteExecutionSettingsDialog.java +++ b/src/main/java/jheister/idearemoteexecute/RemoteExecutionSettingsDialog.java @@ -68,7 +68,7 @@ public JComponent createComponent() { commandArgsField.setText(propertiesComponent.getValue(COMMAND_ARGS_PROPERTY, "")); hostNameField.setText(propertiesComponent.getValue(HOSTNAME_PROPERTY, "")); remoteUserField.setText(propertiesComponent.getValue(USER_PROPERTY, "")); - javaExecField.setText(propertiesComponent.getValue(JAVA_EXEC_PROPERTY, "")); + javaExecField.setText(propertiesComponent.getValue(JAVA_EXEC_PROPERTY, "java")); return container; } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 1523623..aa6a82d 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -2,18 +2,16 @@ jheister.intellijremoteexecute intellij-remote-execute 1.0 - YourCompany + Justin Heister - most HTML tags may be used + This is a IntelliJ plugin designed to allow you to copy your code to a server and run it.
+ The logs display within IntelliJ and you can even debug the running code!
+ Simply right click the Java class you wish to run and select Run 'Remote ...' or Debug 'Remote ...' option.
+ Note: this works only if you don't have other Run options on this class ]]>
- - most HTML tags may be used - ]]> - + From 2e6d90e07fa8e35d62a7b85c7b65b036b1ba4416 Mon Sep 17 00:00:00 2001 From: Stanislav Lyahnovich Date: Mon, 31 Jan 2022 15:24:38 +0300 Subject: [PATCH 2/2] Tweaks --- .../jheister/idearemoteexecute/RemoteExecutionConfigEditor.java | 2 ++ src/main/resources/META-INF/plugin.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/jheister/idearemoteexecute/RemoteExecutionConfigEditor.java b/src/main/java/jheister/idearemoteexecute/RemoteExecutionConfigEditor.java index 7e4cd1d..57e82ce 100644 --- a/src/main/java/jheister/idearemoteexecute/RemoteExecutionConfigEditor.java +++ b/src/main/java/jheister/idearemoteexecute/RemoteExecutionConfigEditor.java @@ -34,6 +34,8 @@ protected void resetEditorFrom(@NotNull RemoteExecutionConfig o) { @Override protected void applyEditorTo(@NotNull RemoteExecutionConfig o) throws ConfigurationException { + o.setClassToRun(classToRun.getText()); + o.setModuleName(module.getText()); o.setCommandArgs(commandArgs.getText()); o.setJvmArgs(jvmArgs.getText()); o.setRemoteHost(remoteHost.getText()); diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index aa6a82d..30403a1 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -14,7 +14,7 @@ - +