Files
processing4/java/libraries/svg/build.xml
2021-06-18 15:26:31 -04:00

76 lines
3.0 KiB
XML

<?xml version="1.0"?>
<project name="Processing SVG Library" default="build">
<target name="clean" description="Clean the build directories">
<delete dir="bin" />
<delete file="library/svg.jar" />
</target>
<property name="batik.version" value="1.14" />
<!-- the .zip file to be downloaded -->
<property name="batik.zip" value="batik-bin-${batik.version}.zip" />
<!-- the .jar file that's the actual dependency -->
<property name="batik.jar" value="batik-all-${batik.version}.jar" />
<!-- URL for the version of Batik currently supported by this library. -->
<property name="batik.url"
value="https://archive.apache.org/dist/xmlgraphics/batik/binaries/${batik.zip}" />
<!-- Storing a "local" copy in case the original link goes dead. When updating
releases, please upload the new version to download.processing.org. -->
<property name="batik.url.backup"
value="https://download.processing.org/batik/${batik.zip}" />
<available file="library/${batik.jar}" property="batik.present" />
<!-- ok to ignore failed downloads if we at least have a version that's local -->
<condition property="batik.ignorable" value="false" else="true">
<isset property="batik.present" />
</condition>
<target name="download-batik" unless="batik.present">
<get src="${batik.url}" dest="."
ignoreerrors="${batik.ignorable}"
usetimestamp="true" />
<!-- <property name="zip.prefix" value="batik-${batik.version}/lib/${batik.jar}" /> -->
<property name="zip.prefix" value="batik-${batik.version}/lib" />
<!-- Formerly used batik-awt-util-1.8.jar, batik-dom-1.8.jar, batik-ext-1.8.jar,
batik-svggen-1.8.jar, batik-util-1.8.jar, batik-xml-1.8.jar but using
the big feller from now on since file size is less important, and there
were complaints about some .jar files not being available. -->
<unzip src="${batik.zip}" dest="library">
<patternset>
<!-- unzip a single jar from the zip.prefix subdirectory in the .zip -->
<include name="${zip.prefix}/${batik.jar}"/>
</patternset>
<mapper>
<!-- remove the zip.prefix from the path when saving the .jar -->
<globmapper from="${zip.prefix}/*" to="*"/>
</mapper>
</unzip>
<delete file="${batik.zip}" />
</target>
<target name="compile" depends="download-batik" description="Compile sources">
<condition property="core-built">
<available file="../../../core/library/core.jar" />
</condition>
<fail unless="core-built" message="Please build the core library first and make sure it sits in ../../../core/library/core.jar" />
<mkdir dir="bin" />
<javac source="11" target="11"
srcdir="src" destdir="bin"
encoding="UTF-8"
includeAntRuntime="false"
classpath="../../../core/library/core.jar; library/${batik.jar};"
nowarn="true" />
</target>
<target name="build" depends="compile" description="Build SVG library">
<jar basedir="bin" destfile="library/svg.jar" />
</target>
</project>