This repository has been archived by the owner on Jun 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
118 lines (99 loc) · 5.31 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
This file is part of AXS, Annotation-XPath for SAX.
Copyright (c) 2013 Benjamin K. Stuhl
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<project basedir="." default="build" name="AnnotatedXPathSAX">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<property name="LIBVERSION" value="0.7"/>
<tstamp/>
<property name="build" location="target"/>
<property name="dist" location="${build}/dist"/>
<!-- The root directory of your JavaCC install. Only required if you're hacking on the XPath parser -->
<property name="javacc-home" location="${env.JAVACC_HOME}"/>
<property name="runtime-src" location="axs-runtime/src/main/java"/>
<property name="compiler-src" location="axs-compiler/src/main/java"/>
<property name="compiler-resources" location="axs-compiler/src/main/resources"/>
<property name="tests-src" location="axs-runtime/src/test/java"/>
<property name="runtime-build" location="${build}/runtime"/>
<property name="compiler-build" location="${build}/compiler"/>
<property name="tests-build" location="${build}/tests"/>
<property name="runtime-jar" location="${dist}/lib/axs-runtime-${LIBVERSION}.jar"/>
<property name="compiler-jar" location="${dist}/lib/axs-annotation-compiler-${LIBVERSION}.jar"/>
<target name="init">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${runtime-build}"/>
<mkdir dir="${compiler-build}"/>
<mkdir dir="${tests-build}"/>
</target>
<target name="build-runtime" depends="init">
<javac includeantruntime="false" srcdir="${runtime-src}" destdir="${runtime-build}"/>
</target>
<target name="build-runtime-jar" depends="build-runtime">
<mkdir dir="${dist}/lib"/>
<jar jarfile="${runtime-jar}"
basedir="${runtime-build}"/>
</target>
<target name="build-compiler" depends="init">
<mkdir dir="${compiler-build}/resources"/>
<copy todir="${compiler-build}">
<fileset dir="${compiler-src}">
<include name="resources/*"/>
</fileset>
</copy>
<copy todir="${compiler-build}/resources" file="LICENSE"/>
<javac includeantruntime="false" srcdir="${compiler-src}:${runtime-src}" destdir="${compiler-build}"/>
</target>
<target name="build-compiler-jar" depends="build-compiler">
<mkdir dir="${dist}/lib"/>
<jar jarfile="${compiler-jar}"
basedir="${compiler-build}">
<service type="javax.annotation.processing.Processor"
provider="com.googlecode.axs.AnnotationProcessor"/>
</jar>
</target>
<target name="build-tests" depends="build-compiler-jar">
<mkdir dir="${tests-build}/generated"/>
<javac includeantruntime="false" srcdir="${tests-src}" destdir="${tests-build}" classpath="${runtime-jar}">
<compilerarg value="-processorpath"/>
<compilerarg value="${compiler-jar}"/>
<compilerarg value="-s"/>
<compilerarg value="${tests-build}/generated"/>
<!-- <compilerarg value="-Aaxs.nogenerated"/> uncomment to test -->
</javac>
<javac includeantruntime="false" srcdir="${tests-build}/generated" destdir="${tests-build}" classpath="${tests-build}:${runtime-jar}"/>
</target>
<target name="build" depends="build-runtime-jar,build-compiler-jar,build-tests"/>
<target name="rebuild-grammar" depends="init">
<mkdir dir="${compiler-build}/com/googlecode/axs/xpath"/>
<jjtree target="${compiler-resources}/com/googlecode/axs/xpath/Parser.jjt"
javacchome="${javacc-home}" static="false" outputdirectory="${compiler-build}/com/googlecode/axs/xpath"/>
<javacc target="${compiler-resources}/com/googlecode/axs/xpath/Parser.jj"
javacchome="${javacc-home}" static="false" outputdirectory="${compiler-build}/com/googlecode/axs/xpath"/>
</target>
<target name="clean" description="clean up">
<delete dir="${compiler-build}"/>
<delete dir="${runtime-build}"/>
<delete dir="${tests-build}"/>
<delete dir="${dist}"/>
</target>
</project>