-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
88 lines (72 loc) · 4.53 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
<project basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<description>Use to setup extensions.</description>
<property file="build.properties" />
<!-- TODO: Add check that browser is set -->
<property name="browser" value="${browser}" />
<property name="build.dir" value="_build" />
<echo>Using browser: ${browser}</echo>
<echo>Build dir: ${build.dir}</echo>
<target name="init">
<mkdir dir="${build.dir}" />
<xslt style="sortLibraries.xsl" in="libraries.properties.xml" out="${build.dir}/libraries.sorted.xml"/>
</target>
<target name="build" depends="init">
<!-- Copy resources -->
<switch value="${browser}">
<case value="chrome">
<echo message="Chrome pathway." />
<property name="working.dir" value="${build.dir}/LibrarySearch.chrome" />
<mkdir dir="${working.dir}" />
<xslt style="options.chrome.xsl"
in="${build.dir}/libraries.sorted.xml" out="${build.dir}/options.chrome.html"/>
<loadfile property="options.chrome.html.rawtext" srcFile="${build.dir}/options.chrome.html" />
<copy todir="${working.dir}">
<fileset dir="LibrarySearch.chrome" />
<filterset>
<filter token="EXTENSION_NAME" value="${extension_name}" />
<filter token="EXTENSION_VERSION" value="${extension_version}" />
<filter token="EXTENSION_DESCRIPTION" value="${extension_description}" />
<filter token="CHROME_OPTIONS_HTML" value="${options.chrome.html.rawtext}" />
</filterset>
</copy>
<copy file="common/resources/LibrarySearchIcon-16.png" todir="${working.dir}"/>
<copy file="common/resources/LibrarySearchIcon-24.png" todir="${working.dir}"/>
<copy file="common/resources/LibrarySearchIcon-48.png" todir="${working.dir}"/>
<zip destfile="${build.dir}/LibrarySearch.chrome.zip"
basedir="${build.dir}/LibrarySearch.chrome" />
</case> <!-- End chrome -->
<case value="safari">
<echo message="Safari pathway." />
<property name="working.dir" value="${build.dir}/LibrarySearch.safari" />
<mkdir dir="${working.dir}" />
<xslt style="options.safari.keys.xsl"
in="${build.dir}/libraries.sorted.xml" out="${build.dir}/options.safari.keys.html"/>
<xslt style="options.safari.values.xsl"
in="${build.dir}/libraries.sorted.xml" out="${build.dir}/options.safari.values.html"/>
<loadfile property="options.safari.keys.html.rawtext" srcFile="${build.dir}/options.safari.keys.html" />
<loadfile property="options.safari.values.html.rawtext" srcFile="${build.dir}/options.safari.values.html" />
<copy todir="${working.dir}">
<fileset dir="LibrarySearch.safariextension" />
<filterset>
<filter token="EXTENSION_NAME" value="${extension_name}" />
<filter token="EXTENSION_VERSION" value="${extension_version}" />
<filter token="EXTENSION_DESCRIPTION" value="${extension_description}" />
<filter token="EXTENSION_AUTHOR" value="${extension_author}" />
<filter token="EXTENSION_WEBSITE" value="${extension_website}" />
<filter token="SAFARI_BUNDLE_IDENTIFIER" value="${safari_bundle_identifier}" />
<filter token="SAFARI_UPDATE_URL" value="${safari_update_url}" />
<filter token="SAFARI_FILE_URL" value="${safari_file_url}" />
<filter token="SAFARI_OPTIONS_KEYS_HTML" value="${options.safari.keys.html.rawtext}" />
<filter token="SAFARI_OPTIONS_VALUES_HTML" value="${options.safari.values.html.rawtext}" />
<filter token="SAFARI_DEVELOPER_ID" value="${safari_developer_id}" />
</filterset>
</copy>
<echo message="Completed building Safari. You will need to use the the Safari Extension builder to package the extension located at ${build.dir}/LibrarySearch.safari." />
</case> <!-- End safari -->
</switch>
</target>
<target name="clean">
<delete dir="${build.dir}" />
</target>
</project>