Package com.iizix.run.common
Class CommonBuilder
java.lang.Object
com.iizix.run.common.CommonBuilder
Static class for common builder routines.
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of the "app" directory below the OS directory of the build machine.static boolean
Debug.The required variables in the text file in an unmutable map.static boolean
Verbose mode.npmConstructor Summary
ConstructorDescriptionCommonBuilder
(BuildEnvironment environment, RuntimeBuilderSettings settings, File buildOutputDir, int uniqueID, IPropProgressMonitor monitor, ICommonJobCreator jobCreator, IPrintAdapter printer) Constructor with the build settings.CommonBuilder
(RuntimeBuilderSettings settings, IPropProgressMonitor monitor, ICommonJobCreator jobCreator, IPrintAdapter printer, boolean isVerbose) Constructor with the build settings.Method Summary
Modifier and TypeMethodDescriptioncleanupProcesses
(boolean isVerbose) Cleans up after Android ADB and Gradle.createApp
(IPropProgressMonitor monitor, int ticks, CodeModifier codeModifier, List<File> filesBuilt, boolean isVerbose) Creates the application and builds it according to the BuildSettings.void
dispose()
Dispose: kills any ongoing process directly.Returns the directory that eventually needs to be fully cleaned up in remote builds.Gets the directory where to store uploaded files for the remote builder.protected ICommonJobs
newJob
(int ticks, boolean isVerbose) Create new job.void
openTerminalWindow
(File dir) Opens a terminal with bash or a command line window under Windows.static void
performCordovaBuild
(RuntimeBuilderSettings settings, File outputDirForCommandPrompt, List<File> filesBuilt, boolean isVerbose) Performs the building of an Internal Cordova build.
Field Details
DEBUG
public static boolean DEBUGDebug.VERBOSE
public static boolean VERBOSEVerbose mode.npmtextVariablesMap
The required variables in the text file in an unmutable map.APP_DIR_NAME
Name of the "app" directory below the OS directory of the build machine.- See Also:
Constructor Details
CommonBuilder
public CommonBuilder(RuntimeBuilderSettings settings, IPropProgressMonitor monitor, ICommonJobCreator jobCreator, IPrintAdapter printer, boolean isVerbose) throws IOException Constructor with the build settings.- Parameters:
settings
- The build settings.monitor
- The progress monitor.jobCreator
- The Job creator.printer
- Print redirector for e.g. console in Eclipse.isVerbose
- If the build should be verbose or not.- Throws:
IOException
- For I/O errors.
CommonBuilder
public CommonBuilder(BuildEnvironment environment, RuntimeBuilderSettings settings, File buildOutputDir, int uniqueID, IPropProgressMonitor monitor, ICommonJobCreator jobCreator, IPrintAdapter printer) Constructor with the build settings.- Parameters:
settings
- The build settings.buildOutputDir
- Build output directory.uniqueID
- A unique ID when building on the server for a client.monitor
- The progress monitor.jobCreator
- The Job creator.printer
- Print redirector for e.g. console in Eclipse.
Method Details
performCordovaBuild
public static void performCordovaBuild(RuntimeBuilderSettings settings, File outputDirForCommandPrompt, List<File> filesBuilt, boolean isVerbose) Performs the building of an Internal Cordova build.- Parameters:
settings
- The builder settings.outputDirForCommandPrompt
- Output directory.filesBuilt
- The built files.isVerbose
- If the job should be verbose or not.
openTerminalWindow
Opens a terminal with bash or a command line window under Windows.- Parameters:
dir
- Current directory.- Throws:
InterruptedException
IOException
getUploadsDirectory
Gets the directory where to store uploaded files for the remote builder.- Returns:
- The uploads directory.
- Throws:
IOException
newJob
Create new job.- Parameters:
ticks
- Number of ticks for the job.isVerbose
- If the job should be verbose or not.- Returns:
- The common jobs instance.
getRemoteBuildCleanupDir
Returns the directory that eventually needs to be fully cleaned up in remote builds. Files may be locked when a build process has just terminated...- Returns:
- null for none,7 otherwise the directory to clean up.
dispose
public void dispose()Dispose: kills any ongoing process directly.cleanupProcesses
Cleans up after Android ADB and Gradle.- Parameters:
isVerbose
- If the job should be verbose or not.- Returns:
- Error return string, or null for success.
createApp
public BuildReply createApp(IPropProgressMonitor monitor, int ticks, CodeModifier codeModifier, List<File> filesBuilt, boolean isVerbose) Creates the application and builds it according to the BuildSettings.- Parameters:
monitor
- Progress monitor, never null.ticks
- The number of ticks for each build to take from the main progress monitor.codeModifier
- The instance of the code modifier.filesBuilt
- The list of files that have been built.isVerbose
- If the job should be verbose or not.- Returns:
- The build reply.