-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
84 lines (76 loc) · 3.46 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"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Sage.
-
- The Initial Developer of the Original Code is
- Peter Andrews <[email protected]>.
- Portions created by the Initial Developer are Copyright (C) 2005
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Peter Andrews <[email protected]>
- Erik Arvidsson <[email protected]>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<project name="sage" default="build">
<property name="build.dir" location="build"/>
<property name="src.dir" location="src"/>
<property name="gecko-sdk.dir" location="xulrunner-sdk"/>
<available file="${gecko-sdk.dir}" type="dir" property="gecko-sdk.dir.available"/>
<target name="clean" description="Remove build output">
<delete dir="${build.dir}"/>
</target>
<target name="assemble" description="Assemble extension structure">
<copy todir="${build.dir}/xpi">
<fileset dir="${src.dir}">
<include name="chrome/**"/>
<include name="components/*.js"/>
<include name="defaults/**"/>
<include name="modules/*.jsm"/>
<include name="chrome.manifest"/>
<include name="install.rdf"/>
</fileset>
</copy>
</target>
<target name="compile" description="Compile XPCOM IDL to typelib files" depends="assemble">
<fail unless="gecko-sdk.dir.available" message="Gecko SDK missing. See https://github.com/petea/sage#developing-sage"/>
<apply executable="python" dir="${src.dir}/components" failonerror="true" verbose="true">
<arg line="'${gecko-sdk.dir}/sdk/bin/typelib.py'"/>
<arg line="-I '${gecko-sdk.dir}/idl'"/>
<arg value="-o"/>
<targetfile/>
<srcfile/>
<fileset dir="${src.dir}/components">
<include name="*.idl"/>
</fileset>
<mapper type="glob" from="*.idl" to="${build.dir}/xpi/components/*.xpt"/>
</apply>
</target>
<target name="build" description="Build the Sage XPI file" depends="compile">
<zip destfile="${build.dir}/sage.xpi" basedir="${build.dir}/xpi" compress="true"/>
</target>
</project>