forked from benblack86/linkclump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
57 lines (49 loc) · 1.72 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
<project name="Linkclump" default="build" basedir=".">
<!-- ant has no if/else statments so have to use this if_.. format -->
<target name="build" depends="properties,clean,test_if_mac,test_if_not_mac">
<zip destfile="${zip_name}" basedir="src" />
</target>
<target name="properties">
<!-- gets the version number from the manifest file -->
<loadfile srcFile="src/manifest.json" property="version">
<filterchain>
<!-- "s" option allows "." to match newline -->
<replaceregex pattern='.*version": "(.*?)".*' flags="s" byline="false" replace="\1" />
</filterchain>
</loadfile>
<property name="zip_name" value="linkclump.${version}.zip" />
<echo>Version: ${version}</echo>
<echo>Zip Name: ${zip_name}</echo>
</target>
<target name="clean">
<echo>Deleting old zip file ${zip_name}</echo>
<delete>
<fileset dir="." includes="${zip_name}" />
</delete>
</target>
<condition property="is_mac">
<os family="mac" />
</condition>
<condition property="is_not_mac">
<not>
<os family="mac" />
</not>
</condition>
<target name="test_if_mac" if="is_mac">
<echo>Running Js Test Driver [see http://code.google.com/p/js-test-driver/]</echo>
<exec executable="java" failonerror="true">
<arg line="-jar" />
<arg path="jtd/JsTestDriver-1.3.5.jar" />
<arg line="--port 9879" />
<!-- on windows you normally provide the path to the browser -->
<arg line="--browser open" />
<arg line="--basePath ." />
<arg line="--raiseOnFailure true" />
<arg line="--config jtd/jsTestDriver.conf" />
<arg line="--tests all" />
</exec>
</target>
<target name="test_if_not_mac" if="is_not_mac">
<echo>Js Test Driver is currently only setup for Mac testing</echo>
</target>
</project>