OnJava8-Tools
OnJava8-Tools copied to clipboard
Tools for building the On Java 8 book and creating the examples
Python tools for building the On Java book
This is hacky, often embarrassing, but working code. I make no apologies and promise no explanations.
-
This is what I'm currently using, and updating. I'm not looking for pull requests. Unless you need me to add something like shell scripts to match the Windows batch scripts, to make it more convenient. But nothing that changes the current behavior of
OnJava-Tools. -
Thanks for your help, those who requested this!
How to set up to successfully generate the example files and Gradle build for On Java
-
Install Python 3.5
-
Add this directory (
OnJava-Tools) to your execution path. -
You'll need to install my tools, and probably a number of other things that will be revealed when you try to run the tools.
-
To extract the Example files from the book source (you must have permission and a clone of the book source -- if you don't, this isn't for you), run
e all. After that you should be able to successfully rungradlew runon the result.
To Automatically Insert Generated Output Back Into Source Files & Book
-
After extraction (
e all), rungradlew run. This generates the*.outfiles which live in the same directories as the source files. -
Run
_update_extracted_example_output format-and-include-new-output. This generates the*.p1(phase one) files and reformats the output to the proper width. Thep1files are also in the same directories as the source files. Thep1files are inserted into the Java files as/* Output:and then the Java files are placed into the book. -
Visually check the output using Github Desktop. Run
e allandgradlew runa second time to ensure nothing was corrupted. -
At this point if you run
_verify_output -a, everything should show up asexact_match.