-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshared.xml
58 lines (55 loc) · 2.11 KB
/
shared.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
<project name="shared">
<!-- Set common compiler options -->
<macrodef name="compile">
<attribute name="srcdir"/>
<attribute name="destdir"/>
<attribute name="excludes" default=""/>
<element name="options" optional="true" implicit="true"/>
<sequential>
<echo message="Compiling files in @{srcdir} ..."/>
<javac executable="${build_java_home}/${java_command_dir_name}/javac"
fork="yes"
srcdir="@{srcdir}"
destdir="@{destdir}"
excludes="@{excludes}"
deprecation="yes"
includeantruntime="false"
debug="true"
encoding="utf-8">
<options/>
</javac>
</sequential>
</macrodef>
<!-- target to check user is running as root -->
<target name="check-fakeroot">
<fail message="You must run 'fakeroot ant', not just 'ant', running as ${user.name}">
<condition>
<not>
<equals arg1="root" arg2="${user.name}"/>
</not>
</condition>
</fail>
</target>
<macrodef name="test_url">
<attribute name="filename"/>
<attribute name="system"/>
<sequential>
<local name="full_url"/>
<local name="curl_output"/>
<property name="full_url" value="https://@{system}.org/download/files/@{filename}"/>
<exec executable="curl" outputproperty="curl_output">
<!-- Add -L here to follow redirects: -->
<arg value="-IL"/> <!-- Only get response code -->
<arg value="${full_url}"/>
</exec>
<fail message="File not available at URL: ${full_url} Response: ${curl_output}">
<condition>
<not>
<matches pattern="HTTP/1.1 200 OK" string="${curl_output}"/>
</not>
</condition>
</fail>
<echo message=" ${full_url}"/>
</sequential>
</macrodef>
</project>