Fix update of the build process checkpoint
This commit is contained in:
@ -19,9 +19,10 @@ assert<BuildContext extends BuildContextLike ? true : false>();
|
|||||||
|
|
||||||
export async function buildJars(params: {
|
export async function buildJars(params: {
|
||||||
resourcesDirPath: string;
|
resourcesDirPath: string;
|
||||||
|
onlyBuildJarFileBasename: string | undefined;
|
||||||
buildContext: BuildContextLike;
|
buildContext: BuildContextLike;
|
||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
const { resourcesDirPath, buildContext } = params;
|
const { onlyBuildJarFileBasename, resourcesDirPath, buildContext } = params;
|
||||||
|
|
||||||
const doesImplementAccountTheme = readMetaInfKeycloakThemes_fromResourcesDirPath({
|
const doesImplementAccountTheme = readMetaInfKeycloakThemes_fromResourcesDirPath({
|
||||||
resourcesDirPath: buildContext.keycloakifyBuildDirPath
|
resourcesDirPath: buildContext.keycloakifyBuildDirPath
|
||||||
@ -57,12 +58,20 @@ export async function buildJars(params: {
|
|||||||
keycloakVersionRange
|
keycloakVersionRange
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
onlyBuildJarFileBasename !== undefined &&
|
||||||
|
onlyBuildJarFileBasename !== jarFileBasename
|
||||||
|
) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
keycloakThemeAdditionalInfoExtensionVersion,
|
keycloakThemeAdditionalInfoExtensionVersion,
|
||||||
jarFileBasename
|
jarFileBasename
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
.filter(exclude(undefined))
|
||||||
.map(
|
.map(
|
||||||
({
|
({
|
||||||
keycloakThemeAdditionalInfoExtensionVersion,
|
keycloakThemeAdditionalInfoExtensionVersion,
|
||||||
|
@ -3,7 +3,10 @@ import { join as pathJoin, relative as pathRelative, sep as pathSep } from "path
|
|||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { getBuildContext } from "../shared/buildContext";
|
import { getBuildContext } from "../shared/buildContext";
|
||||||
import { vitePluginSubScriptEnvNames, skipBuildJarsEnvName } from "../shared/constants";
|
import {
|
||||||
|
vitePluginSubScriptEnvNames,
|
||||||
|
onlyBuildJarFileBasenameEnvName
|
||||||
|
} from "../shared/constants";
|
||||||
import { buildJars } from "./buildJars";
|
import { buildJars } from "./buildJars";
|
||||||
import type { CliCommandOptions } from "../main";
|
import type { CliCommandOptions } from "../main";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
@ -99,13 +102,11 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
build_jars: {
|
await buildJars({
|
||||||
if (process.env[skipBuildJarsEnvName]) {
|
resourcesDirPath,
|
||||||
break build_jars;
|
buildContext,
|
||||||
}
|
onlyBuildJarFileBasename: process.env[onlyBuildJarFileBasenameEnvName]
|
||||||
|
});
|
||||||
await buildJars({ resourcesDirPath, buildContext });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Date.now() === 0) {
|
if (Date.now() === 0) {
|
||||||
rmSync(resourcesDirPath, { recursive: true });
|
rmSync(resourcesDirPath, { recursive: true });
|
||||||
|
@ -16,7 +16,7 @@ export const vitePluginSubScriptEnvNames = {
|
|||||||
resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
|
resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const skipBuildJarsEnvName = "KEYCLOAKIFY_SKIP_BUILD_JAR";
|
export const onlyBuildJarFileBasenameEnvName = "KEYCLOAKIFY_ONLY_BUILD_JAR_FILE_BASENAME";
|
||||||
|
|
||||||
export const loginThemePageIds = [
|
export const loginThemePageIds = [
|
||||||
"login.ftl",
|
"login.ftl",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { skipBuildJarsEnvName } from "../shared/constants";
|
import { onlyBuildJarFileBasenameEnvName } from "../shared/constants";
|
||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
import { Deferred } from "evt/tools/Deferred";
|
import { Deferred } from "evt/tools/Deferred";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
@ -14,10 +14,10 @@ export type BuildContextLike = {
|
|||||||
assert<BuildContext extends BuildContextLike ? true : false>();
|
assert<BuildContext extends BuildContextLike ? true : false>();
|
||||||
|
|
||||||
export async function keycloakifyBuild(params: {
|
export async function keycloakifyBuild(params: {
|
||||||
doSkipBuildJars: boolean;
|
onlyBuildJarFileBasename: string | undefined;
|
||||||
buildContext: BuildContextLike;
|
buildContext: BuildContextLike;
|
||||||
}): Promise<{ isKeycloakifyBuildSuccess: boolean }> {
|
}): Promise<{ isKeycloakifyBuildSuccess: boolean }> {
|
||||||
const { buildContext, doSkipBuildJars } = params;
|
const { buildContext, onlyBuildJarFileBasename } = params;
|
||||||
|
|
||||||
const dResult = new Deferred<{ isSuccess: boolean }>();
|
const dResult = new Deferred<{ isSuccess: boolean }>();
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ export async function keycloakifyBuild(params: {
|
|||||||
cwd: buildContext.projectDirPath,
|
cwd: buildContext.projectDirPath,
|
||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
...(doSkipBuildJars ? { [skipBuildJarsEnvName]: "true" } : {})
|
[onlyBuildJarFileBasenameEnvName]: onlyBuildJarFileBasename
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
||||||
doSkipBuildJars: false,
|
onlyBuildJarFileBasename: undefined,
|
||||||
buildContext
|
buildContext
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
||||||
doSkipBuildJars: true,
|
onlyBuildJarFileBasename: jarFileBasename,
|
||||||
buildContext
|
buildContext
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user