дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
Run and Debug now share one Java preparation path: save documents, build with the configured policy, resolve the module classpath and JDK, and stop on a failed build. Incremental Make is the default; Rebuild, NoBuild and Build-no-error-check are persisted on the run configuration, and the form offers only what a build tool supports. Delegated Gradle goes through the same path, Debug reports save failures, Maven snapshots honour Rebuild, and scoped diagnostics are retained so incremental Maven cannot erase compilation errors. Co-authored-by: misswell <[email protected]>
23 рядки
1007 B
TypeScript
23 рядки
1007 B
TypeScript
/**
|
|
* Build policies for configurations whose command is itself a build tool (Maven,
|
|
* Gradle). Application/Spring Boot configurations build through `prepareJavaLaunch`
|
|
* instead; this only rewrites the command of an already chosen build-tool launch.
|
|
*/
|
|
import type { RunConfig } from "@/platform/ipc";
|
|
|
|
const MAVEN = new Set(["maven"]);
|
|
const GRADLE = new Set(["gradle"]);
|
|
|
|
export function applyBuildPolicyToCommand(config: RunConfig): RunConfig {
|
|
const rebuild = config.buildPolicy === "rebuild";
|
|
if (rebuild && !config.args.includes("clean") && (MAVEN.has(config.kind) || GRADLE.has(config.kind))) {
|
|
// Maven and Gradle both accept the clean task before their other goals.
|
|
return { ...config, args: ["clean", ...config.args] };
|
|
}
|
|
if (config.buildPolicy === "makeAndContinueOnErrors" && MAVEN.has(config.kind)) {
|
|
const flag = "-Dmaven.compiler.failOnError=false";
|
|
return config.args.includes(flag) ? config : { ...config, args: [...config.args, flag] };
|
|
}
|
|
return config;
|
|
}
|