Here is an ant script for generating TeX code and documentation for one LaTeX class and one LaTeX package. It is my first larger ant script: I welcome suggestions for improvements.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="customer TeX code" default="main">
<description>Buildscript for the LaTeX classes and packages</description>
<property name="foo" value="foo" />
<property name="bar" value="bar" />
<!-- target: init -->
<target name="init" description="initialize properties">
<condition property="foo.uptodate">
<and>
<available file="${foo}.cls" />
<available file="${foo}.drv" />
<available file="${foo}.pdf" />
<uptodate property="foo.cls.uptodate" targetfile="${foo}.cls">
<srcfiles file="${foo}.dtx" />
<srcfiles file="${foo}.ins" />
</uptodate>
<uptodate property="foo.drv.uptodate" targetfile="${foo}.drv">
<srcfiles file="${foo}.dtx" />
<srcfiles file="${foo}.ins" />
</uptodate>
<uptodate property="foo.pdf.uptodate" targetfile="${foo}.pdf">
<srcfiles file="${foo}.dtx" />
<srcfiles file="${foo}.ins" />
</uptodate>
</and>
</condition>
<condition property="bar.uptodate">
<and>
<available file="${bar}.sty" />
<available file="${bar}.drv" />
<available file="${bar}.pdf" />
<uptodate property="bar.sty.uptodate" targetfile="${bar}.sty">
<srcfiles file="${bar}.dtx" />
<srcfiles file="${bar}.ins" />
</uptodate>
<uptodate property="bar.drv.uptodate" targetfile="${bar}.drv">
<srcfiles file="${bar}.dtx" />
<srcfiles file="${bar}.ins" />
</uptodate>
<uptodate property="bar.pdf.uptodate" targetfile="${bar}.pdf">
<srcfiles file="${bar}.dtx" />
<srcfiles file="${bar}.ins" />
</uptodate>
</and>
</condition>
</target>
<!-- target: foo -->
<target name="foo" unless="foo.uptodate" depends="init" description="builds all files for the foo class">
<exec executable="latex" failonerror="true">
<arg value="${foo}.ins" />
</exec>
<exec executable="lualatex" failonerror="true">
<arg value="-draftmode" />
<arg value="${foo}.drv" />
</exec>
<parallel>
<exec executable="makeindex" failonerror="true">
<arg value="-s" />
<arg value="gind.ist" />
<arg value="-t" />
<arg value="${foo}.ind.ilg" />
<arg value="${foo}.idx" />
</exec>
<exec executable="makeindex" failonerror="true">
<arg value="-s" />
<arg value="gglo.ist" />
<arg value="-t" />
<arg value="${foo}.gls.ilg" />
<arg value="-o" />
<arg value="${foo}.gls" />
<arg value="${foo}.glo" />
</exec>
</parallel>
<exec executable="lualatex" failonerror="true">
<arg value="-draftmode" />
<arg value="${foo}.drv" />
</exec>
<exec executable="lualatex" failonerror="true">
<arg value="${foo}.drv" />
</exec>
</target>
<!-- target: bar -->
<target name="bar" unless="bar.uptodate" depends="init" description="builds all files for the bar package">
<exec executable="latex" failonerror="true">
<arg value="${bar}.ins" />
</exec>
<exec executable="lualatex" failonerror="true">
<arg value="-draftmode" />
<arg value="${bar}.drv" />
</exec>
<parallel>
<exec executable="makeindex" failonerror="true">
<arg value="-s" />
<arg value="gind.ist" />
<arg value="-t" />
<arg value="${bar}.ind.ilg" />
<arg value="${bar}.idx" />
</exec>
<exec executable="makeindex" failonerror="true">
<arg value="-s" />
<arg value="gglo.ist" />
<arg value="-t" />
<arg value="${bar}.gls.ilg" />
<arg value="-o" />
<arg value="${bar}.gls" />
<arg value="${bar}.glo" />
</exec>
</parallel>
<exec executable="lualatex" failonerror="true">
<arg value="-draftmode" />
<arg value="${bar}.drv" />
</exec>
<exec executable="lualatex" failonerror="true">
<arg value="${bar}.drv" />
</exec>
</target>
<!-- target: main -->
<target name="main" depends="foo, bar" description="default target" />
</project>
latexmk
which ships with all modern TeX distributions and which is a versatile build tool for TeX (requiring in most cases zero configuration)? \$\endgroup\$:-)
\$\endgroup\$