This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
65 lines (58 loc) · 2.71 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
<project name="hx-nanomsg" default="exit" basedir=".">
<description>Haxe (C++/Neko) language bindings for the nanomsg library.</description>
<property environment="env" />
<property name="workspace" location="${env.WORKSPACE}" />
<property name="api" location="${workspace}/api" />
<property name="bin" location="${workspace}/bin" />
<property name="src" location="${workspace}/src" />
<property name="build" location="${workspace}/build" />
<target name="init" description="Creates the directories needed to store output">
<echo>Creating all required directories...</echo>
<mkdir dir="${bin}" />
</target>
<target name="dependencies" depends="init" description="Installs required dependencies">
<echo>Installing required dependencies...</echo>
<exec executable="haxelib">
<arg value="install" />
<arg value="dox" />
</exec>
<exec executable="haxelib">
<arg value="install" />
<arg value="hxcpp" />
</exec>
<exec executable="haxelib">
<arg value="install" />
<arg value="hext-core" />
</exec>
</target>
<target name="build-bindings" depends="dependencies" description="Builds the bindings">
<echo>Compiling the source code...</echo>
<exec executable="haxelib" resultproperty="build-bindings.code">
<arg value="run" />
<arg value="hxcpp" />
<arg value="${build}/build_bindings.hxml" />
<arg value="-DHXCPP_M64" />
</exec>
<condition property="build-bindings.failed">
<isfailure code="${build-bindings.code}" />
</condition>
</target>
<target name="build-api" depends="build-bindings" description="Builds the API documentation">
<echo>Building the API documentation...</echo>
<exec executable="haxe" resultproperty="build-api.code">
<arg value="${build}/build_api.hxml" />
</exec>
<condition property="build-api.failed">
<isfailure code="${build-api.code}" />
</condition>
</target>
<target name="cleanup" depends="build-api" description="Removes compiled files and directories">
<echo>Removing (temporary) directories...</echo>
<delete dir="${bin}" />
</target>
<target name="exit" depends="cleanup" description="Marks the build as failed if one of the targets failed">
<fail if="build-bindings.failed">Build step (bindings) failed. Check output log for more information.</fail>
<fail if="build-api.failed">Build step (API) failed. Check output log for more information.</fail>
<echo>Everything went well. Good job!</echo>
</target>
</project>