forked from garethhunt/modifyheaders
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
171 lines (140 loc) · 6.71 KB
/
build.xml
File metadata and controls
171 lines (140 loc) · 6.71 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version="1.0"?>
<!-- ======================================================================
Dec 9, 2004 3:47:59 PM
Build file for the modify headers extension for Mozilla Firefox
garethh
====================================================================== -->
<project name="modifyheaders" default="xpi">
<!-- Create this to target the build at your environment -->
<property file="build.properties.${target}"/>
<!-- The default settings mop up any properties not set in the target -->
<property file="build.properties.default"/>
<!-- Filters used for token replacement -->
<filter token="build.version" value="${build.version}"/>
<description>
Modify Headers is an extension for the Mozilla Firefox web browser
that allows a user to modify the HTTP request sent to a particular URL.
</description>
<target name="info">
<echo>
User home: ${user.home}
OS: ${os.name}
Basedir: ${build.debug}
Basedir: ${build.basedir}
Srcdir: ${build.srcdir}
Target ${build.targetdir}
Firefox details:
Home: ${build.mozilla.firefox.home}
Extension details:
Name: ${build.mozilla.firefox.extension.name}
Version: ${build.version}
UUID: ${build.mozilla.firefox.extension.uuid}
Home: ${build.mozilla.firefox.extension.home}/${build.mozilla.firefox.extension.uuid}
</echo>
</target>
<target name="clean" depends="info">
<echo message="Cleaning..."/>
<delete dir="${build.targetdir}" verbose="true"/>
</target>
<target name="prepare" depends="clean" description="Ensures that the required target directories are created">
<mkdir dir="${build.targetdir}"/>
<mkdir dir="${build.targetdir}/interface"/>
<mkdir dir="${build.targetdir}/unpacked"/>
<!-- <mkdir dir="${build.targetdir}/jar/chrome"/>
<mkdir dir="${build.targetdir}/jar/components"/> -->
<mkdir dir="${build.targetdir}/xpi"/>
</target>
<target name="compile" depends="prepare" description="Compiles the idl interface file into an xpt">
<!-- Compile the nsIModifyHaders interface -->
<!-- <exec executable="${build.basedir}/compile-interface.bat" dir="${build.basedir}" failonerror="true"/> -->
<exec executable="${build.basedir}/compile-interface.sh" dir="${build.basedir}" failonerror="true"/>
<!-- Copy the files in ${srcdir}/jar to ${targetdir}/chrome -->
<copy todir="${build.targetdir}/chrome" filtering="true">
<fileset dir="${build.srcdir}/chrome">
<!-- Exclude the images as the filtering corrupts them -->
<exclude name="**/*.gif" />
<exclude name="**/*.jpg" />
</fileset>
</copy>
<!-- Copy the gifs without filtering as this corrupts them -->
<copy todir="${build.targetdir}/chrome">
<fileset dir="${build.srcdir}/chrome">
<include name="**/*.gif" />
<include name="**/*.jpg" />
</fileset>
</copy>
<antcall target="compile-app-specific"/>
</target>
<target name="compile-app-specific" if="build.mozilla.application.srcdir" description="If required, copies application specific src over the Firefox src">
<echo message="Compiling application specific elements"/>
<!-- Copy application specific versions of source files into the target -->
<copy todir="${build.targetdir}/chrome" filtering="true" overwrite="true">
<fileset dir="${build.mozilla.application.srcdir}/chrome">
<!-- Exclude the images as the filtering corrupts them -->
<exclude name="**/*.gif" />
<exclude name="**/*.jpg" />
</fileset>
</copy>
<!-- Copy the gifs without filtering as this corrupts them -->
<copy todir="${build.targetdir}/chrome" overwrite="true">
<fileset dir="${build.mozilla.application.srcdir}/chrome">
<include name="**/*.gif" />
<include name="**/*.jpg" />
</fileset>
</copy>
</target>
<target name="aggregate" depends="compile" description="Aggregates all elements into the unpacked directory">
<copy todir="${build.targetdir}/unpacked/" filtering="true">
<fileset dir="${build.srcdir}" includes="*.*"/>
</copy>
<copy todir="${build.targetdir}/unpacked/chrome/" filtering="false">
<fileset dir="${build.targetdir}/chrome/"></fileset>
</copy>
<copy todir="${build.targetdir}/unpacked/components">
<fileset dir="${build.srcdir}/components"></fileset>
<fileset dir="${build.targetdir}/interface"></fileset>
</copy>
<copy todir="${build.targetdir}/unpacked/defaults/" filtering="false">
<fileset dir="${build.srcdir}/defaults/"></fileset>
</copy>
</target>
<!-- <target name="jar" depends="compile" description="Creates the extension jar">
<jar destfile="${build.targetdir}/jar/chrome/${build.mozilla.firefox.extension.name}.jar"
basedir="${build.targetdir}/chrome"
includes="**"/>
<copy todir="${build.targetdir}/jar/components">
<fileset dir="${build.srcdir}/components"></fileset>
<fileset dir="${build.targetdir}/interface"></fileset>
</copy>
<copy todir="${build.targetdir}/jar/" filtering="true">
<fileset dir="${build.srcdir}" includes="*.*"/>
</copy>
<antcall target="jar-app-specific"/>
</target>-->
<!-- <target name="jar-app-specific" if="build.mozilla.application.srcdir" description="If required, copies application specific src over the Firefox src">
<echo message="Adding application specific elements to jar dir"/>
<copy todir="${build.targetdir}/jar/" filtering="true" overwrite="true">
<fileset dir="${build.mozilla.application.srcdir}" includes="*.*"/>
</copy>
</target> -->
<!-- =================================
target: default
================================= -->
<!-- <target name="xpi" depends="jar" description="Creates the xpi file that includes the extension jar and install scripts"> -->
<target name="xpi" depends="aggregate" description="Creates the xpi file that includes the extension jar and install scripts">
<!-- Zip the jar file and the installation scripts into the xpi file -->
<zip destfile="${build.targetdir}/xpi/${build.mozilla.firefox.extension.name}-${build.version}.xpi">
<!-- <fileset dir="${build.targetdir}/jar" includes="*.*"/>
<fileset dir="${build.targetdir}/unpacked" includes="**/*.*"/> -->
<fileset dir="${build.targetdir}/unpacked"/>
</zip>
</target>
<!-- Deploy the contents of the src directory to the extension directory -->
<!-- <target name="debug" depends="jar"> -->
<!-- <target name="debug" depends="aggregate">
<echo>Debug deployment</echo>
<copy todir="${build.mozilla.firefox.extension.home}/${build.mozilla.firefox.extension.uuid}" overwrite="true">
<fileset dir="${build.targetdir}/jar"/>
</copy>
</target> -->
</project>