forked from yui/yuicompressor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
102 lines (90 loc) · 3.86 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
96
97
98
99
100
101
102
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="YUI Compressor" default="build.jar" basedir=".">
<target name="clean" depends="-load.properties">
<delete dir="${build.dir}" quiet="true"/>
</target>
<target name="-load.properties">
<property file="ant.properties"/>
</target>
<target name="-init" depends="-load.properties">
<delete dir="${build.dir}"/>
<mkdir dir="${build.dir}"/>
</target>
<target name="-updateversion" depends="-init">
<copy todir="${build.dir}/build_tmp">
<fileset dir="${src.dir}"/>
<filterchain>
<replacetokens>
<token key="VERSION" value="${version.number}"/>
</replacetokens>
</filterchain>
</copy>
</target>
<target name="build.classes" depends="-init, -updateversion">
<mkdir dir="${build.dir}/classes"/>
<javac srcdir="${build.dir}/build_tmp"
destdir="${build.dir}/classes"
includes="**/*.java"
deprecation="off"
debug="on"
includeantruntime="false"
target="1.5"
source="1.5">
<classpath>
<pathelement location="${lib.dir}/jargs-1.0.jar"/>
<pathelement location="${lib.dir}/rhino-1.7R2.jar"/>
</classpath>
</javac>
</target>
<target name="-shade" depends="build.classes">
<mkdir dir="${build.dir}/jar"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpath="${lib.dir}/jarjar-1.4.jar"/>
<jarjar jarfile="${build.dir}/${jar.name}">
<fileset dir="${build.dir}/classes" />
<zipfileset src="${lib.dir}/rhino-1.7R2.jar"
excludes="**/Decompiler.class,**/Parser.class,**/Token.class,**/TokenStream.class"/>
<zipfileset src="${lib.dir}/jargs-1.0.jar"/>
<rule pattern="org.mozilla.**" result="com.yahoo.platform.yui.compressor.@1"/>
<manifest>
<attribute name="Main-Class" value="com.yahoo.platform.yui.compressor.Bootstrap"/>
</manifest>
</jarjar>
</target>
<target name="build.jar" depends="-removeemptypackages"/>
<!--
Workaround to remove empty packages. won't need this code once [1] will be resolved
https://code.google.com/p/jarjar/issues/detail?q=empty&id=32
-->
<target name="-removeemptypackages" depends="-shade">
<mkdir dir="${build.dir}/exploded"/>
<unzip src="${build.dir}/${jar.name}" dest="${build.dir}/exploded/"/>
<copy includeemptydirs="false" todir="${build.dir}/unpolluted/">
<fileset dir="${build.dir}/exploded/"/>
</copy>
<jar destfile="${build.dir}/${jar.name}">
<fileset dir="${build.dir}/unpolluted/"/>
<manifest>
<attribute name="Main-Class" value="com.yahoo.platform.yui.compressor.Bootstrap"/>
</manifest>
</jar>
</target>
<target name="build.dist.package" depends="build.jar">
<mkdir dir="${build.dir}/${dist.package.name}"/>
<mkdir dir="${build.dir}/${dist.package.name}/build"/>
<copy file="${build.dir}/${jar.name}" todir="${build.dir}/${dist.package.name}/build"/>
<copy todir="${build.dir}/${dist.package.name}">
<fileset dir=".">
<include name="ant.properties"/>
<include name="build.xml"/>
<include name="doc/**/*"/>
<include name="lib/**/*"/>
<include name="src/**/*"/>
<exclude name="**/CVS"/>
</fileset>
</copy>
<zip destfile="${build.dir}/${dist.package.name}.zip"
basedir="${build.dir}"
includes="${dist.package.name}/**/*"/>
</target>
</project>