-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
234 lines (200 loc) · 10.2 KB
/
build.xml
File metadata and controls
234 lines (200 loc) · 10.2 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?xml version="1.0" ?>
<!-- This Ant build file was contributed by Paul McLanahan. [email protected].
Added template and version numbers [email protected]
-->
<project name="firebug" default="createBranchXPI">
<!-- Setting properties -->
<target name="local-check">
<available file="${basedir}/local.properties"
property="local.properties.available"/>
</target>
<target name="properties-local"
if="local.properties.available"
depends="local-check">
<echo message="Loading local properties file"/>
<property file="local.properties"/>
</target>
<target name="no-properties-local"
unless="local.properties.available"
depends="local-check">
<echo message="No local properties file, setting defaults"/>
<property name="install.dir" value="OperatingSystemPathTo:Profiles/fireclipse/"/>
<property name="update.path" value="http://getfirebug.com/releases"/>
</target>
<target name="version" depends="properties-local, no-properties-local" description="Compute version number">
<tstamp/>
<property name="build_dir" location="./build" />
<property name="FULLVERSION" value="${VERSION}${RELEASE}${TRUNK}"/>
<mkdir dir="${build_dir}/dist" />
<property name="dist_dir" location="${build_dir}/dist" />
<property name="FIREBUG-XPI" value="firebug-${VERSION}J${RELEASE}.xpi"/>
</target>
<!-- eg
RELEASE=.88
VERSION=eval
TRUNK=.1.05
-->
<property file="content/firebug/branch.properties" />
<!-- Project directories -->
<property name="src_dir" location="." />
<property name="build_dir" location="./build" />
<property name="dist_dir" location="./dist" />
<!-- relative to branches/firebug1.1 should be branches/eval -->
<property name="excludes" value="**/.*, **/*.jar, **/*.db" />
<property name="components_dir" location="${src_dir}/components" />
<available file="${src_dir}/aptanadebugger" property="aptanadebugger"/>
<!-- Targets -->
<target name="clean" depends="clean-reg">
<delete dir="${build_dir}" />
<delete dir="${dist_dir}" />
</target>
<!-- Expand templates -->
<target name="install-dependency" description="test tpl files">
<uptodate property="install.expansion.notRequired" targetfile="${src_dir}/install.rdf">
<srcfiles dir="${src_dir}" includes="install.rdf.tpl.xml, content/firebug/branch.properties"/>
</uptodate>
</target>
<target name="update-dependency" description="test update files">
<condition property="update.expansion.notRequired">
<or>
<not>
<available file="update.rdf.tpl.xml"/>
</not>
<uptodate targetfile="update.rdf">
<srcfiles dir="${src_dir}" includes="update.rdf.tpl.xml, branch.properties"/>
</uptodate>
</or>
</condition>
</target>
<target name="expand-templates" depends="expand-install-template, expand-update-template, verify-update-template-expansion" description="Fill in version info">
</target>
<target name="expand-install-template" depends="install-dependency, version" unless="install.expansion.notRequired" >
<copy file="${src_dir}/install.rdf.tpl.xml"
tofile="${src_dir}/install.rdf"
overwrite="true">
<filterchain>
<replacetokens>
<token key="FULLVERSION" value="${FULLVERSION}"/>
<token key="VERSION" value="${VERSION}J"/>
<token key="RELEASE" value="${RELEASE}"/>
<token key="UPDATEPATH" value="${update.path}/firebug/${VERSION}"/>
</replacetokens>
</filterchain>
</copy>
</target>
<target name="expand-update-template" depends="update-dependency, version" unless="update.expansion.notRequired" >
<copy file="${src_dir}/update.rdf.tpl.xml"
tofile="${build_dir}/update.rdf"
overwrite="true">
<filterchain>
<replacetokens>
<token key="FULLVERSION" value="${FULLVERSION}"/>
<token key="VERSION" value="${VERSION}J"/>
<token key="RELEASE" value="${RELEASE}"/>
<token key="LEAF" value="firebug-${VERSION}${RELEASE}.xpi"/>
<token key="UPDATEPATH" value="${update.path}/firebug/${VERSION}"/>
<token key="EXPERIMENTORURL" value="http://www.almaden.ibm.com/u/bartonjj"/>
</replacetokens>
</filterchain>
</copy>
<echo message="expanded ${src_dir}/update.rdf.tpl.xml"/>
</target>
<target name="verify-update-template-expansion" depends="update-dependency" if="update.expansion.notRequired">
<echo message="update.expansion.notRequired true"/>
</target>
<target name="release-documentation" depends="clean, version, expand-templates">
<copy file="${src_dir}/docs/index.tpl.html"
tofile="${src_dir}/docs/index.html"
overwrite="true">
<filterchain>
<replacetokens>
<token key="FIREBUG-VERSION" value="${RELEASE}"/>
<token key="CHROMEBUG-VERSION" value="${CHROMEBUG.FULLVERSION}"/>
<token key="UPDATEPATH" value="${update.path}"/>
</replacetokens>
</filterchain>
</copy>
</target>
<!-- Incremental Build Targets -->
<target name="dev-setup" depends="create-extension-links, expand-templates">
</target>
<target name="create-extension-links" depends="version">
<!-- These links are one line files with paths pointing into our source -->
<echo message="Writing links from ${install.dir}/extensions to ${basedir}"/>
<mkdir dir="${install.dir}/extensions" />
<path id="firebug-dev">
<pathelement location="${basedir}"/>
</path>
<pathconvert refid="firebug-dev" property="firebug-dev"/>
</target>
<target name="firebug-service" depends="version" description="Check compreg.dat when service changes">
<uptodate property="deleteCompreg.notRequired" srcfile="./components/firebug-service.js" targetfile="${install.dir}/compreg.dat" />
</target>
<target name="clean-reg" depends="firebug-service" unless="deleteCompreg.notRequired"
description="Delete compreg.dat to reload service" >
<delete file="${install.dir}/compreg.dat"/>
</target>
<!-- Distribution XPI Targets -->
<target name="createChromeJAR">
<mkdir dir="${build_dir}" />
<zip destfile="${build_dir}/${ant.project.name}.jar" update="true" basedir="${src_dir}"
includes="content/**, locale/**, skin/**" excludes="${excludes}"/>
</target>
<target name="createPlatformJARs">
<mkdir dir="${build_dir}/Darwin" />
<mkdir dir="${build_dir}/Linux" />
<mkdir dir="${build_dir}/linux-gnu" />
<mkdir dir="${build_dir}/WINNT" />
<zip destfile="${build_dir}/Darwin/${ant.project.name}.jar" update="true"
basedir="${src_dir}/platform/Darwin" includes="skin/**" excludes="${excludes}" />
<zip destfile="${build_dir}/Linux/${ant.project.name}.jar" update="true"
basedir="${src_dir}/platform/Linux"
includes="skin/**"
excludes="${excludes}"
/>
<zip destfile="${build_dir}/linux-gnu/${ant.project.name}.jar" update="true"
basedir="${src_dir}/platform/linux-gnu"
includes="skin/**"
excludes="${excludes}"
/>
<zip destfile="${build_dir}/WINNT/${ant.project.name}.jar" update="true"
basedir="${src_dir}/platform/WINNT"
includes="skin/**"
excludes="${excludes}"
/>
</target>
<target name="zipIntoXPI" depends="clean, createChromeJAR, createAptanaJAR">
<mkdir dir="${dist_dir}" />
<antcall target="integrateAptana"/>
<zip destfile="${dist_dir}/${ant.project.name}.xpi" update="true">
<zipfileset dir="${build_dir}" includes="*.jar" prefix="chrome" />
<zipfileset dir="${src_dir}" includes="icons/**" prefix="chrome" excludes="${excludes}" />
<zipfileset dir="${src_dir}/platform" includes="**" prefix="platform" excludes="${excludes}, **/skin/**" />
<zipfileset dir="${src_dir}/components" includes="*.js" prefix="components" />
<zipfileset dir="${src_dir}/defaults" includes="**" prefix="defaults" excludes="${excludes}" />
<zipfileset dir="${src_dir}" includes="install.rdf" />
<zipfileset dir="${src_dir}" includes="jarred.manifest" fullpath="chrome.manifest"/>
</zip>
</target>
<target name="createDistributionXPI" depends="zipIntoXPI" >
<copy file="${dist_dir}/${ant.project.name}.xpi" tofile="${dist_dir}/${ant.project.name}.xpi.zip" />
</target>
<target name="createBranchXPI" depends="clean, version, expand-templates, zipIntoXPI, release-documentation" >
<move file="${dist_dir}/firebug.xpi" tofile="${dist_dir}/${FIREBUG-XPI}"/>
<copy file="${build_dir}/update.rdf" tofile="${dist_dir}/update.rdf" />
</target>
<target name="createAptanaJAR" if="aptanadebugger">
<echo message="Create aptanadebugger.jar"/>
<mkdir dir="${build_dir}" />
<zip destfile="${build_dir}/aptanadebugger.jar" update="true" basedir="${src_dir}/aptanadebugger/"
includes="content/**, locale/**, skin/**" excludes="${excludes}"/>
</target>
<target name="integrateAptana" if="aptanadebugger">
<echo message="Integrate AptanaDebugger"/>
<concat destfile="${build_dir}/chrome.manifest" force="yes">
<fileset file="${src_dir}/chrome.manifest"/>
<fileset file="${src_dir}/aptanadebugger/chrome.manifest"/>
</concat>
</target>
</project>