-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.xml
150 lines (134 loc) · 6.35 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
<!-- This is the bootstrap build file for the whole AsTeRICS framework -->
<project name="asterics" basedir="." default="buildAllNoClean">
<property environment="env"/>
<property name="debug" value="true"/>
<property name="runtime" location="bin/ARE"/>
<property name="web.docroot" location="${runtime}/web/"/>
<property name="WebACS.bin" location="${web.docroot}/WebACS"/>
<property name="WebACS.version" value="v1.2.1"/>
<property name="tmp.dir" location="tmp"/>
<target name="clean" description="Clean the whole project">
<subant target="clean">
<fileset dir="ARE" includes="build.xml"> </fileset>
</subant>
<!-- clean tmp dir with cache files -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${tmp.dir}" includes="**/*"/>
</delete>
<!-- clean WebACS install dir -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${WebACS.bin}"/>
</delete>
</target>
<!-- Build the whole AsTeRICS framework including ACS and help specific tasks -->
<target name="buildAllNoClean" depends="installWebACS" description="Build the whole project without prior cleaning">
<subant target="buildAllNoClean">
<fileset dir="ARE" includes="build.xml"> </fileset>
</subant>
</target>
<target name="buildAll" depends="installWebACS" description="Build the whole project with prior cleaning">
<subant target="buildAll">
<fileset dir="ARE" includes="build.xml"> </fileset>
</subant>
</target>
<target name="buildAll-release" depends="clean, replaceVersion, installWebACS" description="Build the whole project with prior cleaning and no debug information. Other steps for a release might be done as well.">
<subant target="buildAll-release">
<fileset dir="ARE" includes="build.xml"> </fileset>
</subant>
</target>
<target name="run" depends="installWebACS" description="Peforms buildAllNoClean in the ARE directory and starts the ARE.">
<subant target="run" failonerror="true">
<fileset dir="ARE" includes="build.xml"></fileset>
</subant>
</target>
<target name="run-debug" depends="installWebACS" description="Peforms buildAllNoClean in the ARE directory and starts the ARE with debugging at port 1044.">
<subant target="run-debug" failonerror="true">
<fileset dir="ARE" includes="build.xml"></fileset>
</subant>
</target>
<target name="run-quick" description="Starts the ARE without compilation">
<subant target="run-quick" failonerror="true">
<fileset dir="ARE" includes="build.xml"></fileset>
</subant>
</target>
<target name="installWebACS" description="Downloads the WebACS release from github and installs it to the ARE document root">
<mkdir dir="${tmp.dir}"/>
<!-- Checks, if there is a local file already and if the remote file does not have a newer timestamp -->
<get src="https://github.com/asterics/WebACS/releases/download/${WebACS.version}/WebACS-${WebACS.version}.zip"
dest="${tmp.dir}/"
verbose="true"
usetimestamp="true"
ignoreerrors="true"
tryGzipEncoding="true"/>
<unzip src="${tmp.dir}/WebACS-${WebACS.version}.zip" dest="${WebACS.bin}/"/>
</target>
<!-- This is the default test target, which calls unit tests -->
<!-- Is also used by travis ci service to execute tests -->
<target name="test" description="Execute (unit) tests of the whole project">
<fileset dir="ARE" includes="build.xml"> </fileset>
</target>
<!-- target which helps to find thirdparty libs -->
<target name="findThirdpartyLibs">
<fileset id="thirdParty" dir="." casesensitive="no">
<!--
<include name="**/src/main/resources/lib/**/*.jar"/>
<include name="**/src/main/resources/lib/**/*COPY*"/>
<include name="**/src/main/resources/lib/**/*LICENSE*"/>
<include name="**/src/main/resources/lib/**/*.so"/>
<include name="**/src/main/resources/lib/**/*.dll"/>
-->
<include name="ARE/**/*.jar"/>
<include name="ARE/**/*COPY*"/>
<include name="ARE/**/*LICENSE*"/>
<include name="ARE/**/*THIRDPARTY*"/>
<include name="ARE/**/*.so"/>
<include name="ARE/**/*.dll"/>
<exclude name="ARE/**/LICENSE_dual.txt"/>
<exclude name="ARE/services/*.jar"/>
<exclude name="ARE/components/*.jar"/>
<exclude name="**/*Test*"/>
</fileset>
<pathconvert refid="thirdParty" property="thirdPartyLibFiles" pathsep="${line.separator}">
<!-- Cut first 3 dirs of path -->
<mapper>
<cutdirsmapper dirs="3"/>
</mapper>
</pathconvert>
<echo file="thirdpartylibfiles.txt">${thirdPartyLibFiles}</echo>
</target>
<!-- helper target to replace contents of license files -->
<target name="findAndReplaceAllLicenseFiles">
<subant target="findAndReplaceLicenseFile" failonerror="false">
<fileset dir="." includes="**/build.xml"></fileset>
</subant>
</target>
<!-- helper target to rename license files, unfortunately it is not a rename but a move -->
<target name="renameAllLicenseFiles">
<subant target="renameLicenseFile" failonerror="false">
<fileset dir="." includes="**/build.xml"></fileset>
</subant>
</target>
<!-- helper target to rename license files, unfortunately it is not a rename but a move -->
<target name="replaceVersion">
<getversionnumber text="${env.VERSION}" property="app_version_number" />
<echo>VERSION=${env.VERSION}</echo>
<replace file="./bin/ACS/asterics.ini" token="#{APPLICATION_VERSION_NUMBER}#" value="${env.VERSION}"/>
<replace file="./Installer/setup.iss" token="#{APPLICATION_VERSION_NUMBER}#" value="${env.VERSION}"/>
<replace file="./Installer/asterics-are/package/linux/control" token="#{APPLICATION_VERSION_NUMBER}#" value="${env.VERSION}"/>
<replace file="./Installer/asterics-are/APE.properties" token="#{APPLICATION_VERSION_NUMBER}#" value="${env.VERSION}"/>
<replace file="./ARE/middleware/src/main/java/eu/asterics/mw/gui/AstericsGUI.java" token="#{APPLICATION_VERSION_NUMBER}#" value="${env.VERSION}"/>
<replace file="./ARE/services/WebService/src/main/java/eu/asterics/mw/webservice/RestServer.java" token="#{APPLICATION_VERSION_NUMBER}#" value="${env.VERSION}"/>
</target>
<scriptdef name="getversionnumber" language="javascript">
<attribute name="text" />
<attribute name="property" />
<![CDATA[
var text = attributes.get("text");
var matches = text.match(/(\d+\.\d+\.\d+)/);
var ver = matches ? matches[1] : '4.0.0';
project.setProperty(attributes.get("property"), ver);
]]>
</scriptdef>
<import file="imported.xml"/>
<include file="included.xml"/>
</project>