Package com.iizix.run.common
Class BuildEnvironment
java.lang.Object
com.iizix.run.common.BuildEnvironment
Class to build up the environment to use.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final String- static final String- static final String- final FileThe home directory.- static final boolean- static final boolean- static final boolean- static final boolean- static final booleanExecutable extension (".exe" for Windows, "" for the others).- final FileThe "output" directory where all programs, etc, build output goes This is normally the "\iiziBuildInstall" directory.- static final char- static final char- final FileThe temporary directory for downloads, etc.
- Constructor SummaryConstructorsConstructorDescription- BuildEnvironment- (File rootDir, boolean doAndroid, boolean doIOS, ICommonJobCreator jobCreator, IPrintAdapter printer) Constructor verifies presence of required directories.
- Method SummaryModifier and TypeMethodDescription- checkAndroidEnvironment- (IPropProgressMonitor monitor, IPrintAdapter printer, boolean isVerbose) Checks the Android environment and build tools.- getExternalProcessEnvironment- (Map<String, - String> returnEnv, boolean logEnvironment) Gets the "real" environment to use for processes where some of the original environment is inherited, but "not too much".- static BuildEnvironment- getInstance- (String rootDirPath, ICommonJobCreator jobCreator, IPropProgressMonitor monitor, IPrintAdapter printer, boolean doAndroid, boolean doIOS, boolean isVerbose) Constructs the environment from the path specified from the root of the current drive in Windows, or from the HOME directory under Mac or Linux.- getJavaEnvironment- (RuntimeBuilderSettings settings, ICommonJobCreator jobCreator, IPropProgressMonitor monitor, boolean isVerbose) Retrieves the Java environment.Gets the output directory.- static StringGets the first line of the output that contains a version number from a command line such as e.g.- getVersions- (IPropProgressMonitor monitor, IPrintAdapter printer, boolean isVerbose) Gets the versions: Node + NPM, Gradle, Android and Cordova.- initialize- (boolean isVerbose) Initializes the environments: Node + NPM, Gradle, Android and Cordova.- static voidPerforms the environment creation for debug purposes.
- Field Details- isWindowspublic static final boolean isWindowsExecutable extension (".exe" for Windows, "" for the others).
- isMacpublic static final boolean isMac
- isLinuxpublic static final boolean isLinux
- isAarch64public static final boolean isAarch64
- isARM64public static final boolean isARM64
- seppublic static final char sep
- pathSeppublic static final char pathSep
- EXE_EXT
- BAT_EXT
- CMD_EXT
- outputThe "output" directory where all programs, etc, build output goes This is normally the "\iiziBuildInstall" directory.
- homeDirThe home directory.
- tempDirThe temporary directory for downloads, etc.
 
- Constructor Details- BuildEnvironmentpublic BuildEnvironment- (File rootDir, boolean doAndroid, boolean doIOS, ICommonJobCreator jobCreator, IPrintAdapter printer) throws IOException Constructor verifies presence of required directories.- Parameters:
- rootDir- The tools root directory where OS directories with Node, NPM, Android, etc, is located, null for default.
- doAndroid- Flag to enable Android building.
- doIOS- Flag to enable iOS building (ignored if not on macOS).
- jobCreator- The job creator interface.
- printer- The printer for output.
- Throws:
- IOException- For I/O errors.
 
 
- Method Details- getVersionFromCommandGets the first line of the output that contains a version number from a command line such as e.g. "node -version".- Parameters:
- s- The String of the result of the program execution stdout.
- Returns:
- The trimmed string as version string, or "n/a?" if not found, a potential prefix of 'v' is skipped.
 
- getOutputDirectoryGets the output directory.
- getExternalProcessEnvironmentpublic BuildReply getExternalProcessEnvironment- (Map<String, - String> returnEnv, boolean logEnvironment) Gets the "real" environment to use for processes where some of the original environment is inherited, but "not too much".- Parameters:
- returnEnv- The environment to use is filled in (not cleared).
- logEnvironment- Logs the environment as informational to the system log.
- Returns:
- The build reply.
 
- getJavaEnvironmentpublic BuildReply getJavaEnvironment- (RuntimeBuilderSettings settings, ICommonJobCreator jobCreator, IPropProgressMonitor monitor, boolean isVerbose) throws IOException Retrieves the Java environment.- Parameters:
- settings- Settings to use if it specified the JDK environment. If null or the JDK settings are not defined, this environment is attempted to be used.
- jobCreator- A job creator, null if not inside Eclipse.
- monitor- A progress monitor that will have 5 ticks taken from it, or null for none.
- isVerbose- The verbose flag.
- Returns:
- The build reply.
- Throws:
- IOException- For I/O errors.
 
- initializeInitializes the environments: Node + NPM, Gradle, Android and Cordova.- Parameters:
- isVerbose- The verbose flag.
- Returns:
- The build reply.
- Throws:
- IOException- For I/O errors.
 
- getVersionspublic BuildReply getVersions- (IPropProgressMonitor monitor, IPrintAdapter printer, boolean isVerbose) Gets the versions: Node + NPM, Gradle, Android and Cordova. The monitor should be configured for 5 ticks.- Parameters:
- monitor- The monitor to use, null for non-Eclipse processes.
- printer- The console printer.
- isVerbose- If the job should be verbose or not.
- Returns:
- The build reply.
 
- checkAndroidEnvironmentpublic BuildReply checkAndroidEnvironment- (IPropProgressMonitor monitor, IPrintAdapter printer, boolean isVerbose) Checks the Android environment and build tools.- The progress monitor should be configured to 4 ticks and only be called if Android build is required. - Parameters:
- monitor- The monitor to use, null for non-Eclipse processes.
- printer- The console printer.
- isVerbose- If the job should be verbose or not.
- Returns:
- The build reply.
 
- getInstancepublic static BuildEnvironment getInstance- (String rootDirPath, ICommonJobCreator jobCreator, IPropProgressMonitor monitor, IPrintAdapter printer, boolean doAndroid, boolean doIOS, boolean isVerbose) throws IOException Constructs the environment from the path specified from the root of the current drive in Windows, or from the HOME directory under Mac or Linux.- Parameters:
- rootDirPath- If unspecified (null), "iiziBuildInstall" is used, otherwise the path specified. Do not specify the OS such as "windows", "mac" or "linux".
- jobCreator- A job creator, null if not inside Eclipse.
- monitor- A progress monitor that will have 5 ticks taken from it, or null for none.
- printer- A printer for redirected output, null for none.
- doAndroid- Flag to enable building for Android.
- doIOS- Flag to enable building for iOS (ignored if not using macOS).
- isVerbose- If the job should be verbose or not.
- Returns:
- The build environment instance.
- Throws:
- IOException- An IOException for failures.
 
- mainPerforms the environment creation for debug purposes.- Parameters:
- args- The arguments of the command line (ignored).