6742 |
19 May 22 |
nicklas |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
6742 |
19 May 22 |
nicklas |
2 |
<project |
6742 |
19 May 22 |
nicklas |
3 |
name="WebAuthn" |
6742 |
19 May 22 |
nicklas |
4 |
default="build" |
6742 |
19 May 22 |
nicklas |
5 |
basedir="."> |
6742 |
19 May 22 |
nicklas |
6 |
|
6742 |
19 May 22 |
nicklas |
<!--create this file if you need to override values from properties below --> |
6742 |
19 May 22 |
nicklas |
8 |
<property file="build.properties" /> |
6742 |
19 May 22 |
nicklas |
9 |
|
6742 |
19 May 22 |
nicklas |
<!-- variables used --> |
6742 |
19 May 22 |
nicklas |
11 |
<property name="name" value="webauthn" /> |
6793 |
05 Aug 22 |
nicklas |
12 |
<property name="version" value="1.0-beta4" /> |
6742 |
19 May 22 |
nicklas |
13 |
<property name="src" location="src" description="Location of source files" /> |
6742 |
19 May 22 |
nicklas |
14 |
<property name="build" location="build" description="Location of compiled files" /> |
6742 |
19 May 22 |
nicklas |
15 |
<property name="dist" location="dist" description="Directory where distribution should be created" /> |
6742 |
19 May 22 |
nicklas |
16 |
<property name="jar.name" value="${name}.jar" description="Name of JAR file with the extensions." /> |
6742 |
19 May 22 |
nicklas |
17 |
<property name="tar.prefix" value="${name}-${version}" description="Prefix of .tar.gz file for download." /> |
6742 |
19 May 22 |
nicklas |
18 |
<property name="tar.name" value="${tar.prefix}.tar.gz" description="Full name of .tar.gz file for download." /> |
6742 |
19 May 22 |
nicklas |
19 |
<property name="javac.arg" value="-Xlint:unchecked" /> |
6764 |
03 Jun 22 |
nicklas |
20 |
<property name="javac.release" value="11" /> |
6742 |
19 May 22 |
nicklas |
21 |
<property name="javac.encoding" value="UTF-8" /> |
6742 |
19 May 22 |
nicklas |
22 |
<property name="depend.base-version" |
6749 |
25 May 22 |
nicklas |
23 |
value="3.19.3" |
6742 |
19 May 22 |
nicklas |
24 |
description="The BASE version that this project depends on." |
6742 |
19 May 22 |
nicklas |
25 |
/> |
6742 |
19 May 22 |
nicklas |
26 |
<property name="depend.jars" |
6742 |
19 May 22 |
nicklas |
27 |
value="https://base.thep.lu.se/chrome/site/files/base/jars/${depend.base-version}" |
6742 |
19 May 22 |
nicklas |
28 |
description="The location of the BASE core JARs that this project depends on." |
6742 |
19 May 22 |
nicklas |
29 |
/> |
6742 |
19 May 22 |
nicklas |
30 |
|
6742 |
19 May 22 |
nicklas |
<!-- set up classpath for compiling --> |
6742 |
19 May 22 |
nicklas |
32 |
<path id="classpath"> |
6742 |
19 May 22 |
nicklas |
33 |
<fileset dir="lib"> |
6742 |
19 May 22 |
nicklas |
34 |
<include name="**/*.jar" /> |
6742 |
19 May 22 |
nicklas |
35 |
</fileset> |
6742 |
19 May 22 |
nicklas |
36 |
<fileset dir="META-INF/lib"> |
6742 |
19 May 22 |
nicklas |
37 |
<include name="**/*.jar" /> |
6742 |
19 May 22 |
nicklas |
38 |
</fileset> |
6742 |
19 May 22 |
nicklas |
39 |
</path> |
6742 |
19 May 22 |
nicklas |
40 |
|
6742 |
19 May 22 |
nicklas |
41 |
<target name="init"> |
6742 |
19 May 22 |
nicklas |
42 |
<mkdir dir="${build}" /> |
6742 |
19 May 22 |
nicklas |
43 |
<mkdir dir="${dist}" /> |
6742 |
19 May 22 |
nicklas |
44 |
</target> |
6742 |
19 May 22 |
nicklas |
45 |
|
6742 |
19 May 22 |
nicklas |
46 |
<target name="clean"> |
6742 |
19 May 22 |
nicklas |
47 |
<delete failonerror="false" includeemptydirs="true"> |
6742 |
19 May 22 |
nicklas |
48 |
<fileset dir="${build}" defaultexcludes="no" /> |
6742 |
19 May 22 |
nicklas |
49 |
<fileset dir="${dist}" defaultexcludes="no" /> |
6742 |
19 May 22 |
nicklas |
50 |
<fileset dir="lib" includes="base-*.jar" /> |
6742 |
19 May 22 |
nicklas |
51 |
<fileset file="${jar.name}" /> |
6742 |
19 May 22 |
nicklas |
52 |
<fileset file="${tar.name}" /> |
6742 |
19 May 22 |
nicklas |
53 |
</delete> |
6742 |
19 May 22 |
nicklas |
54 |
</target> |
6742 |
19 May 22 |
nicklas |
55 |
|
6742 |
19 May 22 |
nicklas |
56 |
<target |
6742 |
19 May 22 |
nicklas |
57 |
name="dist" |
6742 |
19 May 22 |
nicklas |
58 |
depends="clean,download-lib,build" |
6742 |
19 May 22 |
nicklas |
59 |
> |
6742 |
19 May 22 |
nicklas |
60 |
<copy todir="${dist}"> |
6753 |
31 May 22 |
nicklas |
61 |
<fileset dir="." includes="README,LICENSE,webauthn.properties,webauthn-extended-properties.xml" /> |
6742 |
19 May 22 |
nicklas |
62 |
<fileset file="${jar.name}" /> |
6742 |
19 May 22 |
nicklas |
63 |
</copy> |
6742 |
19 May 22 |
nicklas |
64 |
</target> |
6742 |
19 May 22 |
nicklas |
65 |
|
6742 |
19 May 22 |
nicklas |
66 |
<target |
6742 |
19 May 22 |
nicklas |
67 |
name="package" |
6742 |
19 May 22 |
nicklas |
68 |
depends="dist" |
6742 |
19 May 22 |
nicklas |
69 |
description="Create binary distribution package" |
6742 |
19 May 22 |
nicklas |
70 |
> |
6742 |
19 May 22 |
nicklas |
71 |
<tar |
6742 |
19 May 22 |
nicklas |
72 |
destfile="${tar.name}" |
6742 |
19 May 22 |
nicklas |
73 |
longfile="gnu" |
6742 |
19 May 22 |
nicklas |
74 |
compression="gzip" |
6742 |
19 May 22 |
nicklas |
75 |
> |
6742 |
19 May 22 |
nicklas |
76 |
<tarfileset |
6742 |
19 May 22 |
nicklas |
77 |
dir="${dist}" |
6742 |
19 May 22 |
nicklas |
78 |
mode="755" |
6742 |
19 May 22 |
nicklas |
79 |
prefix="${tar.prefix}" |
6742 |
19 May 22 |
nicklas |
80 |
preserveLeadingSlashes="true" |
6742 |
19 May 22 |
nicklas |
81 |
> |
6742 |
19 May 22 |
nicklas |
82 |
<include name="**/*.sh" /> |
6742 |
19 May 22 |
nicklas |
83 |
</tarfileset> |
6742 |
19 May 22 |
nicklas |
84 |
<tarfileset |
6742 |
19 May 22 |
nicklas |
85 |
dir="${dist}" |
6742 |
19 May 22 |
nicklas |
86 |
prefix="${tar.prefix}" |
6742 |
19 May 22 |
nicklas |
87 |
preserveLeadingSlashes="true" |
6742 |
19 May 22 |
nicklas |
88 |
> |
6742 |
19 May 22 |
nicklas |
89 |
<exclude name="**/*.sh" /> |
6742 |
19 May 22 |
nicklas |
90 |
</tarfileset> |
6742 |
19 May 22 |
nicklas |
91 |
</tar> |
6742 |
19 May 22 |
nicklas |
92 |
</target> |
6742 |
19 May 22 |
nicklas |
93 |
|
6742 |
19 May 22 |
nicklas |
94 |
<target |
6742 |
19 May 22 |
nicklas |
95 |
name="install" |
6742 |
19 May 22 |
nicklas |
96 |
depends="build" |
6742 |
19 May 22 |
nicklas |
97 |
> |
6742 |
19 May 22 |
nicklas |
98 |
<fail unless="base.plugins" message="base.plugins is not set to the path of BASE plug-ins directory." /> |
6742 |
19 May 22 |
nicklas |
99 |
<copy todir="${base.plugins}"> |
6742 |
19 May 22 |
nicklas |
100 |
<fileset file="${jar.name}" /> |
6742 |
19 May 22 |
nicklas |
101 |
</copy> |
6742 |
19 May 22 |
nicklas |
102 |
<echo>Copied '${jar.name}' to '${base.plugins}'.</echo> |
6742 |
19 May 22 |
nicklas |
103 |
</target> |
6742 |
19 May 22 |
nicklas |
104 |
|
6742 |
19 May 22 |
nicklas |
105 |
|
6742 |
19 May 22 |
nicklas |
106 |
<target |
6742 |
19 May 22 |
nicklas |
107 |
name="build" |
6742 |
19 May 22 |
nicklas |
108 |
depends="init,checkjar" |
6742 |
19 May 22 |
nicklas |
109 |
description="Compiles the plugin and put in jar" |
6742 |
19 May 22 |
nicklas |
110 |
> |
6742 |
19 May 22 |
nicklas |
111 |
<mkdir dir="${build}" /> |
6742 |
19 May 22 |
nicklas |
112 |
<javac |
6742 |
19 May 22 |
nicklas |
113 |
encoding="${javac.encoding}" |
6742 |
19 May 22 |
nicklas |
114 |
srcdir="${src}" |
6742 |
19 May 22 |
nicklas |
115 |
destdir="${build}" |
6742 |
19 May 22 |
nicklas |
116 |
debug="true" |
6742 |
19 May 22 |
nicklas |
117 |
includeantruntime="false" |
6742 |
19 May 22 |
nicklas |
118 |
classpathref="classpath" |
6742 |
19 May 22 |
nicklas |
119 |
release="${javac.release}" |
6742 |
19 May 22 |
nicklas |
120 |
> |
6742 |
19 May 22 |
nicklas |
121 |
<compilerarg value="${javac.arg}" /> |
6742 |
19 May 22 |
nicklas |
122 |
</javac> |
6742 |
19 May 22 |
nicklas |
123 |
<jar |
6742 |
19 May 22 |
nicklas |
124 |
jarfile="${jar.name}" |
6742 |
19 May 22 |
nicklas |
125 |
manifest="META-INF/MANIFEST.MF" |
6742 |
19 May 22 |
nicklas |
126 |
> |
6742 |
19 May 22 |
nicklas |
127 |
<fileset dir="${build}" /> |
6742 |
19 May 22 |
nicklas |
128 |
<fileset dir="." includes="META-INF/**" /> |
6742 |
19 May 22 |
nicklas |
129 |
<fileset dir="." includes="resources/**" /> |
6742 |
19 May 22 |
nicklas |
130 |
</jar> |
6742 |
19 May 22 |
nicklas |
131 |
</target> |
6742 |
19 May 22 |
nicklas |
132 |
|
6742 |
19 May 22 |
nicklas |
133 |
<target |
6742 |
19 May 22 |
nicklas |
134 |
name="checkjar" |
6742 |
19 May 22 |
nicklas |
135 |
description="Checks that required BASE JAR files exists" |
6742 |
19 May 22 |
nicklas |
136 |
> |
6742 |
19 May 22 |
nicklas |
137 |
<available classname="net.sf.basedb.core.Application" |
6742 |
19 May 22 |
nicklas |
138 |
classpathref="classpath" property="base-core" /> |
6742 |
19 May 22 |
nicklas |
139 |
<available classname="net.sf.basedb.clients.web.Base" |
6742 |
19 May 22 |
nicklas |
140 |
classpathref="classpath" property="base-web" /> |
6742 |
19 May 22 |
nicklas |
141 |
<fail unless="base-core" message="Can't find base-core-${depend.base-version}.jar in ./lib. Try 'ant download-lib' to download the missing file." /> |
6742 |
19 May 22 |
nicklas |
142 |
<fail unless="base-web" message="Can't find base-webclient-${depend.base-version}.jar in ./lib. Try 'ant download-lib' to download the missing file." /> |
6742 |
19 May 22 |
nicklas |
143 |
<echo>Found all requried BASE core JAR files.</echo> |
6742 |
19 May 22 |
nicklas |
144 |
</target> |
6742 |
19 May 22 |
nicklas |
145 |
|
6742 |
19 May 22 |
nicklas |
146 |
<target |
6742 |
19 May 22 |
nicklas |
147 |
name="download-lib" |
6742 |
19 May 22 |
nicklas |
148 |
description="Download required BASE core jar files" |
6742 |
19 May 22 |
nicklas |
149 |
> |
6742 |
19 May 22 |
nicklas |
150 |
<echo> |
6742 |
19 May 22 |
nicklas |
151 |
------------------------------------------------------- |
6742 |
19 May 22 |
nicklas |
152 |
NOTE! You may specifiy a different download location by |
6742 |
19 May 22 |
nicklas |
153 |
creating the file './build.properties' and |
6742 |
19 May 22 |
nicklas |
154 |
setting 'depend.jars' to the URL to download from. |
6742 |
19 May 22 |
nicklas |
155 |
------------------------------------------------------- |
6742 |
19 May 22 |
nicklas |
156 |
</echo> |
6742 |
19 May 22 |
nicklas |
157 |
<download-lib file="base-core-${depend.base-version}.jar" /> |
6742 |
19 May 22 |
nicklas |
158 |
<download-lib file="base-webclient-${depend.base-version}.jar" /> |
6742 |
19 May 22 |
nicklas |
159 |
</target> |
6742 |
19 May 22 |
nicklas |
160 |
|
6742 |
19 May 22 |
nicklas |
161 |
<macrodef name="download-lib" description="Download BASE core JAR files"> |
6742 |
19 May 22 |
nicklas |
162 |
<attribute name="file" /> |
6742 |
19 May 22 |
nicklas |
163 |
<sequential> |
6742 |
19 May 22 |
nicklas |
164 |
<get |
6742 |
19 May 22 |
nicklas |
165 |
dest="lib/@{file}" |
6742 |
19 May 22 |
nicklas |
166 |
src="${depend.jars}/@{file}" |
6742 |
19 May 22 |
nicklas |
167 |
usetimestamp="true" |
6742 |
19 May 22 |
nicklas |
168 |
verbose="true" |
6742 |
19 May 22 |
nicklas |
169 |
ignoreerrors="true" |
6742 |
19 May 22 |
nicklas |
170 |
/> |
6742 |
19 May 22 |
nicklas |
171 |
</sequential> |
6742 |
19 May 22 |
nicklas |
172 |
</macrodef> |
6742 |
19 May 22 |
nicklas |
173 |
|
6742 |
19 May 22 |
nicklas |
174 |
<target name="update-version"> |
6742 |
19 May 22 |
nicklas |
175 |
<echo>Setting version to: ${version}</echo> |
6742 |
19 May 22 |
nicklas |
176 |
|
6742 |
19 May 22 |
nicklas |
177 |
<echo>WebAuthn.java</echo> |
6742 |
19 May 22 |
nicklas |
178 |
<replaceregexp |
6742 |
19 May 22 |
nicklas |
179 |
file="${src}/net/sf/basedb/webauthn/WebAuthn.java" |
6742 |
19 May 22 |
nicklas |
180 |
match="public static final String VERSION = ".*";" |
6742 |
19 May 22 |
nicklas |
181 |
replace="public static final String VERSION = "${version}";" |
6742 |
19 May 22 |
nicklas |
182 |
encoding="UTF-8" |
6742 |
19 May 22 |
nicklas |
183 |
/> |
6742 |
19 May 22 |
nicklas |
184 |
|
6742 |
19 May 22 |
nicklas |
185 |
<echo>extensions.xml</echo> |
6742 |
19 May 22 |
nicklas |
186 |
<replaceregexp |
6742 |
19 May 22 |
nicklas |
187 |
file="META-INF/extensions.xml" |
6742 |
19 May 22 |
nicklas |
188 |
match="<version>.*</version>" |
6742 |
19 May 22 |
nicklas |
189 |
replace="<version>${version}</version>" |
6742 |
19 May 22 |
nicklas |
190 |
encoding="UTF-8" |
6742 |
19 May 22 |
nicklas |
191 |
/> |
6742 |
19 May 22 |
nicklas |
192 |
<replaceregexp |
6742 |
19 May 22 |
nicklas |
193 |
file="META-INF/extensions.xml" |
6742 |
19 May 22 |
nicklas |
194 |
match="<min-base-version>.*</min-base-version>" |
6742 |
19 May 22 |
nicklas |
195 |
replace="<min-base-version>${depend.base-version}</min-base-version>" |
6742 |
19 May 22 |
nicklas |
196 |
encoding="UTF-8" |
6742 |
19 May 22 |
nicklas |
197 |
/> |
6742 |
19 May 22 |
nicklas |
198 |
|
6742 |
19 May 22 |
nicklas |
199 |
<echo>.classpath</echo> |
6742 |
19 May 22 |
nicklas |
200 |
<replaceregexp |
6742 |
19 May 22 |
nicklas |
201 |
file=".classpath" |
6742 |
19 May 22 |
nicklas |
202 |
match="base-(\w+)-[0-9.]+jar" |
6742 |
19 May 22 |
nicklas |
203 |
replace="base-\1-${depend.base-version}.jar" |
6742 |
19 May 22 |
nicklas |
204 |
encoding="UTF-8" |
6742 |
19 May 22 |
nicklas |
205 |
byline="true" |
6742 |
19 May 22 |
nicklas |
206 |
/> |
6742 |
19 May 22 |
nicklas |
207 |
|
6742 |
19 May 22 |
nicklas |
208 |
<echo>Don't forget to commit the changes to the subversion repository!</echo> |
6742 |
19 May 22 |
nicklas |
209 |
</target> |
6742 |
19 May 22 |
nicklas |
210 |
|
6742 |
19 May 22 |
nicklas |
211 |
</project> |