forked from aionnetwork/aion_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
183 lines (161 loc) · 6.46 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
<?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" />
<!-- 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.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">
<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" />
</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"
>
<classpath>
<path refid="classpath.dependency" />
</classpath>
</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>
<move includeemptydirs="false" todir="${dir.pack}">
<file file="modAionApi.jar"/>
</move>
</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" 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="post_pack" />
</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>