-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix plugin.xml according to new inspections fix terminal runner fix "Synchronous execution on EDT" now minimum required version is 2019.1
- Loading branch information
Showing
10 changed files
with
82 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
out/ | ||
.idea/copyright/ | ||
.idea/workspace.xml | ||
.idea/kotlinc.xml | ||
.idea/uiDesigner.xml | ||
.idea/dictionaries/ | ||
runInCmdPlugin.jar |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<idea-plugin version="2"> | ||
<idea-plugin> | ||
<id>org.turbanov.execution.cmd</id> | ||
<name>RunInCmd</name> | ||
<version>1.6</version> | ||
<version>1.7</version> | ||
<vendor email="[email protected]" url="https://github.com/turbanoff/RunInCmdPlugin">Turbanov Andrey</vendor> | ||
|
||
<description><![CDATA[ | ||
|
@@ -12,6 +12,10 @@ | |
<!--Add change notes here.<br>--> | ||
<!--<em>most HTML tags may be used</em>--> | ||
<change-notes><![CDATA[ | ||
<h3>1.7</h3> | ||
<ul> | ||
<li>Update to support IntelliJ IDEA 2019.x</li> | ||
</ul> | ||
<h3>1.6</h3> | ||
<ul> | ||
<li>Support running JUnit tests</li> | ||
|
@@ -51,13 +55,13 @@ | |
]]> | ||
</change-notes> | ||
|
||
<!-- please see https://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description --> | ||
<idea-version since-build="139.0"/> | ||
<!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description --> | ||
<idea-version since-build="191"/> | ||
|
||
<!-- please see https://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products | ||
<!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html | ||
on how to target different products --> | ||
<depends>com.intellij.modules.java</depends> | ||
<depends optional="true">org.jetbrains.plugins.terminal</depends> | ||
<depends optional="true" config-file="terminal.plugin.support.xml">org.jetbrains.plugins.terminal</depends> | ||
|
||
<extensions defaultExtensionNs="com.intellij"> | ||
<executor implementation="org.turbanov.execution.cmd.InCmdExecutor"/> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<idea-plugin/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
src/org/turbanov/execution/cmd/OptionsPatchConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
package org.turbanov.execution.cmd; | ||
|
||
import com.intellij.openapi.project.Project; | ||
import com.intellij.util.containers.HashMap; | ||
import com.pty4j.PtyProcess; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.jetbrains.plugins.terminal.LocalTerminalDirectRunner; | ||
import org.jetbrains.plugins.terminal.TerminalView; | ||
import com.intellij.openapi.project.Project; | ||
import com.pty4j.PtyProcess; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.concurrent.ExecutionException; | ||
|
||
/** | ||
* @author Andrey Turbanov | ||
*/ | ||
public class TerminalRunner { | ||
public static void runInIdeaTerminal(Project project, final String[] command, final String classPath, final String workingDirectory) { | ||
public static void runInIdeaTerminal(@NotNull Project project, @NotNull String[] command, @NotNull String classPath, @NotNull String workingDirectory) { | ||
TerminalView terminalView = TerminalView.getInstance(project); | ||
terminalView.createNewSession(project, new LocalTerminalDirectRunner(project) { | ||
LocalTerminalDirectRunner runner = new LocalTerminalDirectRunner(project) { | ||
@Override | ||
protected PtyProcess createProcess(@Nullable String directory) throws ExecutionException { | ||
Map<String, String> envs = new HashMap<String, String>(System.getenv()); | ||
protected PtyProcess createProcess(@Nullable String directory, @Nullable String commandHistoryFilePath) throws ExecutionException { | ||
Map<String, String> envs = new HashMap<>(System.getenv()); | ||
envs.put("CLASSPATH", classPath); | ||
try { | ||
return PtyProcess.exec(command, envs, workingDirectory); | ||
} catch (IOException e) { | ||
throw new ExecutionException(e); | ||
} | ||
} | ||
}); | ||
}; | ||
terminalView.createNewSession(runner); | ||
} | ||
} |