Package Torello.Java.Build
Class CLI
- java.lang.Object
-
- Torello.Java.Build.CLI
-
public class CLI extends java.lang.Object
This data class is instantiated by parsing the Command-Line Input. It contains the settings that were extrapolated by the Apache CLI Parser.Internally-Used Class: The exposed API here is not needed to the End-User.
This class is generated, internally, as a Configuration-Class to be passed to the 8 Build-Stages which are executed by this Build-Tool. The contents of this class have been thoroughly documented and explained, solely for the purpose of explaining, exactly, the steps this Tool is taking during a Build!
This class is not declared Package-Private in order to facilitate providing a more detailed explanation of what this Build-Tool entails, and not because it is important to the End-User when running a build.
Retrieving an Instance:
With the above provided notice, if you still wish to view the contents of this class, the Object-Reference that is used byRunBuild
is one of the myriad field's that are made available within the classBuilderRecord
.
ABuilderRecord
instance is generated as follows, and theCLI
instance is obtained by referencing the fieldcli
, as below:
Example:
public static void main(String[] argv) { Config config = new Config(); // Perform as many assignments to the Configuration-Fields as is necessary! // ... [Configurations Here] ... //see class Config to learn about all available Config-Fields] BuilderRecord brec = config.createBuilder(argv); // Print's out the contents of this class... System.out.println(brec.cli); // Run's the Build, using all User-Provided Configurations obtained from class Config, // along with all User-Specified Options provided at the OS Command-Prompt RunBuild.run(brec); }
The datum contained as fields of this class are all declaredpublic
and alsoReadOnly
orfinal
. The instance generated from the Command-Line Input (CLI) parser is available as apublic
andfinal
field of theBuilder
instance fieldTorello.Java.Build.Builder.cli
;
This class does not offer any public constructors, nor any public methods. It is automatically built by classBuilder
, which has package-level access to this class' sole constructor.
The menu option printed by this class looks similar to this one:
Primary Build Steps / Stages: -1 -> Compile [Optional: Package-Nicknames] -2 -> JavaDoc -3 -> Upgrader [Optional: Package-Nicknames] -4 -> Archive & Compress: Build 2 TAR's & 1 JAR Cloud-Synchronization Primary Build Steps / Stages: -5 -> Transfer: 'javadoc/' directory to Cloud -6 -> Transfer: '.tar' and '.jar' files to Cloud -7 -> Transfer: logs to Cloud -8 -> Set Cloud-Files' Browser-Cache Meta-Data to 150 seconds Composite-Stage Complete-Build (-cb) Options: -cb1 -> STEPS 2 through 7. [Push-To: RT-DEV] -cb2 -> STEPS 2 through 8. [Push-To: RT-DEV] -cb3 -> STEPS 2 through 7. [Push-To: RT-DEV-2] -cb4 -> STEPS 2 through 8. [Push-To: RT-DEV-2] -cb5 -> STEPS 2 through 7. [Push-To: Java-HTML] Composite-Stage Partial-Build (-pb) Options: -pb1 -> SETPS 2 and 3. [Doc Only, Optional: Pkg-Nicknames] -pb2 -> STEPS 2 through 4. -pb3 -> STEPS 2, 3, 5 and 8. [Push-To: RT-DEV, Optional: Pkg-Nicknames] -pb4 -> STEPS 2, 3, 5 and 8. [Push-To: RT-DEV-2, Optional: Pkg-Nicknames] Links-Checker: -LC -> STEPS 2 and 3, WITH-LINKS-CHECK Auxiliary Options: -NQB,--noQuickBuild Prevent a Quick Build during Partial-Build's -JCP,--putJarInCP Include the '.jar' File in the Class-Path -SRG,--skipRemoveGCSFiles Skip the removal-step of all Java-Doc GCS Files, when synchronizing. -TXL,--toggleDefaultXlint Toggle whatever the default setting is for applying -Xlint:all -TXD,--toggleDefaultXdiags Toggle whatever the default setting is for applying -Xdiags:verbose -IEDP,--includeEarlyDev Include Packages still Under Early Development in the Build -JFO,--jarFileOnly Only generate a '.jar' File during the Stage-4 Build-Step You must select exactly one of the Primary or Composite Build-Options listed above Requesting that the Java-Doc Internal-URL Links-Checker be run is also allowed, although currently, it has been disabled
Main-Menu Options:
The following Table lists the Primary Stage/Step Main-Menu CLI-Options for this Build Package. The options listed below are exclusive, and only one of them may be passed to the CLI (via theString[] argv
parameters) on any single-invocation ofRunBuild.run
:CLI-Switch Purpose -1, --javac Requests Stage-1: Invoke / Run `javac`
.
Allows for specifying which packages to compile, via aPackage Nick-Names
List.-2, --javadoc Requests Stage-2: Invoke / Run `javadoc`
-3, --jdu Requests Stage-3: Invoke the JavaDoc Upgrader
-4, --tarjar Requests Stage-4: Run `tar`
&`jar`
-5, --syncJavaDoc Requests Stage-5: Synchronize 'javadoc/'
Directory-Content to the Cloud-6, --syncTarJar Requests Stage-6: Synchronize `tar`
&`jar`
Archive-Files to the Cloud-7, --syncLogs Requests Stage-7: Synchronize the Logs to the Cloud -8, --setMaxAge Requests Stage-8: Set the Cache-Control HTTP-Server Property 'max-age'
, on all synchronized'javadoc/'
Files.
Additional Main-Menu Options:
The following Table lists the Main-Menu CLI-Options that specify a Composite-Set of the previously listed Build-Step Options. As mentioned before, only one of these switches may be specified to the classCLI
on any single Command-Line Invocation. These options perform a Complete, or near Complete Build process. The two Partial-Build Options help speed up the build process, when only small parts of the code or pacakges are actually being modified.CLI-Switch Purpose -cbX, --completeX Requests Complete-Build, Steps #2 to #7 (or #8) Varying "Push-To Locations" are offered, depending upon the number of User-Provided CloudSync
instances that have been inserted into classConfig's
Configurations, using methodaddCloudSync
-pbX, --partialX Requests a Partial-Build, Steps #2, #3 and others: Runs a smaller subset of the Primary Stages. -LC, --linksCheck Requests Run the Internal Links-Checker: Runs the Java-Doc Upgrader Tool's Internal-Links Checker.
Auxillary Options:
None of these Command-Line switches are Main-Menu Options, and they would not meet the requirement that the'argv'
parameterString[]
-Array passed at the Command-Line contain at least one Main-Menu Option.
For each of these CLI Switches, the Main-Menu Option with which the switches may be utilized is listed at the top of the description. If an Auxillary-Switch is employed with a Main-Menu Option that isn't listed, the class will throw an exception, and print a thoughtfully worded error message.CLI-Switch Purpose -NQB, --noQuickBuild Works Alongside: -pbX, --partialX
During Partial-Builds, this switch prevents a "Quick Build." A Quick-Build means that Packages which are marked as "Skip on Partial-Build" are removed, completely, from the Build. All"--partial"
build options are treated as Quick-Builds; however, this switch can be used to disable this default behavior.
Package's may be designated asQUICKER_BUILD_SKIP
packages via theBuildPackage
class Configuration Flags.-JCP, --putJarInCP Works Alongside: -1, --javac
Includes whatever'.jar'
File which was created during the previous build, in the Class-Path, during the current'javac'
Stage-1 Compilation-Stage.-SRG, --skipRemoveGCSFiles Works Alongside: -cbX, --completeX
When synchronizing Java-Doc'.html'
-Files to the Cloud, this option asks the build to skip the removal / deletion of old'.html'
-Files before synchronizing the new ones.
Generally, this has the net-effect of "speeding things up" vis-a-vis the Cloud-Synchronization Stage, which is always the slowest part of the build process.-TXL, --toggleDefaultXlint Works Alongside: -1, --javac
Toggle whatever the default setting is for applying-Xlint:all
. This switch may be passed to the'javac'
Java-Oracle Binary by this Build-Tool during the (Stage-1) Build-Step.
Note that the default behavior may be configured via the classConfig
FieldUSE_XLINT_SWITCH
-TXD, --toggleDefaultXdiags Works Alongside: -1, --javac
Toggle whatever the default setting is for applying-Xdiags:verbose
This switch may be passed to the'javac'
Java-Oracle Binary by this Build-Tool during the (Stage-1) Build-Step.
Note that the default behavior may be configured via the classConfig
FieldUSE_XDIAGS_SWITCH
-IEDP, --includeEarlyDev Works Alongside: All Main-Menu Options, Except: -4, -6, -7
Packages which have been designed by the User asEARLYDEVELOPMENT
(via theBuildPackage
class configurations) will be included in this Build.
Packages which are marked as still too early in the development life-cycle are, by default, ignored by this Build-Tool during a build.-JFO, --jarFileOnly Works Alongside: -4, --tarjar
During the Stage-4 Archive-Stage, do not generate all Archive-Files; only generate the Project'.jar'
-File.
This Options also works alongside option"-pb2"
, which processes Steps #1 to #4. However in scenarios where the User-Provided classConfig
instance' list ofCloudSync
references is empty, this option will, instead, work along side"-cb1"
(rather than"-pb2"
), because that in such conditions, that's the option which executes Steps # to #4.
Hi-Lited Source-Code:This File's Source Code:
- View Here: Torello/Java/Build/CLI.java
- Open New Browser-Tab: Torello/Java/Build/CLI.java
File Size: 17,327 Bytes Line Count: 393 '\n' Characters Found
Top-Level Generate-Dispatch: Generato All:
- View Here: Generate.java
- Open New Browser-Tab: Generate.java
File Size: 22,636 Bytes Line Count: 412 '\n' Characters Found
Generate Options & Records: Primary Main-Menu Options & Text:
- View Here: GeneratePrimaryOpts.java
- Open New Browser-Tab: GeneratePrimaryOpts.java
File Size: 6,920 Bytes Line Count: 194 '\n' Characters Found
Generate Options & Records: Composite-Step Menu Options & Text:
- View Here: GenerateCompositeOpts.java
- Open New Browser-Tab: GenerateCompositeOpts.java
File Size: 18,065 Bytes Line Count: 384 '\n' Characters Found
Generate Options & Records: Auxiliary Menu Options & Text:
- View Here: GenerateAuxiliaryOpts.java
- Open New Browser-Tab: GenerateAuxiliaryOpts.java
File Size: 4,092 Bytes Line Count: 121 '\n' Characters Found
Ephemeral Data-Record: List-Sorted CLI Options:
- View Here: CollatedOptsRecord.java
- Open New Browser-Tab: CollatedOptsRecord.java
File Size: 6,086 Bytes Line Count: 149 '\n' Characters Found
Ephemeral Data-Record: Help-Menu Text-Strings:
- View Here: PrintHelpRecord.java
- Open New Browser-Tab: PrintHelpRecord.java
File Size: 13,753 Bytes Line Count: 303 '\n' Characters Found
Switch-Processor: Main-Menu CLI Options:
- View Here: ProcessMainMenuChoice.java
- Open New Browser-Tab: ProcessMainMenuChoice.java
File Size: 8,364 Bytes Line Count: 175 '\n' Characters Found
Switch-Processor: Package Nick-Name CLI Arguments:
- View Here: ProcessNickNameArgs.java
- Open New Browser-Tab: ProcessNickNameArgs.java
File Size: 19,032 Bytes Line Count: 372 '\n' Characters Found
Switch-Processor: Error-Check User-Input:
- View Here: ErrorCheckSelectedOpts.java
- Open New Browser-Tab: ErrorCheckSelectedOpts.java
File Size: 4,451 Bytes Line Count: 110 '\n' Characters Found
Switch-Processor: Error-Check Auxiliary-Options:
- View Here: ErrorCheckAuxOpts.java
- Open New Browser-Tab: ErrorCheckAuxOpts.java
File Size: 10,708 Bytes Line Count: 231 '\n' Characters Found
-
-
Field Summary
Quick-Build Option (only for Partial-Builds) Modifier and Type Field boolean
QUICKER_BUILD
User-Selected Menu-Choice Data-Records Modifier and Type Field boolean
compositeStep_RunStage1to4_OptionSelected
boolean
partialWithSync_OptionSelected
boolean
sma_NoBrowserCache_OptionSelected
Auxiliary-Options Record Reference Modifier and Type Field AuxiliaryOptRecord
aor
SelectedOptionsRecord
sor
-
-
-
Field Detail
-
QUICKER_BUILD
public final boolean QUICKER_BUILD
To-Do: Create a detailed explanation of this sick little bugger.
Internally-Used, Declared Public
Class CLI is part of this Build-Package's Publicly-Exposed API, primarily for conveying how the Tool works, rather than for utility. This field is used internally, but is declared public primarily for scenario's where a further investigation for this Tool's internal operations is needed.
The value assigned to this field is determined by the selections and values that where assigned to classConfig's
Configuration-Fields, when "juxtaposed and analyzed" with respect to User-Selected Command-Line Switches which have been passed (at the command line) to the user's'public static void main(String[] argv)'
argv
(String[]
-Array) parameter.- See Also:
BuildPackage.QUICKER_BUILD_SKIP
- Code:
- Exact Field Declaration Expression:
public final boolean QUICKER_BUILD;
-
sma_NoBrowserCache_OptionSelected
public final boolean sma_NoBrowserCache_OptionSelected
There is a way to request that your'.html'
-Files have Meta-Data inside their File-Headers stating that they do not wish the user's Web-Browser to Cache their Java-Doc -Files.
If you are including documentation pages as a part of your Build-Process, then "re-uploading" your Java-Doc'.html'
Pages will be as important as re-compiling and testing your code.
If you are intending to visit, and re-visit a particular Web-Address in whatever browser you are using to view your Java-Doc output, then making sure that your browser does not cache your Web-Pages will save you an endless amount of head-ache.
Wiping your Google Chrome's Cache manually can be a real disaster when your saved Form-Field answers are erased, along with your saved Search-Requests or even your passwords!
How it's Used:
This field is manually populated by the internal CLI-Option Building-Class. All that is occuring is that, internally, a list of classCLI
Main-Menu Options which indicate / necessitate that Stage 8, Set Max Age was entered, by the user, at the command line.
If the User-SelectedMENU_CHOICE
is among the known Stage-8 options, then this field will containTRUE
.
Internally-Used, Declared Public
Class CLI is part of this Build-Package's Publicly-Exposed API, primarily for conveying how the Tool works, rather than for utility. This field is used internally, but is declared public primarily for scenario's where a further investigation for this Tool's internal operations is needed.
The value assigned to this field is determined by the selections and values that where assigned to classConfig's
Configuration-Fields, when "juxtaposed and analyzed" with respect to User-Selected Command-Line Switches which have been passed (at the command line) to the user's'public static void main(String[] argv)'
argv
(String[]
-Array) parameter.
-
partialWithSync_OptionSelected
public final boolean partialWithSync_OptionSelected
This field is assignedTRUE
when a "Partial Build"MENU_CHOICE
has been selected by the user, at the Command-Line, and that choice is one of the choices that requests Step / Stage 5 (Synchronize all'.html'
Files) be run.
Internally-Used, Declared Public
Class CLI is part of this Build-Package's Publicly-Exposed API, primarily for conveying how the Tool works, rather than for utility. This field is used internally, but is declared public primarily for scenario's where a further investigation for this Tool's internal operations is needed.
The value assigned to this field is determined by the selections and values that where assigned to classConfig's
Configuration-Fields, when "juxtaposed and analyzed" with respect to User-Selected Command-Line Switches which have been passed (at the command line) to the user's'public static void main(String[] argv)'
argv
(String[]
-Array) parameter.
-
compositeStep_RunStage1to4_OptionSelected
public final boolean compositeStep_RunStage1to4_OptionSelected
This field is assignedTRUE
if-and-only-if the Composite-Step Menu-Option associated with running Primary-Steps / Primary-Stages #1 to #4 has been selected by the user.
This boolean is required by theRunBuild
class in order to decide whether or not to run the Stage-4 (Archive / Tar / Jar) Process for a Composite-Build.
Internally-Used, Declared Public
Class CLI is part of this Build-Package's Publicly-Exposed API, primarily for conveying how the Tool works, rather than for utility. This field is used internally, but is declared public primarily for scenario's where a further investigation for this Tool's internal operations is needed.
The value assigned to this field is determined by the selections and values that where assigned to classConfig's
Configuration-Fields, when "juxtaposed and analyzed" with respect to User-Selected Command-Line Switches which have been passed (at the command line) to the user's'public static void main(String[] argv)'
argv
(String[]
-Array) parameter.- See Also:
RunBuild.run(BuilderRecord)
- Code:
- Exact Field Declaration Expression:
public final boolean compositeStep_RunStage1to4_OptionSelected;
-
sor
public final SelectedOptionsRecord sor
This record is generated based on the Terminal-Input from'String[] argv'
.
As soon as the Apache-CLI Options are generated, they are compared against the User'sString[] argv
input, and this record is created.
-
aor
public final AuxiliaryOptRecord aor
This Record contains exactly 7final-boolean
fields, each of which corresponds to exactly one of the available Command-Line Terminal Main-Menu Auxialiary-option Switches.
Whenever a user passes a Command-Line Auxiliary Option / Switch at to theString[] argv
parameter, it will be reflected inside thisfinal
class.- See Also:
ErrorCheckAuxOpts
- Code:
- Exact Field Declaration Expression:
public final AuxiliaryOptRecord aor;
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Code:
- Exact Method Body:
return BCYAN + "this.QUICKER_BUILD: " + RESET + this.QUICKER_BUILD + '\n' + BCYAN + "this.sma_NoBrowserCache_OptionSelected: " + RESET + this.sma_NoBrowserCache_OptionSelected + '\n' + BCYAN + "this.partialWithSync_OptionSelected: " + RESET + this.partialWithSync_OptionSelected + '\n' + BCYAN + "this.compositeStep_RunStage1to4_OptionSelected: " + RESET + this.compositeStep_RunStage1to4_OptionSelected + "\n\n" + BCYAN + "this.sor: " + RESET + "[...]\n" + BCYAN + "this.aor: " + RESET + "[...]\n";
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
- Code:
- Exact Method Body:
if (! (other instanceof CLI)) return false; CLI o = (CLI) other; return (this.QUICKER_BUILD == o.QUICKER_BUILD) && (this.sma_NoBrowserCache_OptionSelected == o.sma_NoBrowserCache_OptionSelected) && (this.partialWithSync_OptionSelected == o.partialWithSync_OptionSelected) && (this.compositeStep_RunStage1to4_OptionSelected == o.compositeStep_RunStage1to4_OptionSelected) && Objects.equals(this.sor, o.sor) && Objects.equals(this.aor, o.aor);
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- Code:
- Exact Method Body:
return (1 * (this.QUICKER_BUILD ? 1 : 0)) + (10 * (this.sma_NoBrowserCache_OptionSelected ? 1 : 0)) + (100 * (this.partialWithSync_OptionSelected ? 1 : 0)) + (1_000 * (this.compositeStep_RunStage1to4_OptionSelected ? 1 : 0));
-
-