-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
74 lines (54 loc) · 2.28 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
<?xml version="1.0"?>
<project name="remoteit" basedir="." default="usage">
<property name="name" value="remoteit" />
<property name="resource.dir" value="resources" />
<property name="src.dir" value="src" />
<property name="src.xpi.dir" value="${src.dir}/xpi" />
<property name="src.xpi.content.dir" value="${src.xpi.dir}/chrome/content" />
<property name="src.js.dir" value="${src.dir}/scripts" />
<property name="build.dir" value="build" />
<property name="xpi.dir" value="${build.dir}/xpi" />
<property name="xpi.file.name" value="remoteit.xpi" />
<property name="xpi.file.loc" value="${xpi.dir}/${xpi.file.name}" />
<property name="zip.base.dir" value="${src.xpi.dir}" />
<property name="yui-compressor.jar" value="${resource.dir}/yuicompressor-2.4.6.jar" />
<target name="usage">
<echo message="" />
<echo message="Remote It build" />
<echo message="------------------------------------------------------" />
<echo message="" />
<echo message="Available targets are:" />
<echo message="" />
<echo message="clean --> Clean out old builds" />
<echo message="obfuscate --> Obfuscate my JS" />
<echo message="xpi --> Build the firefox addon archive (xpi (zippy))" />
<echo message="all --> Clean, xpi" />
<echo message="" />
</target>
<target name="clean" description="Clean out old builds (build)">
<delete dir="${build.dir}" />
<echo message="Clean it up" />
<echo message="Create new dir" />
<mkdir dir="${xpi.dir}" />
</target>
<target name="obfuscate" description="Obfuscate my JS">
<apply executable="java" parallel="false" dest="${src.xpi.content.dir}">
<fileset dir="${src.js.dir}" casesensitive="yes" includes="*.js" />
<arg line="-jar" />
<arg path="${yui-compressor.jar}" />
<srcfile />
<arg line="--preserve-semi" />
<arg line="-o" />
<mapper type="glob" from="*.js" to="*.js" />
<targetfile />
</apply>
<echo message="Obfustcation done.." />
</target>
<target name="xpi" description="Create XPI (zippy) (build)" depends="obfuscate">
<zip destfile="${xpi.file.loc}" basedir="${zip.base.dir}" />
<echo message="XPI (zippy) created.." />
</target>
<target name="all" depends="clean, xpi" description="Clean, xpi">
<echo message="All Done!! XPI is in ${xpi.file.loc}" />
</target>
</project>