38 lines
1.1 KiB
TypeScript
Raw Normal View History

2021-02-21 20:54:33 +01:00
import { generateKeycloakThemeResources } from "./generateKeycloakThemeResources";
import { generateJavaStackFiles } from "./generateJavaStackFiles";
import type { ParsedPackageJson } from "./generateJavaStackFiles";
import { join as pathJoin } from "path";
2021-02-21 21:16:43 +01:00
import * as child_process from "child_process";
2021-02-21 23:06:42 +01:00
import { generateDebugFiles } from "./generateDebugFiles";
2021-02-21 20:54:33 +01:00
const reactProjectDirPath = process.cwd();
const parsedPackageJson: ParsedPackageJson = require(pathJoin(reactProjectDirPath, "package.json"));
2021-02-21 23:06:42 +01:00
export const keycloakThemeBuildingDirPath = pathJoin(reactProjectDirPath, "build_keycloak");
2021-02-21 20:54:33 +01:00
2021-02-21 23:06:42 +01:00
if (require.main === module) {
2021-02-21 20:54:33 +01:00
2021-02-21 23:06:42 +01:00
generateKeycloakThemeResources({
keycloakThemeBuildingDirPath,
"reactAppBuildDirPath": pathJoin(reactProjectDirPath, "build"),
"themeName": parsedPackageJson.name
});
2021-02-21 20:54:33 +01:00
2021-02-21 23:06:42 +01:00
generateJavaStackFiles({
parsedPackageJson,
keycloakThemeBuildingDirPath
});
2021-02-21 23:06:42 +01:00
child_process.execSync(
"mvn package",
{ "cwd": keycloakThemeBuildingDirPath }
);
generateDebugFiles({
keycloakThemeBuildingDirPath,
"packageJsonName": parsedPackageJson.name
});
}