-
Notifications
You must be signed in to change notification settings - Fork 105
/
build.xml
196 lines (174 loc) · 10.1 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<project default="jar" name="W3C CSS Validator">
<!-- =================================================================== -->
<!-- User-overrideable properties -->
<!-- =================================================================== -->
<property name="servlet.lib" value="/usr/share/java/servlet-2.3.jar"/>
<!-- =================================================================== -->
<!-- Project-wide properties -->
<!-- =================================================================== -->
<!-- Overriding those properties works too, but is not advisable. -->
<property name="app.name" value="css-validator"/>
<property name="jar.file" value="${app.name}.jar"/>
<property name="war.file" value="${app.name}.war"/>
<!-- =================================================================== -->
<!-- Targets -->
<!-- =================================================================== -->
<path id="build.class.path">
<pathelement location="${servlet.lib}"/>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="prepare.check">
<condition property="prepare.run">
<and>
<available file="lib/jigsaw-2.2.6.jar"/>
<available file="lib/commons-beanutils-1.9.4.jar"/>
<available file="lib/commons-collections4-4.4.jar"/>
<available file="lib/commons-digester-1.8.1.jar"/>
<available file="lib/commons-digester3-3.2.jar"/>
<available file="lib/commons-lang-2.6.jar"/>
<available file="lib/commons-lang3-3.14.0.jar"/>
<available file="lib/commons-logging-1.2.jar"/>
<available file="lib/commons-text-1.11.0.jar"/>
<available file="lib/commons-validator-1.7.jar"/>
<available file="lib/velocity-2.3.jar"/>
<available file="lib/xercesImpl-2.12.1.jar"/>
<available file="lib/xml-apis-1.4.01.jar"/>
<available file="lib/tagsoup-1.2.1.jar"/>
<available file="lib/servlet-api-2.5-6.0.1.jar"/>
<available file="lib/htmlparser-1.4.16.jar"/>
<available file="lib/velocity-tools-3.1.jar"/>
<available file="lib/slf4j-api-1.7.32.jar"/>
<available file="lib/slf4j-nop-1.7.32.jar"/>
</and>
</condition>
</target>
<target name="prepare" description="Downloads necessary libs" depends="prepare.check" unless="prepare.run">
<mkdir dir="lib"/>
<mkdir dir="tmp"/>
<get dest="tmp/jigsaw-2.2.6.jar" src="https://repo1.maven.org/maven2/org/w3c/jigsaw/jigsaw/2.2.6/jigsaw-2.2.6.jar" usetimestamp="true"/>
<get dest="tmp/commons-beanutils-1.9.4.jar" src="https://repo1.maven.org/maven2/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar" usetimestamp="true"/>
<get dest="tmp/commons-collections4-4.4.jar" src="https://repo1.maven.org/maven2/org/apache/commons/commons-collections4/4.4/commons-collections4-4.4.jar" usetimestamp="true"/>
<get dest="tmp/commons-digester-1.8.1.jar" src="https://repo1.maven.org/maven2/commons-digester/commons-digester/1.8.1/commons-digester-1.8.1.jar" usetimestamp="true"/>
<get dest="tmp/commons-digester3-3.2.jar" src="https://repo1.maven.org/maven2/org/apache/commons/commons-digester3/3.2/commons-digester3-3.2.jar" usetimestamp="true"/>
<get dest="tmp/commons-lang-2.6.jar" src="https://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" usetimestamp="true"/>
<get dest="tmp/commons-lang3-3.14.0.jar" src="https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar" usetimestamp="true"/>
<get dest="tmp/commons-text-1.11.0.jar" src="https://repo1.maven.org/maven2/org/apache/commons/commons-text/1.11.0/commons-text-1.11.0.jar" usetimestamp="true"/>
<get dest="tmp/commons-logging-1.2.jar" src="https://repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar" usetimestamp="true"/>
<get dest="tmp/commons-validator-1.7.jar" src="https://repo1.maven.org/maven2/commons-validator/commons-validator/1.7/commons-validator-1.7.jar" usetimestamp="true"/>
<get dest="tmp/velocity-2.3.jar" src="https://repo1.maven.org/maven2/org/apache/velocity/velocity-engine-core/2.3/velocity-engine-core-2.3.jar" usetimestamp="true"/>
<get dest="tmp/velocity-tools-3.1.jar" src="https://repo1.maven.org/maven2/org/apache/velocity/tools/velocity-tools-generic/3.1/velocity-tools-generic-3.1.jar" usetimestamp="true"/>
<get dest="tmp/xercesImpl-2.12.1.jar" src="https://repo1.maven.org/maven2/xerces/xercesImpl/2.12.1/xercesImpl-2.12.1.jar" usetimestamp="true"/>
<get dest="tmp/xml-apis-1.4.01.jar" src="https://repo1.maven.org/maven2/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar" usetimestamp="true"/>
<get dest="tmp/tagsoup-1.2.1.jar" src="https://repo1.maven.org/maven2/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar" usetimestamp="true"/>
<get dest="tmp/servlet-api-2.5-6.0.1.jar" src="https://repo1.maven.org/maven2/org/mortbay/jetty/servlet-api/2.5-6.0.1/servlet-api-2.5-6.0.1.jar" usetimestamp="true"/>
<get dest="tmp/htmlparser-1.4.16.jar" src="https://repo1.maven.org/maven2/nu/validator/htmlparser/1.4.16/htmlparser-1.4.16.jar" usetimestamp="true"/>
<get dest="tmp/slf4j-api-1.7.32.jar" src="https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.32/slf4j-api-1.7.32.jar" usetimestamp="true"/>
<get dest="tmp/slf4j-nop-1.7.32.jar" src="https://repo1.maven.org/maven2/org/slf4j/slf4j-nop/1.7.32/slf4j-nop-1.7.32.jar" usetimestamp="true"/>
<copy file="tmp/servlet-api-2.5-6.0.1.jar" tofile="lib/servlet-api-2.5-6.0.1.jar"/>
<copy file="tmp/jigsaw-2.2.6.jar" tofile="lib/jigsaw-2.2.6.jar"/>
<copy file="tmp/commons-beanutils-1.9.4.jar" tofile="lib/commons-beanutils-1.9.4.jar"/>
<copy file="tmp/commons-collections4-4.4.jar" tofile="lib/commons-collections4-4.4.jar"/>
<copy file="tmp/commons-digester-1.8.1.jar" tofile="lib/commons-digester-1.8.1.jar"/>
<copy file="tmp/commons-digester3-3.2.jar" tofile="lib/commons-digester3-3.2.jar"/>
<copy file="tmp/commons-lang-2.6.jar" tofile="lib/commons-lang-2.6.jar"/>
<copy file="tmp/commons-lang3-3.14.0.jar" tofile="lib/commons-lang3-3.14.0.jar"/>
<copy file="tmp/commons-text-1.11.0.jar" tofile="lib/commons-text-1.11.0.jar"/>
<copy file="tmp/commons-logging-1.2.jar" tofile="lib/commons-logging-1.2.jar"/>
<copy file="tmp/commons-validator-1.7.jar" tofile="lib/commons-validator-1.7.jar"/>
<copy file="tmp/velocity-2.3.jar" tofile="lib/velocity-2.3.jar"/>
<copy file="tmp/velocity-tools-3.1.jar" tofile="lib/velocity-tools-3.1.jar"/>
<copy file="tmp/xercesImpl-2.12.1.jar" tofile="lib/xercesImpl-2.12.1.jar"/>
<copy file="tmp/xml-apis-1.4.01.jar" tofile="lib/xml-apis-1.4.01.jar"/>
<copy file="tmp/tagsoup-1.2.1.jar" tofile="lib/tagsoup-1.2.1.jar"/>
<copy file="tmp/htmlparser-1.4.16.jar" tofile="lib/htmlparser-1.4.16.jar"/>
<copy file="tmp/slf4j-api-1.7.32.jar" tofile="lib/slf4j-api-1.7.32.jar"/>
<copy file="tmp/slf4j-nop-1.7.32.jar" tofile="lib/slf4j-nop-1.7.32.jar"/>
</target>
<target name="build" description="Builds the validator" depends="prepare">
<mkdir dir="./build"/>
<javac classpathref="build.class.path" destdir="./build" encoding="UTF-8"
debug="yes" includes="org/w3c/**" srcdir="." source="8" target="8"
includeantruntime="false"/>
<copy todir="./build">
<fileset dir="./">
<include name="org/**"/>
<exclude name="**/*.java"/>
<exclude name="**/*.class"/>
</fileset>
</copy>
</target>
<target name="jigsaw" description="Builds the validator for Jigsaw" depends="prepare">
<mkdir dir="./build"/>
<javac classpathref="build.class.path" destdir="." encoding="UTF-8"
debug="yes" source="8" target="8">
<src path="./org/w3c"/>
</javac>
</target>
<target name="javadoc" description="Generates API docs">
<mkdir dir="./javadoc"/>
<javadoc
packagenames="org.w3c.*"
sourcepath="./"
destdir="./javadoc"
author="true"
version="true"
windowtitle="W3C CSS Validator API"/>
</target>
<target name="jar" depends="build" description="Creates the lib archive with all dependency jars included">
<delete file="${jar.file}"/>
<jar jarfile="${jar.file}" basedir="build" excludes="org/**/*.java">
<zipgroupfileset dir="lib" includes="*.jar"/>
<include name="org/**"/>
<manifest>
<attribute name="Main-Class" value="org.w3c.css.css.CssValidator"/>
</manifest>
</jar>
</target>
<target name="jar-without-dependencies" depends="build" description="Creates the lib archive without dependency jars">
<delete file="${jar.file}"/>
<jar jarfile="${jar.file}" basedir="build" excludes="org/**/*.java">
<include name="org/**"/>
<manifest>
<attribute name="Main-Class" value="org.w3c.css.css.CssValidator"/>
</manifest>
</jar>
</target>
<target name="war" depends="build" description="Creates the webapp module">
<delete file="${war.file}"/>
<war warfile="${war.file}" webxml="web.xml" basedir="." includes="*html*,favicon.ico,images/**,style/**,scripts/**,tabtastic/**" excludes="html,css-validator.*">
<classes dir="build"/>
<lib dir="lib">
<exclude name="*servlet*.jar"/>
</lib>
</war>
</target>
<target name="autotest" depends="jar">
<fail message=" ${line.separator}${line.separator}
Usage: ant autotest -Dtestfile=testsuite/xml/FILENAME.xml">
<condition>
<not>
<isset property="testfile"/>
</not>
</condition>
</fail>
<javac srcdir="autotest" classpath="css-validator.jar"
includeantruntime="false"/>
<java classname="autotest.AutoTest" classpath="css-validator.jar">
<arg value="${testfile}"/>
</java>
</target>
<target name="javacc">
<ant antfile="build.xml" dir="javacc"/>
</target>
<target name="clean" description="Cleans up generated files">
<delete file="${jar.file}"/>
<delete file="${war.file}"/>
<delete dir="./build"/>
<delete dir="./javadoc"/>
<delete dir="./tmp"/>
</target>
</project>