-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
88 lines (70 loc) · 3.49 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
<?xml version="1.0"?>
<project name="aparapi" default="help" basedir=".">
<property environment="env" />
<condition property="x86_or_x86_64" value="x86" else="x86_64"> <or><os arch="x86" /><os arch="i386"/></or> </condition>
<condition property="dist" value="dist_windows_${x86_or_x86_64}"><os family="windows" /></condition>
<condition property="dist" value="dist_linux_${x86_or_x86_64}"><and><not><os family="mac"/></not><os family="unix" /></and></condition>
<condition property="dist" value="dist_mac_${x86_or_x86_64}"><os family="mac" /></condition>
<target name="help">
<echo message="Available targets are:-"/>
<echo message=" clean"/>
<echo message=" Clean the com.amd.aparapi and com.amd.aparapi.jni subdirs."/>
<echo message=" build"/>
<echo message=" Build the com.amd.aparapi and com.amd.aparapi.jni artifacts."/>
<echo message=" test"/>
<echo message=" Build and execute the test code."/>
<echo message=" dist"/>
<echo message=" Create ${dist} dir and populates with aparapi.jar and available .so/dlls and javadoc."/>
<echo message=" Copies the samples (with adjusted paths) into ${dist}."/>
<echo message=" Builds the samples in ${dist}."/>
<echo message=" Create ${dist}.zip from ${dist} "/>
</target>
<target name="clean">
<delete dir="${dist}"/>
<delete file="${dist}.zip"/>
<subant target="clean">
<fileset dir="samples" includes="*/build.xml"/>
<fileset dir="examples" includes="*/build.xml"/>
<fileset dir="test" includes="*/build.xml"/>
</subant>
<ant dir="com.amd.aparapi.jni" target="clean"/>
<ant dir="com.amd.aparapi" target="clean"/>
</target>
<target name="build" depends="clean">
<!-- Build the two aparapi dirs -->
<ant dir="com.amd.aparapi" target="build"/>
<ant dir="com.amd.aparapi.jni" target="build"/>
<subant target="build">
<fileset dir="samples" includes="*/build.xml"/>
</subant>
</target>
<target name="test" depends="clean">
<ant dir="com.amd.aparapi" target="build"/>
<subant target="junit">
<fileset dir="test" includes="*/build.xml"/>
</subant>
</target>
<target name="dist" depends="build">
<!-- Create the dist dir for the current arch and bitness -->
<mkdir dir="${dist}"/>
<!-- Copy the license dist -->
<copy todir="${dist}" file="LICENSE.TXT"/>
<!-- Copy aparapi.jar to dist -->
<copy todir="${dist}" file="com.amd.aparapi/aparapi.jar"/>
<!-- Create javadoc in dist -->
<javadoc packagenames="com.amd.aparapi.*" access="public" destdir="${dist}/api" >
<fileset dir="com.amd.aparapi/src/java" defaultexcludes="yes"/>
</javadoc>
<!-- Copy aparapi sjhared lib to dist -->
<copy todir="${dist}">
<fileset dir="com.amd.aparapi.jni" includes="**.dll,**.so" />
</copy>
<mkdir dir="${dist}/samples"/>
<copy todir="${dist}/samples">
<fileset dir="samples"/>
</copy>
<replace dir="${dist}/samples" includes="**/build.xml,**/*.bat,**/*.sh" token="../../com.amd.aparapi/aparapi.jar" value="../../aparapi.jar"/>
<replace dir="${dist}/samples" includes="**/*.bat,**/*.sh" token="../../com.amd.aparapi.jni" value="../.."/>
<zip destfile="${dist}.zip" basedir="${dist}" />
</target>
</project>