-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.xml
277 lines (243 loc) · 10.8 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="clean_build" name="javaAPI">
<property name="dir.lib" value="lib" />
<property name="dir.mod" value="mod" />
<property name="main.build.dir" value="build/main" />
<property name="main.src.dir" value="src" />
<property name="test.build.dir" value="build/test" />
<property name="test.src.dir" value="test" />
<property name="test.report.dir" value="report" />
<property name="dir.pack" value="pack" />
<property name="dir.docs" value="docs" />
<property name="dir.native" value="native/linux" />
<property name="dir.kernel.mod" value="../mod" />
<property name="dir.kernel.native" value="../native/linux" />
<!-- Paths -->
<path id="classpath.dependency">
<pathelement location="${dir.lib}/commons-collections4-4.0.jar" />
<pathelement location="${dir.lib}/gson-2.7.jar" />
<pathelement location="${dir.lib}/slf4j-api-1.7.25.jar" />
<pathelement location="${dir.lib}/logback-core-1.2.3.jar" />
<pathelement location="${dir.lib}/logback-classic-1.2.3.jar" />
<pathelement location="${dir.lib}/protobuf-java-3.5.0.jar" />
<pathelement location="${dir.lib}/libnsc.jar" />
<pathelement location="${dir.lib}/libnzmq.jar" />
<pathelement location="${dir.mod}/modRlp.jar" />
<pathelement location="${dir.mod}/modAionBase.jar" />
<pathelement location="${dir.mod}/modCrypto.jar" />
<pathelement location="${dir.mod}/modLogger.jar" />
</path>
<path id="classpath.modBuild">
<pathelement location="./modAionApi.jar" />
</path>
<path id="classpath.test">
<pathelement location="${dir.lib}/junit-4.12.jar"/>
<pathelement location="${dir.lib}/hamcrest-core-1.3.jar"/>
<pathelement location="${main.build.dir}"/>
</path>
<target name="clean" depends="clean_doc">
<delete dir="${main.build.dir}" includeEmptyDirs="true" />
<delete dir="${test.build.dir}" includeEmptyDirs="true" />
<delete dir="${test.report.dir}" includeEmptyDirs="true" />
<delete dir="${dir.pack}" includeEmptyDirs="true" />
<delete file="${dir.mod}/modAionApi*.jar" />
<delete dir="${dir.docs}" includeEmptyDirs="true" />
<delete file="Java-API-doc.zip" />
</target>
<!-- Build Related -->
<target name="compile">
<mkdir dir="${main.build.dir}" />
<javac
debug="${compile.debug}"
debuglevel="source,lines,vars"
release="10"
includeantruntime="false"
srcdir="${main.src.dir}"
destdir="${main.build.dir}"
includes="**/*.java, module-info.java"
excludes="org/aion/api/server/pb/*.java"
>
<modulepath>
<path refid="classpath.dependency" />
</modulepath>
</javac>
</target>
<target name="build">
<mkdir dir="${dir.pack}" />
<antcall target="compile">
<param name="compile.debug" value="${compile.debug}"/>
</antcall>
<jar
destfile="modAionApi.jar"
filesetmanifest="mergewithoutmain"
duplicate="preserve"
basedir="${main.build.dir}"
>
<manifest>
<attribute name="Main-Class" value="org.aion.api.tools.ApiDemo"/>
<attribute name="Implementation-Vendor" value="The Aion Foundation"/>
<attribute name="Implementation-Vendor-Id" value="aion.network"/>
<attribute name="Specification-Title" value="Aion Foundation Java API"/>
</manifest>
</jar>
<copy includeemptydirs="false" todir="${dir.pack}">
<file file="modAionApi.jar"/>
</copy>
</target>
<target name="build_fatjar" depends="compile, copy-deps" description="package, output to a fatjar">
<jar
destfile="libAionApi.jar"
filesetmanifest="mergewithoutmain"
duplicate="preserve"
basedir="${main.build.dir}"
>
<manifest>
<attribute name="Main-Class" value="org.aion.api.tools.ApiDemo"/>
<attribute name="Implementation-Vendor" value="The Aion Foundation"/>
<attribute name="Implementation-Vendor-Id" value="aion.network"/>
<attribute name="Specification-Title" value="Aion Foundation Java API"/>
</manifest>
<zipfileset src="${dir.pack}/deps-all.jar"
excludes="META-INF/*.SF" />
</jar>
<move includeemptydirs="false" todir="${dir.pack}">
<file file="libAionApi.jar"/>
</move>
</target>
<target name="copy-deps">
<jar jarfile="${dir.pack}/deps-all.jar">
<zipgroupfileset dir="${dir.mod}">
<include name="modRlp.jar" />
<include name="modAionBase.jar" />
<include name="modCrypto.jar" />
<include name="modLogger.jar" />
</zipgroupfileset>
</jar>
</target>
<target name="clean_build_from_kernel">
<copy todir="${dir.native}/zmq" overwrite="true" >
<fileset dir="${dir.kernel.native}/zmq"/>
</copy>
<copy todir="${dir.native}/sodium" overwrite="true" >
<fileset dir="${dir.kernel.native}/sodium"/>
</copy>
<copy todir="${dir.native}/blake2b" overwrite="true" >
<fileset dir="${dir.kernel.native}/blake2b"/>
</copy>
<copy file="${dir.kernel.mod}/modAionBase.jar" todir="${dir.modfile}" overwrite="true" />
<copy file="${dir.kernel.mod}/modCrypto.jar" todir="${dir.modfile}" overwrite="true" />
<copy file="${dir.kernel.mod}/modLogger.jar" todir="${dir.modfile}" overwrite="true" />
<copy file="${dir.kernel.mod}/modRlp.jar" todir="${dir.modfile}" overwrite="true" />
<antcall target="clean_build" />
</target>
<target name="clean_build" depends="clean" >
<antcall target="pre_build" />
<antcall target="build">
<param name="compile.debug" value="${compile.debug}"/>
</antcall>
<antcall target="build_fatjar">
<param name="compile.debug" value="${compile.debug}"/>
</antcall>
<antcall target="javadoc">
<param name="compile.debug" value="${compile.debug}"/>
</antcall>
<antcall target="post_pack" />
</target>
<target name="clean_doc">
<delete dir="${dir.docs}" includeEmptyDirs="true" />
<delete file="Java-API-doc.zip" />
</target>
<target name="javadoc" depends="clean_doc">
<javadoc destdir="docs"
Splitindex="true"
access="protected"
author="true"
version="true"
use="true"
windowtitle="Aion Java API">
<fileset dir="src" defaultexcludes="yes">
<include name="org/aion/api/I*.java"/>
<include name="org/aion/api/sol/I*.java"/>
<include name="org/aion/api/type/AccountDetails.java"/>
<include name="org/aion/api/type/ApiMsg.java"/>
<include name="org/aion/api/type/Block.java"/>
<include name="org/aion/api/type/BlockDetails.java"/>
<include name="org/aion/api/type/BlockSql.java"/>
<include name="org/aion/api/type/CompileResponse.java"/>
<include name="org/aion/api/type/ContractAbiEntry.java"/>
<include name="org/aion/api/type/ContractAbiIOParam.java"/>
<include name="org/aion/api/type/ContractDeploy.java"/>
<include name="org/aion/api/type/ContractEvent.java"/>
<include name="org/aion/api/type/ContractEventFilter.java"/>
<include name="org/aion/api/type/ContractResponse.java"/>
<include name="org/aion/api/type/DeployResponse.java"/>
<include name="org/aion/api/type/Event.java"/>
<include name="org/aion/api/type/JsonFmt.java"/>
<include name="org/aion/api/type/Key.java"/>
<include name="org/aion/api/type/KeyExport.java"/>
<include name="org/aion/api/type/MsgRsp.java"/>
<include name="org/aion/api/type/Node.java"/>
<include name="org/aion/api/type/Protocol.java"/>
<include name="org/aion/api/type/SyncInfo.java"/>
<include name="org/aion/api/type/Transaction.java"/>
<include name="org/aion/api/type/TxArgs.java"/>
<include name="org/aion/api/type/TxDetails.java"/>
<include name="org/aion/api/type/TxLog.java"/>
<include name="org/aion/api/type/TxReceipt.java"/>
</fileset>
<classpath>
<path refid="classpath.dependency" />
<path refid="classpath.modBuild" />
</classpath>
<doctitle><![CDATA[<h1>Test</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright (c) 2017-2018 Aion foundation</i>]]></bottom>
<link offline="true" href="https://docs.oracle.com/javase/10/docs/api/" packagelistLoc="C:\tmp"/>
<link href="https://docs.oracle.com/javase/10/docs/api/"/>
</javadoc>
<zip destfile="Java-API-doc.zip"
basedir="${dir.docs}"/>
</target>
<target name="pre_build">
<echo message="execute prebuild script"/>
<exec executable="/bin/bash">
<arg value="./script/prebuild.sh" />
</exec>
</target>
<target name="post_pack">
<echo message="execute postpack script"/>
<exec executable="/bin/bash">
<arg value="./script/postpack.sh" />
</exec>
</target>
<!--<target name="test-compile" depends="compile">
<mkdir dir="${test.build.dir}" />
<javac
debug="true"
debuglevel="source,lines,vars"
includeantruntime="false"
srcdir="${test.src.dir}"
destdir="${test.build.dir}"
>
<classpath refid="classpath.test" />
</javac>
</target>-->
<!-- Test Related -->
<!--<target name="test" depends="test-compile">
<mkdir dir="${test.report.dir}" />
<junit
printsummary="yes"
haltonfailure="no"
fork="true"
>
<classpath>
<path refid="classpath.test" />
<pathelement location="${test.build.dir}" />
</classpath>
<formatter type="plain" usefile="false"/>
<formatter type="xml" />
<batchtest todir="${test.report.dir}">
<fileset dir="${test.src.dir}" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>-->
</project>