Package ch.rswk.bootstrap.core
Class Build
java.lang.Object
ch.rswk.bootstrap.core.Build
Build creates a bootstrap module ZIP from the given build configuration using Maven.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringstatic final Stringprivate static final Stringprivate static final Stringprivate static final Stringstatic final Stringstatic final Stringstatic final Stringprivate static final Stringprivate static final Stringstatic final Stringprivate static final Stringstatic final Stringprivate static final Stringprivate static final Stringprivate static final org.slf4j.Loggerstatic final Stringprivate static final Stringprivate static final Stringstatic final Stringprivate static final Stringstatic final Stringprivate static final Stringprivate static final org.apache.commons.cli.Optionsstatic final Stringprivate static final Stringprivate static final Stringprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddWgetDownloadsToArchive(Path boostrapArchive, Execute.ExecuteConfig config) protected static voidbuildModule(Build.BuildConfig config, String... args) static voidbuildModule(Build.BuildConfig config, @Nullable Path customizeDir, @Nullable String mavenRepo, @Nullable Path mergeConfig, Path moduleDir) buildModule prepares and builds a bootstrap module.private static voiddeleteBootstrapConfigAndScript(Path moduleDir, Env.EnvType targetEnv) static List<Build.MatchingCustomerModule> getMatchingCustomerModules(String buildConfigFile, String module, Path repoDir, String version) getMvnArgs(@Nullable String repoDir, VariableResolver resolver) static PathgetPlatformDataDirFile(String fileName) private static Execute.ExecuteConfigloadBootstrapConfig(Build.BuildConfig config, @Nullable Path mergeConfig, VariableResolver resolver) private static voidmvnCleanPackage(Path moduleDir, String moduleName, @Nullable String repoDir, VariableResolver resolver, Env.EnvType targetEnv) private static voidmvnDeploy(Path boostrapArchive, Build.BuildDeployConfig deploy, Path moduleDir, @Nullable String repoDir, VariableResolver resolver, String version) private static org.apache.commons.cli.OptionsprepareMerge(@Nullable List<Build.BuildMergeConfig> mergeConfigs, VariableResolver resolver) private static voidprocessCopy(List<Build.BuildCopyConfig> copyConfigs, VariableResolver resolver) private static voidprocessMerge(@Nullable Path customizeDir, @Nullable List<Build.BuildMergeConfig> merge, Path moduleResourceDir, VariableResolver resolver) private static voidprocessValidate(Path moduleDir, VariableResolver resolver, List<Build.BuildValidateConfig> validateConfigs) static PathresolveArchivePath(Path moduleDir, String version) static voidprivate static voidvalidateDefinitions(Path definitionsPath) private static voidwriteBootstrapConfigAndScript(Execute.ExecuteConfig config, Path moduleDir, VariableResolver resolver)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
BIN_DIR
- See Also:
-
BUILD_BIN_DIR_VAR
- See Also:
-
BUILD_CUSTOMIZE_DIR_VAR
- See Also:
-
BUILD_MODULE_DIR_VAR
- See Also:
-
CUSTOMIZE_OPTION
- See Also:
-
DOWNLOAD_DIR
- See Also:
-
MAVEN_REPO_OPTION
- See Also:
-
MERGE_OPTION
- See Also:
-
MODULE_OPTION
- See Also:
-
RESOURCE_DIR
- See Also:
-
ARCHIVE_PATH_FORMAT
- See Also:
-
BOOTSTRAP_CONFIG_ERROR_FORMAT
- See Also:
-
BOOTSTRAP_CONFIG_MERGE_ERROR_FORMAT
- See Also:
-
BUILD_BIN_DIR
- See Also:
-
COPY_BIN_TARGET_ERROR
- See Also:
-
CUSTOMIZE_DIR_ERROR_FORMAT
- See Also:
-
DEFINITION_FILE_TYPE
- See Also:
-
EXECUTE_SCRIPT_NIX
- See Also:
-
EXECUTE_SCRIPT_WIN
- See Also:
-
MAVEN_SETTINGS_FILE
-
MERGE_ERROR_FORMAT
- See Also:
-
MERGE_EXCLUDE
-
MODULE_DIR_ERROR_FORMAT
- See Also:
-
MVN_SUCCESS
- See Also:
-
OPTIONS
private static final org.apache.commons.cli.Options OPTIONS -
RUN_MVN_ERROR_MESSAGE
- See Also:
-
VALIDATE_ERROR_FORMAT
- See Also:
-
VERSION_ERROR_FORMAT
- See Also:
-
-
Constructor Details
-
Build
private Build()
-
-
Method Details
-
addWgetDownloadsToArchive
private static void addWgetDownloadsToArchive(Path boostrapArchive, Execute.ExecuteConfig config) throws IOException - Throws:
IOException
-
buildModule
- Throws:
Exception
-
buildModule
public static void buildModule(Build.BuildConfig config, @Nullable Path customizeDir, @Nullable String mavenRepo, @Nullable Path mergeConfig, Path moduleDir) throws Exception buildModule prepares and builds a bootstrap module. Prepare means generating/writing the final execute config and boostrap scripts, then merging the base module with any customer specific content. Maven is used to package the ZIP and deploy it to the artifact repository.Available properties in build config:
- "buildModuleDir"
- "buildCustomizeDir"
- "buildBinDir"
- Environment variables
- Parameters:
config- build configcustomizeDir- optional, path to customize modulemavenRepo- optional, path to local maven repositorymergeConfig- optional, path to bootstrap config to merge withBuild.BuildConfig.bootstrapConfig()moduleDir- path to bootstrap module- Throws:
Exception
-
deleteBootstrapConfigAndScript
private static void deleteBootstrapConfigAndScript(Path moduleDir, Env.EnvType targetEnv) throws IOException - Throws:
IOException
-
getMatchingCustomerModules
public static List<Build.MatchingCustomerModule> getMatchingCustomerModules(String buildConfigFile, String module, Path repoDir, String version) throws IOException - Throws:
IOException
-
getMvnArgs
-
getPlatformDataDirFile
-
loadBootstrapConfig
private static Execute.ExecuteConfig loadBootstrapConfig(Build.BuildConfig config, @Nullable Path mergeConfig, VariableResolver resolver) throws IOException - Throws:
IOException
-
mvnCleanPackage
private static void mvnCleanPackage(Path moduleDir, String moduleName, @Nullable String repoDir, VariableResolver resolver, Env.EnvType targetEnv) -
mvnDeploy
private static void mvnDeploy(Path boostrapArchive, Build.BuildDeployConfig deploy, Path moduleDir, @Nullable String repoDir, VariableResolver resolver, String version) -
newOptions
private static org.apache.commons.cli.Options newOptions() -
prepareMerge
private static Map<Path,Path> prepareMerge(@Nullable List<Build.BuildMergeConfig> mergeConfigs, VariableResolver resolver) throws Exception - Throws:
Exception
-
processCopy
private static void processCopy(List<Build.BuildCopyConfig> copyConfigs, VariableResolver resolver) throws IOException - Throws:
IOException
-
processMerge
private static void processMerge(@Nullable Path customizeDir, @Nullable List<Build.BuildMergeConfig> merge, Path moduleResourceDir, VariableResolver resolver) throws Exception - Throws:
Exception
-
processValidate
private static void processValidate(Path moduleDir, VariableResolver resolver, List<Build.BuildValidateConfig> validateConfigs) -
resolveArchivePath
-
runMvn
public static void runMvn(List<String> commands, Path moduleDir, @Nullable String repoDir, VariableResolver resolver) -
validateDefinitions
- Throws:
IOException
-
writeBootstrapConfigAndScript
private static void writeBootstrapConfigAndScript(Execute.ExecuteConfig config, Path moduleDir, VariableResolver resolver) throws IOException - Throws:
IOException
-