Gradle build infrastructure for lectures
Gradle infrastructure to build Information Science lectures based on Nigel’s LaTeX lecture classes.
- multiple configurable document targets: slides, handout, notes, examples
- dynamic targets for building PDF images from PlantUML, SVG, R
- builds separate working preview and final published PDFs with lecture numbers (the latter include the lecture number in the file name)
- uses XeLaTeX via
This repository serves as both the canonical source for the Gradle files and as an example of how to set things up.
Setting up a new set of lectures
- Clone this repo somewhere.
- Create a top level
- If you’re using Git, copy
lectures and rename it to something that makes sense. The prefix numbering is important. Gradle uses it to figure out the lecture number (but you can override this manually per lecture). You can duplicate and rename this folder for each new lecture you need (e.g.,
lectures/settings.gradle and make sure there is an
include line for each individual lecture. Remember to update if you change things later, otherwise things will probably not build.
- Edit each lecture’s
build.gradle to configure targets and images. The individual lecture folders must not have a
settings.gradle file, it will break things.
- Add the various content files as outlined below.
Updating the plugin
git pull in the plugin repository.
- Copy the new
buildSrc directory to your
- Check whether any lecture build scripts need to be updated.
Typical lecture directory tree
The way Nigel does things 😁.
lecturedates.tex -> ../lecturedates.tex
paper_init.tex -> ../paper_init.tex
Typical gradle tasks
As applicable depending on which document targets are enabled. This list is not comprehensive, run
gradle tasks --all for a complete list.
- docs - Build all documents. [preview]
- examples - Build examples document. [preview]
- examples.numbered - Build numbered version of examples document. [final]
- handout - Build handout document. [preview]
- handout.numbered - Build numbered version of handout document. [final]
- images - Generate all images from their sources (e.g., PlantUML).
- notes - Build notes document. [preview]
- notes.numbered - Build numbered version of notes document. [final]
- numbered - Create numbered versions of all documents. [final]
- slides - Build slides document. [preview]
- slides.numbered - Build numbered version of slides document. [final]
A dynamic task is created for each generated image, e.g.:
- images.image1.pdf - Generate
- debug - Print debugging information.
- clean - Clean up intermediate files.
- deepClean - Remove all files not in Git. [`git clean -fXd`]