This repository has been archived by the owner on Oct 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.xml
84 lines (71 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?xml version="1.0"?>
<project name="memchaser" default="dev">
<property name="xpi.dir" value="./xpi"/>
<tstamp>
<format property="build.number" pattern="yyyyMMddHHmm"/>
</tstamp>
<condition property="cfx.binary" value="-b ${binary}">
<isset property="binary"/>
</condition>
<property name="cfx.binary" value=""/>
<target name="release" depends="version"
description="Builds a release version">
<property name="xpi.filename" value="${ant.project.name}-${build.version}.xpi"/>
<antcall target="package"/>
</target>
<target name="dev" depends="version"
description="Builds a development version">
<antcall target="package"/>
</target>
<target name="package" depends="clean, version">
<property name="xpi.filename" value="${ant.project.name}-${build.version}-${build.number}.xpi"/>
<mkdir dir="${xpi.dir}"/>
<move file="${build.filename}" tofile="${xpi.dir}/${xpi.filename}"/>
<echo>package.filename: ${xpi.dir}/${xpi.filename}</echo>
</target>
<target name="clean"
description="Clean-up XPI directory">
<delete dir="${xpi.dir}"/>
</target>
<target name="version" depends="build" unless="build.version"
description="Shows the current version">
<!-- we would need to depend on external libraries to read the version number
from package.json, so instead we extract the extension to a temporary location
and read the version from install.rdf before removing the temporary folder. -->
<unzip src="${build.filename}" dest="temp"/>
<xmlproperty file="temp/install.rdf" collapseAttributes="true"/>
<property name="build.version" value="${RDF.Description.em:version}"/>
<delete dir="temp"/>
<echo>build.version: ${build.version}</echo>
</target>
<target name="build">
<property name="build.filename" value="extension/${ant.project.name}.xpi"/>
<delete file="${build.filename}"/>
<exec executable="/bin/sh" dir="addon-sdk">
<arg value="-c"/>
<arg value="source bin/activate;cd ../extension;cfx xpi"/>
</exec>
<echo>build.filename: ${build.filename}</echo>
</target>
<target name="run">
<exec executable="/bin/sh" dir="addon-sdk">
<arg value="-c"/>
<arg value="source bin/activate;cd ../extension;cfx run ${cfx.binary}"/>
</exec>
</target>
<target name="test">
<exec executable="/bin/sh"
dir="addon-sdk"
resultproperty="test.result">
<arg value="-c"/>
<arg value="source bin/activate;cd ../extension;cfx test ${cfx.binary}"/>
</exec>
<fail message="Tests failed!">
<condition>
<not>
<equals arg1="${test.result}" arg2="0"/>
</not>
</condition>
</fail>
</target>
</project>