дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 01:01:17 +02:00
Adds Build Module and Build Artifacts to the Before launch tasks, next to Build Project. A launch now waits for the fresh build result and stops on a compile error, a cancelled or busy build, or a removed module; duplicate tasks are rejected and saved tasks are validated; the Build window keeps its visibility. Co-authored-by: misswell <[email protected]>
21 рядки
795 B
TypeScript
21 рядки
795 B
TypeScript
import { executeAction, getAction } from "@/platform/actions";
|
|
import { getContext, setContext } from "@/platform/context";
|
|
|
|
/** Dispatches an awaitable build and consumes only its fresh completion status. */
|
|
export async function buildTask(action: string, arg: unknown): Promise<string | null> {
|
|
if (!getAction(action)) return "Building is not available";
|
|
if (getContext()["build.running"]) return "A build is already running";
|
|
setContext("build.lastStatus", null);
|
|
if (!(await executeAction(action, arg))) return "A build is already running";
|
|
switch (getContext()["build.lastStatus"]) {
|
|
case "success":
|
|
return null;
|
|
case "cancelled":
|
|
return "Build cancelled";
|
|
case "failed":
|
|
return "Build failed";
|
|
default:
|
|
return "Build did not start";
|
|
}
|
|
}
|