-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
69 lines (54 loc) · 2.15 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
<!--
Suggested Usage:
ant clean package
The goal of this build the JavaScript client and AS3 service library projects from source code and package them for distribution.
-->
<project name="SWFService" basedir="." default="package">
<!-- Properties -->
<property file="${basedir}/build.properties" />
<property name="src.loc" location="${basedir}/src" />
<property name="dist.loc" location="${basedir}/dist" />
<!-- Targets -->
<target name="clean" description="Remove artifacts in build directory from previous builds.">
<delete dir="${dist.loc}" />
<ant dir="src/client" target="clean" inheritAll="false" />
<ant dir="src/service" target="clean" inheritAll="false" />
</target>
<target name="init" description="Initialize build directory.">
<echo message="Building ${ant.project.name} version: ${build.version}"/>
<mkdir dir="${dist.loc}" />
<mkdir dir="${dist.loc}/client" />
<mkdir dir="${dist.loc}/service" />
</target>
<target name="build" depends="init" description="Build JavaScript client and AS3 service library projects from source code.">
<ant dir="src/client" inheritAll="false" />
<ant dir="src/service" inheritAll="false" />
</target>
<target name="test" depends="build" description="Execute unit tests.">
<ant dir="test/src/client" inheritAll="false" />
<ant dir="test/src/service" inheritAll="false" />
<exec executable="karma" failonerror="true">
<arg line="start karma.conf.js --single-run --browsers ${karma.browsers}" />
</exec>
</target>
<target name="package" depends="test" description="Package for distribution.">
<copy todir="${dist.loc}">
<filelist dir="${basedir}">
<file name="README.md" />
<file name="LICENSE" />
<file name="SWFService-logo.png" />
</filelist>
</copy>
<copy todir="${dist.loc}/client">
<fileset dir="${src.loc}/client/dist"></fileset>
</copy>
<copy todir="${dist.loc}/service">
<fileset dir="${src.loc}/service/dist"></fileset>
</copy>
<zip destfile="${dist.loc}/${build.fileName}.zip">
<zipfileset dir="${dist.loc}" prefix="${build.fileName}">
<exclude name="**/*.zip" />
</zipfileset>
</zip>
</target>
</project>