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 0
/
build.xml
72 lines (64 loc) · 2.86 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
<project name="hxsocket" default="exit" basedir=".">
<description>Haxe (C++/Neko) language bindings for libsocket.</description>
<property environment="env" />
<property name="workspace" location="${env.WORKSPACE}" />
<property name="api" location="${workspace}/api" />
<property name="src" location="${workspace}/src" />
<property name="build" location="${workspace}/build" />
<property name="reports" location="${workspace}/reports" />
<target name="init" description="Creates the directories needed to store output">
<echo>Creating all required directories...</echo>
<mkdir dir="${reports}" />
</target>
<target name="build" depends="init" description="Builds the bindings">
<echo>Compiling the source code...</echo>
<exec executable="haxelib" resultproperty="build.code">
<arg value="run" />
<arg value="hxcpp" />
<arg value="${build}/build.hxml" />
<arg value="-DHXCPP_M64" />
</exec>
<condition property="build.failed">
<isfailure code="${build.code}" />
</condition>
</target>
<target name="cloc" depends="build" description="Counts the lines of code">
<echo>Counting lines of code...</echo>
<exec executable="cloc">
<arg value="--ignore-whitespace" />
<arg value="--read-lang-def=/usr/share/cloc/defs/haxe.txt" />
<arg value="--by-file" />
<arg value="--xml" />
<arg value="-out=${reports}/cloc.xml" />
<arg value="${api}" />
<arg value="${src}" />
</exec>
<exec executable="xsltproc">
<arg value="-o" />
<arg value="${reports}/sloccount.sc" />
<arg value="/usr/share/cloc/cloc2sloccount.xsl" />
<arg value="${reports}/cloc.xml" />
</exec>
</target>
<target name="checkstyle" depends="cloc" description="Runs the checkstyle analysis tool">
<echo>Performing Checkstyle analysis...</echo>
<exec executable="checkstyle">
<arg value="-c" />
<arg value="${build}/checkstyle.xml" />
<arg value="-f" />
<arg value="xml" />
<arg value="-o" />
<arg value="${reports}/checkstyle.xml" />
<arg value="-r" />
<arg value="${api}" />
</exec>
</target>
<target name="cleanup" depends="checkstyle" description="Removes compiled files and directories">
<echo>Removing (temporary) directories...</echo>
<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.failed">Build step failed. Check output log for more information.</fail>
<echo>Everything went well. Good job!</echo>
</target>
</project>