forked from IBMStreams/streamsx.network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
199 lines (169 loc) · 6.94 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
<!--
// *******************************************************************************
// * Copyright (C)2014, International Business Machines Corporation and *
// * others. All Rights Reserved. *
// *******************************************************************************
-->
<project name="streamsx.network" default="all" basedir=".">
<description>
Build file for streamsx.network project, built the toolkits and samples.
</description>
<!-- set global properties for this build -->
<property environment="env" />
<property name="streams.install" value="${env.STREAMS_INSTALL}" />
<property name="toolkit" location="com.ibm.streamsx.network" />
<property name="tkname" value="com.ibm.streamsx.network" />
<property name="tmp" location="tmp" />
<target name="all" depends="toolkit, dpdkglue, samples" />
<target name="setcommitversion">
<!-- Create the time stamp -->
<tstamp />
<!-- Extract the git commit hash -->
<exec executable="git" outputproperty="commithash">
<arg value="rev-parse" />
<arg value="--short" />
<arg value="HEAD" />
</exec>
<!-- Update the info.xml -->
<echo message="${toolkit}/info.xml" />
<replace file="${toolkit}/info.xml" token="__dev__" value="commit_${commithash}" summary="yes" />
<!-- Extract info from the toolkit's info.xml -->
<xmlproperty file="${toolkit}/info.xml" prefix="tkinfo" keepRoot="no" />
<echo message="Toolkit Version: ${tkinfo.info:identity.info:version}" />
<echo message="Git Hash: ${commithash}" />
</target>
<target name="revertversion">
<exec executable="git">
<arg value="checkout" />
<arg value="--" />
<arg value="${toolkit}/info.xml" />
</exec>
</target>
<target name="clean" description="clean up">
<ant dir="${toolkit}" target="clean" />
</target>
<target name="toolkit" description="Build any code and index the toolkit.">
<ant dir="${toolkit}" target="all" />
</target>
<target name="toolkitIndexOnly" description="Index the toolkit.">
<ant dir="${toolkit}" target="indexToolkit" />
</target>
<target name="spldoc" depends="spldoc_work, revertversion" />
<target name="spldoc_work" depends="setcommitversion, samples">
<antcall target="spldoctoolkit">
<param name="tkdir" value="${toolkit}" />
<param name="tktitle" value="IBMStreams ${tkinfo.info:identity.info:name} Toolkit" />
</antcall>
<subant target="spldoctoolkit" genericantfile="${basedir}/build.xml">
<dirset dir="samples" includes="*" />
</subant>
</target>
<target name="samples" depends="toolkit">
<subant target="indextoolkit" genericantfile="${basedir}/build.xml">
<dirset dir="samples" includes="*" />
</subant>
</target>
<target name="cleansamples">
<subant target="cleantoolkit" genericantfile="${basedir}/build.xml">
<dirset dir="samples" includes="*" />
</subant>
</target>
<condition property="exists.dpdkEnvironmentVariable">
<isset property="env.RTE_SDK"/>
</condition>
<target name="dpdkglue" if="exists.dpdkEnvironmentVariable">
<echo message="DPDK glue library: ${basedir}/com.ibm.streamsx.network/impl/src/source/dpdk" />
<exec executable="make" dir="${basedir}/com.ibm.streamsx.network/impl/src/source/dpdk">
</exec>
</target>
<!-- Targets called on samples -->
<target name="indextoolkit">
<echo message="Tookit to index: ${basedir}" />
<exec executable="${streams.install}/bin/spl-make-toolkit">
<arg value="--directory" />
<arg value="${basedir}" />
</exec>
</target>
<target name="cleantoolkit">
<echo message="Tookit to clean: ${basedir}" />
<exec executable="${streams.install}/bin/spl-make-toolkit">
<arg value="--clean" />
<arg value="--directory" />
<arg value="${basedir}" />
</exec>
</target>
<target name="clean_spldoc">
<echo message="Removing SPLDOC directories" />
<delete verbose="true" includeEmptyDirs="true" failonerror="false">
<fileset dir="${toolkit}/doc" />
<fileset dir="samples" includes="*/doc/**" />
</delete>
</target>
<target name="spldoctoolkit">
<property name="tkdir" value="${basedir}" />
<echo message="Tookit to SPLDOC: ${tkdir}" />
<exec executable="${streams.install}/bin/spl-make-doc">
<arg value="--include-composite-operator-diagram" />
<arg value="--author" />
<arg value="IBMStreams Open Source Community at GitHub - https://github.com/IBMStreams/${ant.project.name}" />
<arg value="--doc-title" />
<arg value="${tktitle}" />
<arg value="--directory" />
<arg value="${tkdir}" />
</exec>
</target>
<!-- Targets to build releases -->
<target name="release" depends="clean, cleansamples, all, spldoc, setcommitversion">
<delete dir="${tmp}" />
<mkdir dir="${tmp}" />
<property name="releasefilename" value="${tmp}/com.ibm.streamsx.network-${tkinfo.info:identity.info:version}-${DSTAMP}-${TSTAMP}.tgz" />
<property name="samplesfilename" value="${tmp}/com.ibm.streamsx.network-${tkinfo.info:identity.info:version}-${DSTAMP}-${TSTAMP}-samples.tgz" />
<tar compression="gzip" longfile="gnu" destfile="${releasefilename}">
<tarfileset dir="${tkname}/.." filemode="775">
<include name="${tkname}/impl/bin/*.pl" />
</tarfileset>
<tarfileset dir="${tkname}/.." filemode="664">
<include name="${tkname}/impl/bin/*.pm" />
</tarfileset>
<tarfileset dir="${tkname}/.." >
<include name="${tkname}/**" />
<exclude name="${tkname}/impl/bin/*.pl" />
<exclude name="${tkname}/impl/bin/*.pm" />
<exclude name="${tkname}/.gitignore" />
<exclude name="${tkname}/.settings/**" />
<exclude name="${tkname}/.settings" />
<exclude name="${tkname}/.project" />
<exclude name="${tkname}/.classpath" />
</tarfileset>
</tar>
<checksum file="${releasefilename}" />
<checksum algorithm="sha1" file="${releasefilename}" />
<tar compression="gzip" longfile="gnu" destfile="${samplesfilename}">
<tarfileset dir="samples/.." filemode="755">
<include name="samples/autotestAll.sh" />
</tarfileset>
<tarfileset dir="samples/..">
<include name="samples/**" />
<exclude name="samples/autotestAll.sh" />
</tarfileset>
</tar>
</target>
<target name="release-src" depends="clean, cleansamples">
<mkdir dir="${tmp}" />
<property name="srcfilename" value="${tmp}/com.ibm.streamsx.network-${tkinfo.info:identity.info:version}-${DSTAMP}-${TSTAMP}-src.tgz" />
<tar compression="gzip" longfile="gnu" destfile="${srcfilename}">
<tarfileset dir="${tkname}/.." filemode="775">
<include name="${tkname}/impl/bin/*.pl" />
</tarfileset>
<tarfileset dir="${tkname}/.." filemode="664">
<include name="${tkname}/impl/bin/*.pm" />
</tarfileset>
<tarfileset dir="${tkname}/.." >
<include name="${tkname}/**" />
<exclude name="${tkname}/impl/bin/*.pl" />
<exclude name="${tkname}/impl/bin/*.pm" />
<exclude name="${tkname}/.gitignore" />
</tarfileset>
</tar>
</target>
</project>