-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
93 lines (82 loc) · 4.73 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="asterics-application" default="run" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<!-- import generic APE functionality from APE accompanied to the ARE.baseURI -->
<property name="APE.propertiesFile" value="APE.properties"></property>
<loadproperties srcFile="${APE.propertiesFile}" />
<!-- if ARE.baseURI is not set, try to find a default value in the following order:
1) dependencies/AsTeRICS/bin/ARE (if Asterics is added as submodule)
2) ../AsTeRICS/bin/ARE (if it's an APE projectdir withouth FABI and FLipMouse folder structure)
3) ../../AsTeRICS/bin/ARE (if it's an AT solution folder structure)
4) C:/Program Files (x86)/AsTeRICS/ARE/ (if there is an Asterics installation on windows)
-->
<condition property="ARE.baseURI" value="dependencies/AsTeRICS/bin/ARE/">
<available file="dependencies/AsTeRICS/bin/ARE/" type="dir"/>
</condition>
<condition property="ARE.baseURI" value="../../ARE/">
<available file="../../ARE/" type="dir"/>
</condition>
<condition property="ARE.baseURI" value="../AsTeRICS/bin/ARE/">
<available file="../AsTeRICS/bin/ARE/" type="dir"/>
</condition>
<condition property="ARE.baseURI" value="../../AsTeRICS/bin/ARE/">
<available file="../../AsTeRICS/bin/ARE/" type="dir"/>
</condition>
<condition property="ARE.baseURI" value="C:/Program Files (x86)/AsTeRICS/ARE/">
<available file="C:/Program Files (x86)/AsTeRICS/ARE/" type="dir"/>
</condition>
<!-- if ARE.baseURI is not set assume that APE is located in the parent folder of basedir -->
<condition property="APE.baseURI" else="${ARE.baseURI}/../APE/" value="${basedir}/../">
<not>
<isset property="ARE.baseURI" />
</not>
</condition>
<condition property="APE.imported.build.file" value="imported.xml" else="${APE.baseURI}/template/imported.xml">
<available file="imported.xml" type="file"/>
</condition>
<echo>
If no JRE is found, try to set the path manually in APE.properties (fx.platform.basedir).
If no AsTeRICS framework can be found or the used version is incompatible with your solution, define the path manually in APE.properties (ARE.baseURI)
or ensure to clone the current snapshot to the parallel folder:
git clone https://github.com/asterics/AsTeRICS.git
Using ARE.baseURI: ${ARE.baseURI}
Using imported.xml from: ${APE.imported.build.file}</echo>
<import file="${APE.imported.build.file}"/>
<!-- finished imported APE functionality -->
<!-- do platform specific preparations before deployment: here you can delete some platform specific files -->
<target name="before-deploy-windows" if="APE.isWindows">
<delete verbose="true">
<fileset dir="${build.merged.ARE}" includes="javacv-*-linux.jar, javacv-*-macosx.jar"/>
</delete>
</target>
<target name="before-deploy-linux" if="APE.isLinux">
<delete verbose="true">
<fileset dir="${build.merged.ARE}" includes="javacv-*-windows.jar, javacv-*-macosx.jar"/>
</delete>
</target>
<target name="before-deploy-macosx" if="APE.isMacOSX">
<delete verbose="true">
<fileset dir="${build.merged.ARE}" includes="javacv-*-windows.jar, javacv-*-linux.jar"/>
</delete>
</target>
<!-- if you want to compile and modify something on your own, before the installer is created -->
<target name='before-deploy'>
<getversionnumber text="${fx.application.version}" property="app_version_number" />
<replace file="./package/windows/AsTeRICS Ergo.iss" token="#{APPLICATION_VERSION}#" value="${fx.application.version}"/>
<replace file="./package/windows/AsTeRICS Ergo.iss" token="#{APPLICATION_VERSION_NUMBER}#" value="${app_version_number}"/>
<replace file="./package/linux/control" token="#{APPLICATION_VERSION_NUMBER}#" value="${app_version_number}"/>
<replace file="./custom/bin/ARE/web/webapps/envcontrol/static/simple/index.html" token="#{APPLICATION_VERSION}#" value="${fx.application.version}"/>
<replace file="./custom/bin/ARE/web/webapps/envcontrol/static/angular/global/component/mainHeader.html" token="#{APPLICATION_VERSION}#" value="${fx.application.version}"/>
</target>
<target name="deploy" depends="before-deploy, init-fx-tasks, cleanup, setup-staging-area, APE-copy-release, before-deploy-windows, before-deploy-linux, before-deploy-macosx, make-installer-only" description="Creates installer packages for this APE project. The result can be found in the build/deploy folder.">
</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>
</project>