-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.xml
executable file
·149 lines (137 loc) · 5.32 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
<?xml version="1.0"?>
<project name="d4m_api" default="all" basedir=".">
<!-- <property file="${basedir}/default_build.properties"/> -->
<!-- <import file="${basedir}/../d4m_api_java/build_common_targets.xml"/> -->
<property name="build.dir" value="${basedir}/build"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="test_src.dir" value="${basedir}/test"/>
<property name="dist.dir" value="${build.dir}/dist"/>
<property name="bin.dir" value="${build.dir}/dist/bin"/>
<property name="test.reports" value="${basedir}/build/reports"/>
<property name="version.num" value="3.0.0"/>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="init_local" depends="init">
<copy todir="${dist.dir}">
<fileset dir="${basedir}">
<include name="docs/**"/>
<exclude name="docs/CHANGELOG.txt"/>
<include name="matlab_src/**"/>
<exclude name="matlab_src/html/**"/>
<include name="TEST/**"/>
<include name="lib/**"/>
<include name="libext/**"/>
<include name="examples/**"/>
<include name="COPYING.txt"/>
<include name="COPYRIGHT.txt"/>
<include name="README.txt"/>
<include name="VERSION.txt"/>
</fileset>
</copy>
</target>
<target name="init_test_release" depends="init">
<copy todir="${dist.dir}">
<fileset dir="${basedir}">
<include name="docs/**"/>
<include name="matlab_src/**"/>
<include name="TEST/**"/>
<include name="examples/**"/>
</fileset>
</copy>
<copy todir="${dist.dir}">
<fileset dir="${basedir}/../d4m_api_java/target">
<include name="graphulo-${version.num}-libext.zip"/>
</fileset>
</copy>
<copy todir="${dist.dir}/lib">
<fileset dir="${basedir}/../d4m_api_java/target">
<include name="graphulo-${version.num}.jar"/>
<include name="graphulo-${version.num}-alldeps.jar"/>
</fileset>
</copy>
<!--
<copy todir="${dist.dir}/matlab_src">
<fileset dir="${basedir}/../d4m_api_java/target">
<include name="DBinit.m"/>
</fileset>
</copy>
-->
</target>
<target name="init" depends="">
<mkdir dir="${build.dir}/dist"/>
<mkdir dir="${build.dir}/dist/docs"/>
<mkdir dir="${build.dir}/dist/examples"/>
<mkdir dir="${build.dir}/dist/lib"/>
<mkdir dir="${build.dir}/dist/libext"/>
</target>
<target name="build_distribution" depends="">
<zip destfile="${build.dir}/${ant.project.name}_${version.num}.zip">
<zipfileset dir="${build.dir}/dist" prefix="${ant.project.name}_${version.num}">
<include name="**/**"/>
<exclude name="**/*.sh"/>
<exclude name="**/ant-contrib*.jar"/>
</zipfileset>
</zip>
</target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${basedir}/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<target name="get-graphulo-libext-version">
<path id="artifact.id.path">
<fileset dir=".">
<include name="graphulo-*-libext.zip"/>
</fileset>
</path>
<property name="artifact.id.file" refid="artifact.id.path"/>
<echo message="artifact.id.file: ${artifact.id.file}"/>
<propertyregex property="graphulo.version" input="${artifact.id.file}" regexp=".*graphulo-(.*)-libext.zip" select="\1" />
<echo message="artifact.id: ${graphulo.version}"/>
</target>
<target name="unzip-libext" depends="init,get-graphulo-libext-version">
<unzip src="graphulo-${graphulo.version}-libext.zip" dest="${build.dir}/dist">
<patternset>
<include name="**/*.jar"/>
<include name="**/all*.pom"/>
<exclude name="**/DBinit.m"/>
</patternset>
</unzip>
</target>
<target name="all"
depends="clean, init_local, unzip-libext, build_distribution"
description="Build a distribution of the whole software package"/>
<target name="my-echo" >
<fileset id="myfileset" dir="${basedir}/matlab_src">
<include name="*.m" />
</fileset>
<pathconvert pathsep="${line.separator}" property="sounds" refid="myfileset">
<!-- Add this if you want the path stripped -->
<mapper>
<flattenmapper />
</mapper>
</pathconvert>
<echo file="${basedir}/my_matlab_src.txt">${sounds}</echo>
</target>
<target name="make-test-release" description="Target for making test release using a snapshot of d4m_api_java"
depends="clean,init_test_release">
<!-- new lib -->
<!-- new libext -->
<!-- new DBinit.m -->
<unzip src="${dist.dir}/graphulo-${version.num}-libext.zip" dest="${build.dir}/dist">
<patternset>
<include name="**/*.jar"/>
<include name="**/DBinit.m"/>
</patternset>
</unzip>
<copy todir="${dist.dir}/matlab_src" overwrite="true" verbose="true">
<fileset dir="${dist.dir}">
<include name="DBinit.m"/>
</fileset>
</copy>
<delete file="${dist.dir}/DBinit.m"/>
<antcall target="build_distribution"/>
</target>
</project>