Class CommonBuilder

java.lang.Object
com.iizix.run.common.CommonBuilder

public class CommonBuilder extends Object
Static class for common builder routines.
Author:
Christopher Mindus
  • Field Details

    • DEBUG

      public static boolean DEBUG
      Debug.
    • VERBOSE

      public static boolean VERBOSE
      Verbose mode.npm
    • textVariablesMap

      public static final Map<String,String> textVariablesMap
      The required variables in the text file in an unmutable map.
    • APP_DIR_NAME

      public static final String 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

      public void openTerminalWindow(File dir) throws IOException, InterruptedException
      Opens a terminal with bash or a command line window under Windows.
      Parameters:
      dir - Current directory.
      Throws:
      InterruptedException
      IOException
    • getUploadsDirectory

      public File getUploadsDirectory() throws IOException
      Gets the directory where to store uploaded files for the remote builder.
      Returns:
      The uploads directory.
      Throws:
      IOException
    • newJob

      protected ICommonJobs newJob(int ticks, boolean isVerbose)
      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

      public File 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

      public String cleanupProcesses(boolean isVerbose)
      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.