-
-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathbuild.xml
More file actions
83 lines (68 loc) · 3.31 KB
/
build.xml
File metadata and controls
83 lines (68 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0"?>
<project name="Processing SVG Library" default="build">
<property name="core.library.jar" location="../../../core/library/core.jar" />
<property name="batik.version" value="1.19" />
<!-- the .zip file to be downloaded -->
<property name="batik.zip" value="batik-bin-${batik.version}.zip" />
<!-- the .jar file that we need from the download -->
<property name="batik.extract.jar" value="batik-all-${batik.version}.jar" />
<!-- the local name of the file that will be used -->
<property name="batik.library.jar" location="library/batik.jar" />
<!-- URL for the version of Batik currently supported by this library. -->
<property name="batik.url"
value="https://dlcdn.apache.org//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="${batik.library.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" />
<!-- 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=".">
<patternset>
<!-- unzip a single jar from the zip.prefix subdirectory in the .zip -->
<include name="${zip.prefix}/${batik.extract.jar}"/>
</patternset>
<mapper>
<!-- remove the zip.prefix from the path when saving the .jar -->
<globmapper from="${zip.prefix}/*" to="*"/>
</mapper>
</unzip>
<rename src="${batik.extract.jar}" dest="${batik.library.jar}" />
<delete file="${batik.zip}" />
</target>
<target name="compile" depends="download-batik" description="Compile sources">
<condition property="core-built">
<available file="${core.library.jar}" />
</condition>
<fail unless="core-built" message="Please build the core library first and make sure it is located at ${core.library.jar}" />
<mkdir dir="bin" />
<javac source="17" target="17"
srcdir="src" destdir="bin"
encoding="UTF-8"
includeAntRuntime="false"
classpath="${core.library.jar}; ${batik.library.jar}"
nowarn="true" />
</target>
<target name="build" depends="compile" description="Build SVG library">
<jar basedir="bin" destfile="library/svg.jar" />
</target>
<target name="clean" description="Clean the build directories">
<delete dir="bin" />
<delete file="library/svg.jar" />
</target>
<target name="clean-libs" description="Clean the build directories">
<delete file="${batik.library.jar}" />
</target>
</project>