-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
81 lines (69 loc) · 3.29 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
<?xml version="1.0"?>
<project name="screengrab" default="launch-ff-in-console-mode" basedir=".">
<description>
screengrab build file
</description>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<xmlproperty file="src/install.rdf"/>
<!-- the name will be used to make the jars and should be the name used in the chrome.manifest file -->
<property name="name" value="${ant.project.name}"/>
<property name="extension-id" value="${RDF.Description.em:id}"/>
<property name="version" value="${RDF.Description.em:version}"/>
<!-- Set this property to your Firefox profile directory -->
<!--property name="ff-profile-dir" location="/Users/andy/Library/Application Support/Firefox/Profiles/7jk3ofy3.dev" /-->
<property name="ff-profile-dir" location="/Users/andy/Library/Application Support/Firefox/Profiles/8q81q1ap.default" />
<property name="ff-app" location="/Applications/Firefox.app/Contents/MacOS/firefox" />
<property name="extension-dir" location="${ff-profile-dir}/extensions" />
<target name="launch-ff-in-console-mode">
<exec executable="${ff-app}">
<arg value="-console"/>
</exec>
</target>
<!-- targets used for testing and development -->
<target name="create-pointer-file">
<echo file="${extension-dir}/${extension-id}" message="${src}"/>
</target>
<target name="delete-pointer-file">
<delete file="${extension-dir}/${extension-id}" />
</target>
<!-- targets used for creating a distribution -->
<target name="build-chrome-jar" depends="clean" description="create the inner chrome jar">
<mkdir dir="${build}" />
<mkdir dir="${build}/chrome"/>
<zip destfile="${build}/chrome/${name}.jar">
<zipfileset dir="${src}/chrome" includes="**/*" />
</zip>
<copy todir="${build}/defaults">
<fileset dir="${src}/defaults" />
</copy>
<copy todir="${build}/components">
<fileset dir="${src}/components" />
</copy>
<copy todir="${build}/jars">
<fileset dir="${src}/jars" />
</copy>
<copy file="${src}/install.rdf" toDir="${build}"/>
<copy file="${src}/chrome.manifest" toFile="${build}/chrome.manifest" />
<!-- Need to include the space because "chrome/" recursively matches (replace is stupid). -->
<replace file="${build}/chrome.manifest" token=" chrome/" value=" jar:chrome/${name}.jar!/" />
</target>
<target name="make-xpi-dist" depends="build-chrome-jar" description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<zip destfile="${dist}/${name}_v${version}.xpi">
<zipfileset dir="${build}/jars" includes="**/*" prefix="jars"/>
<zipfileset dir="${build}/components" includes="**/*" prefix="components"/>
<zipfileset dir="${build}/chrome" includes="${name}.jar" prefix="chrome"/>
<zipfileset dir="${build}/defaults" includes="**/*" prefix="defaults"/>
<zipfileset dir="${build}" includes="install.rdf"/>
<zipfileset dir="${build}" includes="chrome.manifest"/>
</zip>
<delete dir="${build}"/>
</target>
<target name="clean" description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
</target>
</project>