-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
187 lines (155 loc) · 5.47 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
9 févr. 08 15:00:15
project: Xlogo
description: Logo Programming Interpreter
Le Coq Loïc
====================================================================== -->
<project name="XLogo" default="deploy">
<description>
XLogo: Logo Interpreter
</description>
<!-- Build Properties -->
<!-- Property signJar =============
Does the Jar has to be signed ?
================================-->
<property name="signJar" value="false"/>
<!-- Build source tarball -->
<property name="buildSrc" value="true"/>
<!-- Version for this Build -->
<property name="version" value="1.0.0beta5"/>
<!-- =================================
default target: deploy
================================= -->
<target name="deploy" depends="create.jar">
<condition property="sign.jar">
<equals arg1="true" arg2="${signJar}"/>
</condition>
<antcall target="sign.xlogo">
</antcall>
<condition property="build.source.tarball">
<equals arg1="true" arg2="${buildSrc}"/>
</condition>
<antcall target="create.src.tarball">
</antcall>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: depends
- - - - - - - - - - - - - - - - - -->
<!-- Creates the source tarball -->
<target name="create.src.tarball" if="build.source.tarball">
<mkdir dir="deploy/xlogo-${version}"/>
<copy todir="deploy/xlogo-${version}">
<fileset dir=".">
<include name="src/**"/>
<include name="lib/**"/>
<include name="build.xml"/>
<include name="README"/>
</fileset>
</copy>
<tar destfile="deploy/xlogo-${version}-source.tar.bz2" compression="bzip2">
<fileset dir="deploy/">
<include name="xlogo-${version}/**"/>
</fileset>
</tar>
<delete dir="deploy/xlogo-${version}"/>
</target>
<!-- Sign the XLogo (Java Web Start) -->
<target name="sign.xlogo" if="sign.jar">
<input
message="Password"
addproperty="pwd"/>
<signjar keystore="keystore.ks" storepass="${pwd}" alias="myalias">
<fileset dir="deploy">
<include name="xlogo-${version}.jar"/>
</fileset>
</signjar>
</target>
<path id="build.classpath">
<fileset dir=".">
<include name="lib/*.jar"/>
</fileset>
</path>
<pathconvert property="manifest.classpath" pathsep=" ">
<path refid="build.classpath"/>
<flattenmapper/>
</pathconvert>
<target name="create.jar" depends="compile">
<!-- Create xlogo-main.jar -->
<jar destfile="deploy/xlogo-main.jar">
<manifest>
<attribute name="Main-Class" value="xlogo.Logo"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
<fileset dir="deploy/">
<include name="xlogo/**"/>
</fileset>
</jar>
<!-- Delete Used files -->
<delete includeemptydirs="true">
<fileset dir="deploy/">
<include name="**/*.properties"/>
</fileset>
</delete>
<!-- Create xlogo-${version}.jar -->
<jar destfile="deploy/xlogo-${version}.jar">
<manifest>
<attribute name="Main-Class" value="Launcher"/>
</manifest>
<fileset dir="deploy/">
<include name="*.jar"/>
<include name="Launcher.class"/>
</fileset>
</jar>
<!-- Delete Used files -->
<delete includeemptydirs="true">
<fileset dir="deploy/">
<exclude name="xlogo-${version}.jar"/>
<include name="**"/>
</fileset>
</delete>
</target>
<!-- Compile all Files -->
<target name="compile" depends="copy.static.files">
<javac
debug="true"
release="11"
classpathref="build.classpath"
encoding="utf8"
srcdir="src"
destdir="deploy/"
/>
</target>
<!-- Copy all non binaries files (images, properties files...
into the folder "deploy" -->
<target name="copy.static.files" depends="create.deploy">
<copy todir="deploy/">
<fileset dir="lib/">
<include name="*.jar"/>
</fileset>
<fileset dir="src/">
<include name="**/*.properties"/>
<include name="**/*.png"/>
<include name="**/*.svg"/>
<include name="**/*.html"/>
</fileset>
</copy>
</target>
<!-- Create the folder "deploy", delete if exists -->
<target name="create.deploy">
<condition property="delete.deploy">
<available file="deploy" type="dir"/>
</condition>
<antcall target="clean-deploy">
</antcall>
<mkdir dir="deploy"/>
</target>
<!-- Delete the directory "deploy" if exists -->
<target name="clean-deploy" if="delete.deploy">
<delete includeemptydirs="true">
<fileset dir=".">
<include name="deploy/**"/>
</fileset>
</delete>
</target>
</project>