Advertisement
Guest User

ANT running process

a guest
Jan 25th, 2020
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 KB | None | 0 0
  1. --! MAIN.JAVA !--
  2. /**
  3. * Creates a new instance of this class using the
  4. * arguments specified, gives it any extra user properties which have been
  5. * specified, and then runs the build using the classloader provided.
  6. *
  7. * @param args Command line arguments. Must not be <code>null</code>.
  8. * @param additionalUserProperties Any extra properties to use in this
  9. * build. May be <code>null</code>, which is the equivalent to
  10. * passing in an empty set of properties.
  11. * @param coreLoader Classloader used for core classes. May be
  12. * <code>null</code> in which case the system classloader is used.
  13. */
  14. public static void start(final String[] args, final Properties additionalUserProperties, final ClassLoader coreLoader)
  15.  
  16. --GOES TO--
  17.  
  18. /**
  19. * Start Ant
  20. * @param args command line args
  21. * @param additionalUserProperties properties to set beyond those that
  22. * may be specified on the args list
  23. * @param coreLoader - not used
  24. *
  25. * @since Ant 1.6
  26. */
  27. public void startAnt(final String[] args, final Properties additionalUserProperties, final ClassLoader coreLoader)
  28.  
  29. --TRIES TO--
  30.  
  31. /**
  32. * Process command line arguments.
  33. * When ant is started from Launcher, launcher-only arguments do not get
  34. * passed through to this routine.
  35. *
  36. * @param args the command line arguments.
  37. *
  38. * @since Ant 1.6
  39. */
  40. private void processArgs(final String[] args)
  41.  
  42. --DESC --
  43. [
  44. --!! CLASS !!--
  45. Main: implements AntMain, stores variables that accessible to all functions within Main.java.
  46. Any command-line flags and their argument values are stored within this object if valid.
  47. --!! END OF CLASS !!--
  48.  
  49. At this point the application loops through all of the passed args to see if certain flags are set.
  50. Should the flag "-logfile" it will right a log file with the specified command.
  51.  
  52. LINE 437 - 488: In this seciton, the application is looking at the command arg for -buildfile, it
  53. will handle the situtations of no build file has been specified, the specified build file does not exist,
  54. the specified build file is actually a directory. If a valid 'build.xml' file is found it continues on.
  55.  
  56. LINE 507: If the command line args are all correct, the 'Main' class's 'readyToRun' boolean is set to true.
  57.  
  58. LINE 515 - 525: handleArgBuildFile - Handle the -buildfile, -file, -f argument, called on line 362.
  59. This method will create a new 'File' object and read in the speicifed file and set the 'Main' class's
  60. buildFile variable.
  61. ]
  62. --END OF TRY, BACK TO startAnt--
  63.  
  64. --DESC--
  65. [
  66. LINE 214 - 217: At this point the program will interpret the 'Main' object's state and see if there are additional
  67. user properties that have been set.
  68.  
  69. LINE 220 - 242: The program will now attempt to run a build using 'runBuild' passing in 'coreLoader' a variable of
  70. type 'classLoader' (which is from the ANT dependencies). If the build is successful the a 'handleLogFile' is created
  71. and the program exits.
  72. ]
  73.  
  74. --GOES TO--
  75. /**
  76. * Executes the build. If the constructor for this instance failed
  77. * (e.g. returned after issuing a warning), this method returns
  78. * immediately.
  79. *
  80. * @param coreLoader The classloader to use to find core classes.
  81. * May be <code>null</code>, in which case the
  82. * system classloader is used.
  83. *
  84. * @exception BuildException if the build fails
  85. */
  86. private void runBuild(final ClassLoader coreLoader) throws BuildException)
  87.  
  88. --DESC--
  89. [
  90. Checks to see if the 'readyToRun' boolean is set to true, signifying that the command line args were valid and
  91. that the 'Main' object has been populated with all of the necessary information.
  92.  
  93. LINE 734 - 741: ANT loads 'ArgumentProcessor' objects based on what has been stored in the 'ArgumentProcessorRegistry'
  94.  
  95. LINE 743 - 744: A 'Project' object is created and the 'coreLoader' is set with the 'coreLoader' passed into 'runBuild'
  96.  
  97. LINE 748 - 843: ANT attempts to build the project, according to the user's specifications laid out by the command argument flags.
  98. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement