mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-19 00:10:00 +00:00
feat(run): JAR Application run configurations and their import (#2409)
Fixes #2393 Importing run configurations from .run/ and .idea/ skipped every JarApplication entry because there was no equivalent type. Adds a JAR Application run configuration (path to JAR, VM options, program arguments, JRE, working directory, environment) that runs java [VM options] -jar <jar> [args] and debugs over JDWP like the Application type, and maps JarApplication on import (JAR_PATH, VM/program parameters, working directory, alternative JRE path, envs).
This commit is contained in:
@@ -46,6 +46,7 @@ export interface JavaCommandLine {
|
||||
/** VM options, without the classpath. */
|
||||
vmArgs: string[];
|
||||
mainClass: string | null;
|
||||
jarPath?: string;
|
||||
programArgs: string[];
|
||||
/** Which classpath placeholder the configuration uses (`null`: an explicit classpath or none). */
|
||||
classpath: "runtime" | "test" | null;
|
||||
@@ -60,6 +61,15 @@ export function parseJavaArgs(args: readonly string[]): JavaCommandLine {
|
||||
let explicitClasspath: string | null = null;
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
const a = args[i]!;
|
||||
if (a === "-jar")
|
||||
return {
|
||||
vmArgs,
|
||||
mainClass: null,
|
||||
jarPath: args[i + 1],
|
||||
programArgs: args.slice(i + 2),
|
||||
classpath,
|
||||
explicitClasspath,
|
||||
};
|
||||
if (a === "-cp" || a === "-classpath" || a === "--class-path") {
|
||||
const value = args[++i] ?? "";
|
||||
if (value === CLASSPATH) classpath = "runtime";
|
||||
|
||||
Reference in New Issue
Block a user