-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
102 lines (90 loc) · 4.57 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
<?xml version="1.0"?>
<project name="crossfire" default="xpi" basedir=".">
<!--
These properties must be changed for each new release of Crossfire. They are written into the
install.rdf and update.rdf file automatically
-->
<property name="VERSION" value="0.3"/>
<property name="RELEASE" value="a12"/>
<!--
These build-time paths are relative to the root of the project (where the root of the project
means the folder containing the .project file)
To perform the building + XPI'ing in an alternate location simply change these
-->
<property name="release.dir" value="release/"/>
<property name="build.dir" value="build/"/>
<!-- this absolute path must point to the root of the extracted JSDoc bundle -->
<property name="jsdoc.home" value=""/>
<!-- these must be set to absolute paths -->
<property name="jsdoc.input" value=""/>
<property name="jsdoc.dir" value=""/>
<!--
This path requires that the 'jsdoc-toolkit-ant-task-1.1.2.jar' be in the root of the extracted
JSDoc location.
-->
<path id="jsdoc.path" description="the classpath reference for creating the JSDoc">
<pathelement path="${jsdoc.home}/jsdoc-toolkit-ant-task-1.1.2.jar"/>
<pathelement path="${jsdoc.home}/java/classes/js.jar"/>
</path>
<!--
This target will create the JSDoc for Crossfire and dump it into the /doc directory.
The template used is the default 'jsdoc' template
-->
<target name="doc" description="creates the JSDoc for Crossfire">
<delete includeemptydirs="true" failonerror="false" dir="${jsdoc.dir}"/>
<mkdir dir="${jsdoc.dir}"/>
<taskdef name="jsdoctoolkit" classname="uk.co.darrenhurley.ant.tasks.JsDocToolkit" classpathref="jsdoc.path"/>
<jsdoctoolkit jsdochome="${jsdoc.home}/" template="jsdoc" inputdir="${jsdoc.input}/" verbose="true" includeundocumented="true" outputdir="${jsdoc.dir}">
</jsdoctoolkit>
</target>
<!--
The default task to building the installable XPI file.
This target is fail-fast when trying to build the XPI, the reason being
is that Firefox will not allow an extension in an inconsistent state to be installed.
-->
<target name="xpi" depends="clean" description="zip files into a firefox XPI">
<tstamp>
<format property="build.time" pattern="HHmmssSS"/>
</tstamp>
<mkdir dir="${build.dir}"/>
<!-- copy install.rdf and replace tokens -->
<copy file="install.rdf" tofile="${build.dir}/install.rdf" overwrite="true" failonerror="true" verbose="true">
<filterchain>
<replacetokens>
<token key="VERSION" value="${VERSION}"/>
<token key="RELEASE" value="${RELEASE}"/>
</replacetokens>
</filterchain>
</copy>
<!-- copy chrome.manifest -->
<copy file="chrome.manifest" tofile="${build.dir}/chrome.manifest" overwrite="true" failonerror="true"/>
<copy todir="${build.dir}" failonerror="true" overwrite="true" includeemptydirs="false">
<fileset dir="${basedir}/firefox" includes="chrome/**/*"/>
<fileset dir="${basedir}/firefox" includes="defaults/**/*"/>
<fileset dir="${basedir}/firefox" includes="components/**/*"/>
<fileset dir="${basedir}" includes="license.txt"/>
</copy>
<mkdir dir="${release.dir}"/>
<zip destfile="${release.dir}/${ant.project.name}-${VERSION}${RELEASE}.xpi" basedir="${build.dir}" includes="**/*" />
<checksum file="${release.dir}/${ant.project.name}-${VERSION}${RELEASE}.xpi" property="updateHash" algorithm="SHA-1"/>
<echo>Update hash is ${updateHash}</echo>
<copy file="update.rdf" tofile="${release.dir}/update.rdf" overwrite="true" verbose="true">
<filterchain>
<replacetokens>
<token key="VERSION" value="${VERSION}"/>
<token key="RELEASE" value="${RELEASE}"/>
<token key="UPDATEHASH" value="${updateHash}"/>
</replacetokens>
</filterchain>
</copy>
<!-- clean up build artifacts after we are done -->
<delete includeemptydirs="true" failonerror="false" dir="${build.dir}"/>
</target>
<!--
Cleans up the /build and /dist directories
-->
<target name="clean" description="cleans the /build and /dist directories">
<delete includeemptydirs="true" failonerror="false" dir="${build.dir}" verbose="true"/>
<delete includeemptydirs="true" failonerror="false" dir="${release.dir}" verbose="true"/>
</target>
</project>