-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
133 lines (121 loc) · 4.19 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="TeTRES" basedir=".">
<!-- File '~/.ant.properties' must contain the keys:
TeTRES-related (omit http://):
tetres.webstart.host
tetres.server.host
Jarsign-related:
sign.store
sign.store.pass
sign.alias
sign.alias.pass
-->
<!-- Build requires ant-contrib.jar to be in /usr/share/ant/lib -->
<!-- Clean build directory with `ant clean` and build the jars
with `ant dist`. (`ant clean dist` to do both) -->
<property file="${user.home}/.ant.properties"/>
<property name="src.dir" value="Original_Clients/src"/>
<property name="dist.dir" value="dist"/>
<property name="server.dir" value="Server"/>
<property name="data.dir" value="Original_Clients/run/userclient/data"/>
<property name="dist.admin.bin" value="${dist.dir}/admin/bin"/>
<property name="dist.admin.data" value="${dist.dir}/admin/data"/>
<property name="dist.user.bin" value="${dist.dir}/user/bin"/>
<property name="dist.user.data" value="${dist.dir}/user/data"/>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="/usr/share/ant/lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<target name="clean-all">
<subant target="clean">
<fileset dir="${src.dir}" includes="*/build.xml"/>
</subant>
</target>
<target name="clean">
<delete dir="${dist.dir}"/>
</target>
<target name="build-all">
<subant target="jar">
<fileset dir="${src.dir}" includes="*/build.xml"/>
</subant>
</target>
<target name="dist" depends="build-all">
<mkdir dir="${dist.admin.bin}"/>
<mkdir dir="${dist.admin.data}"/>
<mkdir dir="${dist.admin.bin}/lib"/>
<mkdir dir="${dist.user.bin}"/>
<mkdir dir="${dist.user.data}"/>
<mkdir dir="${dist.user.bin}/lib"/>
<copy file="${src.dir}/admin/build/dist/TeTRES-Admin.jar" todir="${dist.admin.bin}" flatten="true"/>
<copy todir="${dist.admin.data}">
<fileset dir="${data.dir}"/>
</copy>
<copy todir="${dist.admin.bin}/lib" flatten="true">
<fileset dir="${src.dir}/..">
<include name="src/*/build/dist/**/*.jar"/>
<include name="lib/*.jar"/>
<include name="lib/**/httpclient-4.5.6.jar"/>
<include name="lib/**/httpcore-4.4.10.jar"/>
<include name="lib/**/httpmime-4.5.10.jar"/>
<include name="lib/**/commons-logging-1.2.jar"/>
<exclude name="src/user/**"/>
<exclude name="**/cache/**"/>
</fileset>
</copy>
<copy file="${src.dir}/user/build/dist/TeTRES-User.jar" todir="${dist.user.bin}" flatten="true"/>
<copy todir="${dist.user.data}">
<fileset dir="${data.dir}"/>
</copy>
<copy todir="${dist.user.bin}/lib" flatten="true">
<fileset dir="${src.dir}/..">
<include name="src/*/build/dist/**/*.jar"/>
<include name="lib/*.jar"/>
<include name="lib/**/httpclient-4.5.6.jar"/>
<include name="lib/**/httpcore-4.4.10.jar"/>
<include name="lib/**/httpmime-4.5.10.jar"/>
<include name="lib/**/commons-logging-1.2.jar"/>
<exclude name="**/cache/**"/>
</fileset>
</copy>
<copy todir="${dist.dir}" filtering="true">
<fileset dir="." includes="*.jnlp,README.md,index.html,standard.css"/>
<filterset begintoken="@@" endtoken="@@">
<filter token="VERSION" value="${version}"/>
<filter token="TETRES.WEBSTART.HOST" value="${tetres.webstart.host}"/>
<filter token="TETRES.SERVER.HOST" value="${tetres.server.host}"/>
</filterset>
</copy>
<copy todir="${dist.dir}">
<fileset dir="." includes="config.png"/>
</copy>
<for param="jar.file" parallel="true">
<path>
<fileset dir="${dist.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<sequential>
<signjar
jar="@{jar.file}"
keystore="${sign.store}"
storepass="${sign.store.pass}"
alias="${sign.alias}"
keypass="${sign.alias.pass}"
lazy="true"/>
</sequential>
</for>
<zip basedir="${dist.dir}/user"
destfile="${dist.dir}/user/data.zip"
includes="data/**/*"
excludes="**/cache/**"/>
<zip basedir="${dist.dir}/admin"
destfile="${dist.dir}/admin/data.zip"
includes="data/**/*"
excludes="**/cache/**"/>
<zip basedir="."
destfile="${dist.dir}/server.zip"
includes="${server.dir}/**/*, server.sh, package_installer.sh, requirements.txt"
excludes="**/cache/**"/>
</target>
</project>