Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --! MAIN.JAVA !--
- /**
- * Creates a new instance of this class using the
- * arguments specified, gives it any extra user properties which have been
- * specified, and then runs the build using the classloader provided.
- *
- * @param args Command line arguments. Must not be <code>null</code>.
- * @param additionalUserProperties Any extra properties to use in this
- * build. May be <code>null</code>, which is the equivalent to
- * passing in an empty set of properties.
- * @param coreLoader Classloader used for core classes. May be
- * <code>null</code> in which case the system classloader is used.
- */
- public static void start(final String[] args, final Properties additionalUserProperties, final ClassLoader coreLoader)
- --GOES TO--
- /**
- * Start Ant
- * @param args command line args
- * @param additionalUserProperties properties to set beyond those that
- * may be specified on the args list
- * @param coreLoader - not used
- *
- * @since Ant 1.6
- */
- public void startAnt(final String[] args, final Properties additionalUserProperties, final ClassLoader coreLoader)
- --TRIES TO--
- /**
- * Process command line arguments.
- * When ant is started from Launcher, launcher-only arguments do not get
- * passed through to this routine.
- *
- * @param args the command line arguments.
- *
- * @since Ant 1.6
- */
- private void processArgs(final String[] args)
- --DESC --
- [
- --!! CLASS !!--
- Main: implements AntMain, stores variables that accessible to all functions within Main.java.
- Any command-line flags and their argument values are stored within this object if valid.
- --!! END OF CLASS !!--
- At this point the application loops through all of the passed args to see if certain flags are set.
- Should the flag "-logfile" it will right a log file with the specified command.
- LINE 437 - 488: In this seciton, the application is looking at the command arg for -buildfile, it
- will handle the situtations of no build file has been specified, the specified build file does not exist,
- the specified build file is actually a directory. If a valid 'build.xml' file is found it continues on.
- LINE 507: If the command line args are all correct, the 'Main' class's 'readyToRun' boolean is set to true.
- LINE 515 - 525: handleArgBuildFile - Handle the -buildfile, -file, -f argument, called on line 362.
- This method will create a new 'File' object and read in the speicifed file and set the 'Main' class's
- buildFile variable.
- ]
- --END OF TRY, BACK TO startAnt--
- --DESC--
- [
- LINE 214 - 217: At this point the program will interpret the 'Main' object's state and see if there are additional
- user properties that have been set.
- LINE 220 - 242: The program will now attempt to run a build using 'runBuild' passing in 'coreLoader' a variable of
- type 'classLoader' (which is from the ANT dependencies). If the build is successful the a 'handleLogFile' is created
- and the program exits.
- ]
- --GOES TO--
- /**
- * Executes the build. If the constructor for this instance failed
- * (e.g. returned after issuing a warning), this method returns
- * immediately.
- *
- * @param coreLoader The classloader to use to find core classes.
- * May be <code>null</code>, in which case the
- * system classloader is used.
- *
- * @exception BuildException if the build fails
- */
- private void runBuild(final ClassLoader coreLoader) throws BuildException)
- --DESC--
- [
- Checks to see if the 'readyToRun' boolean is set to true, signifying that the command line args were valid and
- that the 'Main' object has been populated with all of the necessary information.
- LINE 734 - 741: ANT loads 'ArgumentProcessor' objects based on what has been stored in the 'ArgumentProcessorRegistry'
- LINE 743 - 744: A 'Project' object is created and the 'coreLoader' is set with the 'coreLoader' passed into 'runBuild'
- LINE 748 - 843: ANT attempts to build the project, according to the user's specifications laid out by the command argument flags.
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement