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
102 lines (94 loc) · 4.23 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
<project name="hext-flow" default="exit" basedir=".">
<description>An optionally asynchronous flow library for Haxe.</description>
<property environment="env" />
<property name="workspace" location="${env.WORKSPACE}" />
<property name="src" location="${workspace}/src" />
<property name="bin" location="${workspace}/bin" />
<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}" />
<mkdir dir="${bin}/async" />
<mkdir dir="${bin}/concurrent" />
</target>
<target name="dependencies" depends="init" description="Installs required dependencies">
<echo>Installing required dependencies...</echo>
<exec executable="haxelib">
<arg value="install" />
<arg value="hxcpp" />
</exec>
<exec executable="haxelib">
<arg value="install" />
<arg value="hxcs" />
</exec>
<exec executable="haxelib">
<arg value="install" />
<arg value="hxjava" />
</exec>
<!--<exec executable="haxelib">
<arg value="git" />
<arg value="hext-core" />
<arg value="[email protected]:MaddinXx/hx-lib.git" />
</exec>-->
<exec executable="haxelib">
<arg value="install" />
<arg value="mcover" />
</exec>
</target>
<target name="build-tests" depends="dependencies" description="Builds the unit test runners">
<echo>Compiling the source code...</echo>
<exec executable="haxe" resultproperty="build-tests.code">
<arg value="${build}/build_tests.hxml" />
</exec>
<condition property="build-tests.failed">
<isfailure code="${build-tests.code}" />
</condition>
</target>
<target name="test" depends="build-tests" unless="build-tests.failed" description="Runs the unit tests">
<echo>Running unit tests...</echo>
<exec executable="${bin}/cpp/Runner" resultproperty="cpp.code" />
<exec executable="mono" resultproperty="cs.code">
<arg value="${bin}/cs/bin/Runner.exe" />
</exec>
<java jar="${bin}/java/Runner.jar" fork="true" resultproperty="java.code" />
<exec executable="node" resultproperty="js.code">
<arg value="${bin}/Runner.js" />
</exec>
<exec executable="neko" resultproperty="neko.code">
<arg value="${bin}/Runner.n" />
</exec>
<exec executable="php" resultproperty="php.code">
<arg value="${bin}/php/index.php" />
</exec>
<condition property="test.failed">
<or>
<isfailure code="${cpp.code}" />
<isfailure code="${cs.code}" />
<isfailure code="${java.code}" />
<isfailure code="${js.code}" />
<isfailure code="${neko.code}" />
<isfailure code="${php.code}" />
</or>
</condition>
</target>
<target name="build-api" depends="test" 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}" />
<delete dir="${workspace}/.temp" />
</target>
<target name="exit" depends="cleanup" description="Marks the build as failed if one of the targets failed">
<fail if="build-tests.failed">Build step (tests) failed. Check output log for more information.</fail>
<fail if="test.failed">Unit tests step 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>