forked from restsql/restsql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·171 lines (151 loc) · 6.32 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="restsql" default="dist">
<property file="build.properties" />
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpath="lib/jaxb-xjc.jar" />
<target name="dist" depends="compile,lib,doc,lib-doc" description="generates distribution files" />
<target name="clean" description="deletes output dir">
<delete dir="obj" failonerror="false" includeEmptyDirs="true" quiet="true" />
</target>
<target name="compile" description="compiles sources">
<!-- Create output dir -->
<mkdir dir="obj/bin" />
<!-- Copy supporting files -->
<copy todir="obj/bin">
<fileset dir="src">
<include name="**/*.properties" />
<include name="**/*.xml" />
<include name="**/*.xsd" />
</fileset>
</copy>
<!-- Compile -->
<javac srcdir="src" destdir="obj/bin" classpath="${compile.classpath}" debug="true">
<compilerarg line="-Xlint:all" />
</javac>
</target>
<target name="compile-schema" description="executes xjc on xml files">
<!-- Create output dir -->
<mkdir dir="obj/bin" />
<xjc destdir="src" package="org.restsql.core.sqlresource" removeOldOutput="yes">
<schema file="src/resources/xml/SqlResource.xsd" />
<depends file="src/resources/xml/SqlResource.xsd" />
<produces dir="obj/bin" />
</xjc>
</target>
<target name="lib" depends="lib-war,lib-src" description="generates binary libs and war">
<!-- Create output dir -->
<mkdir dir="obj/lib" />
<!-- Create JAR -->
<jar destfile="obj/lib/restsql-${build.version}.jar">
<fileset dir="obj/bin">
<exclude name="**/*.html" />
</fileset>
<fileset file="CONTRIBUTORS.txt" />
<fileset file="LICENSE.txt" />
<fileset file="README.txt" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Specification-Vendor" value="${manifest.vendor}" />
<attribute name="Specification-Title" value="${manifest.title.jar}" />
<attribute name="Specification-Version" value="${build.version}" />
<attribute name="Implementation-Vendor" value="${manifest.vendor}" />
<attribute name="Implementation-Title" value="${manifest.title.jar}" />
<attribute name="Implementation-Version" value="${build.version}" />
</manifest>
</jar>
<!-- Create WAR -->
<jar destfile="obj/lib/restsql-${build.version}.war">
<fileset dir="obj/war" />
<fileset file="CONTRIBUTORS.txt" />
<fileset file="LICENSE.txt" />
<fileset file="README.txt" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Specification-Vendor" value="${manifest.vendor}" />
<attribute name="Specification-Title" value="${manifest.title.war}" />
<attribute name="Specification-Version" value="${build.version}" />
<attribute name="Implementation-Vendor" value="${manifest.vendor}" />
<attribute name="Implementation-Title" value="${manifest.title.war}" />
<attribute name="Implementation-Version" value="${build.version}" />
</manifest>
</jar>
</target>
<target name="lib-war" depends="compile">
<mkdir dir="obj/war/WEB-INF/classes" />
<copy todir="obj/war/WEB-INF/classes">
<fileset dir="obj/bin">
<exclude name="**/*.html" />
</fileset>
</copy>
<mkdir dir="obj/war/WEB-INF/lib" />
<copy todir="obj/war/WEB-INF/lib">
<path>
<fileset dir="lib" includes="*.jar" excludes="jaxb-*.jar,servlet-api.jar" />
</path>
</copy>
<copy todir="obj/war">
<fileset dir="WebContent" includes="**" />
</copy>
</target>
<target name="lib-src">
<!-- Create output dir -->
<mkdir dir="obj/lib" />
<!-- Create JAR -->
<jar destfile="obj/lib/restsql-${build.version}-src.jar">
<fileset dir="src">
<exclude name="**/*.html" />
</fileset>
<fileset file="CONTRIBUTORS.txt" />
<fileset file="LICENSE.txt" />
<fileset file="README.txt" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Specification-Vendor" value="${manifest.vendor}" />
<attribute name="Specification-Title" value="${manifest.title.src}" />
<attribute name="Specification-Version" value="${build.version}" />
<attribute name="Implementation-Vendor" value="${manifest.vendor}" />
<attribute name="Implementation-Title" value="${manifest.title.src}" />
<attribute name="Implementation-Version" value="${build.version}" />
</manifest>
</jar>
</target>
<target name="lib-doc" description="generates full javadoc jar">
<!-- Create output dir -->
<mkdir dir="obj/lib" />
<!-- Create JAR -->
<jar destfile="obj/lib/restsql-${build.version}-javadoc.jar">
<fileset dir="${javadoc.destdir.full}" />
<fileset file="CONTRIBUTORS.txt" />
<fileset file="LICENSE.txt" />
<fileset file="README.txt" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Specification-Vendor" value="${manifest.vendor}" />
<attribute name="Specification-Title" value="${manifest.title.javadoc}" />
<attribute name="Specification-Version" value="${build.version}" />
<attribute name="Implementation-Vendor" value="${manifest.vendor}" />
<attribute name="Implementation-Title" value="${manifest.title.javadoc}" />
<attribute name="Implementation-Version" value="${build.version}" />
</manifest>
</jar>
</target>
<target name="doc" description="generates javadoc">
<antcall target="-doc">
<param name="destdir" value="${javadoc.destdir.api}" />
<param name="packagenames" value="${javadoc.packagenames.api}" />
</antcall>
<antcall target="-doc">
<param name="destdir" value="${javadoc.destdir.full}" />
<param name="packagenames" value="${javadoc.packagenames.full}" />
</antcall>
</target>
<target name="-doc">
<!-- Create output dir -->
<delete dir="${destdir}" />
<mkdir dir="${destdir}" />
<!-- Javadoc -->
<javadoc sourcepath="src" destdir="${destdir}" access="public" windowtitle="restSQL" author="true" version="true" use="true" bottom="${javadoc.copyright}" classpath="${javadoc.classpath}" packagenames="${packagenames}" overview="${javadoc.overview}">
<link offline="true" packagelistloc="${javadoc.javase6.package-list.dir}" href="${javadoc.javase6.href}" />
<tag name="todo" scope="all" description="To do:" />
</javadoc>
</target>
</project>