mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-25 00:03:08 +00: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 <28730815+misswell@users.noreply.github.com>
21 lines
795 B
TypeScript
21 lines
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";
|
|
}
|
|
}
|