forked from depsypher/pngtastic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
95 lines (83 loc) · 2.8 KB
/
build.xml
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
84
85
86
87
88
89
90
91
92
93
94
95
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<!--
Pngtastic - PNG image optimizer
-->
<project name="pngtastic" default="dist">
<property file="build.properties" />
<property name="pngtastic.version" value="1.2" />
<path id="project.classpath">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</path>
<path id="javadoc.classpath">
<path refid="project.classpath" />
</path>
<!--
Clean up
-->
<target name="clean" description="Removes all generated files">
<delete dir="build" quiet="true" />
</target>
<!--
Compile the code
-->
<target name="compile" description="Compiles the code">
<mkdir dir="build/pngtastic/classes" />
<javac srcdir="src/main/java" destdir="build/pngtastic/classes" includeantruntime="false" debug="on" source="1.7" target="1.7">
<classpath refid="project.classpath" />
</javac>
</target>
<!--
Build the app
-->
<target name="dist" description="Builds the app" depends="compile">
<mkdir dir="build/dist" />
<jar destfile="build/dist/pngtastic-${pngtastic.version}.jar">
<fileset dir="build/pngtastic/classes" />
<manifest>
<attribute name="Pngtastic-Version" value="${pngtastic.version}" />
</manifest>
</jar>
</target>
<!--
Generate javadocs
-->
<target name="javadoc">
<mkdir dir="build/javadoc/api" />
<javadoc sourcepath="src/main/java" destdir="build/javadoc/api" packagenames="*">
<classpath refid="javadoc.classpath" />
</javadoc>
</target>
<!--
Run the pngtastic optimizer ant task on the included images
-->
<target name="optimize" depends="dist">
<taskdef classname="com.googlecode.pngtastic.ant.PngOptimizerTask" classpath="build/dist/pngtastic-${pngtastic.version}.jar" name="pngtastic" />
<pngtastic todir="build/images" removeGamma="true" compressionLevel="9" loglevel="info">
<fileset dir="images">
<include name="optimizer/**/*.png" />
</fileset>
</pngtastic>
</target>
<target name="optimize-zopfli" depends="dist">
<taskdef classname="com.googlecode.pngtastic.ant.PngOptimizerTask" classpath="build/dist/pngtastic-${pngtastic.version}.jar" name="pngtastic" />
<pngtastic todir="build/images" removeGamma="true" compressor="zopfli" loglevel="info">
<fileset dir="images">
<include name="optimizer/**/*.png" />
</fileset>
</pngtastic>
</target>
<!--
Run the pngtastic optimizer ant task and create data uris on the included images
-->
<target name="generateDataUriCss" depends="dist">
<taskdef classname="com.googlecode.pngtastic.ant.PngOptimizerTask" classpath="build/dist/pngtastic-${pngtastic.version}.jar" name="pngtastic" />
<pngtastic todir="build/images" generateDataUriCss="true" removeGamma="true" compressionLevel="9" loglevel="info">
<fileset dir="images">
<include name="optimizer/pngsuite/**/*.png" />
</fileset>
</pngtastic>
</target>
</project>