-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
108 lines (91 loc) · 3.88 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<project name="package-glean" default="package" basedir=".">
<description>Create a distribution of Glean</description>
<property name="version" value="1.3.1"/>
<property name="dist.name" value="glean-${version}"/>
<property name="dist.dir" value="dist"/>
<property name="doc.dir" value="doc"/>
<property name="dist.docs" value="target"/>
<property name="glean.dir" value="src"/>
<property name="scp.port" value="232"/>
<property name="scp.user" value="jbrugge"/>
<property name="release.host" value="jbrugge.com"/>
<property name="release.dist.path" value="httpdocs/glean"/>
<property name="release.doc.path" value="httpdocs/glean"/>
<property file="toolhome.properties"/>
<basename property="package.script" file="${ant.file}"/>
<patternset id="doc.files">
<include name="**/*.html"/>
<include name="**/*.css"/>
<include name="**/*.jpg"/>
</patternset>
<patternset id="src.files">
<exclude name="logs/"/>
<exclude name="tmp/"/>
</patternset>
<target name="doc"
description="Build the tool documentation">
<ant dir="${doc.dir}" target="docs">
<property name="docs.dest" value="${dist.docs}"/>
</ant>
</target>
<target name="package" depends="package-zip, package-gzip"/>
<target name="package-zip"
depends="doc"
description="Package up a distribution as a ZIP archive">
<mkdir dir="${dist.dir}"/>
<zip destfile="${dist.dir}/${dist.name}.zip">
<zipfileset dir="${doc.dir}/${dist.docs}" prefix="${dist.name}/docs">
<patternset refid="doc.files"/>
</zipfileset>
<zipfileset dir="${glean.dir}" prefix="${dist.name}">
<patternset refid="src.files"/>
</zipfileset>
</zip>
</target>
<target name="package-gzip"
depends="doc"
description="Package up a distribution as a gzip archive">
<mkdir dir="${dist.dir}"/>
<tar destfile="${dist.dir}/${dist.name}.tar.gz"
compression="gzip">
<tarfileset dir="${doc.dir}/${dist.docs}" prefix="${dist.name}/docs">
<patternset refid="doc.files"/>
</tarfileset>
<tarfileset dir="${glean.dir}" prefix="${dist.name}">
<patternset refid="src.files"/>
</tarfileset>
</tar>
</target>
<target name="release"
depends="package"
description="Copy a distribution out to the server">
<echo message="Copying ${dist.dir}/${dist.name}.zip to ${release.host}:${release.dist.path}"/>
<exec executable="scp" dir="${basedir}">
<arg line="-P ${scp.port}"/>
<arg line="${dist.dir}/${dist.name}.zip ${scp.user}@${release.host}:${release.dist.path}"/>
</exec>
</target>
<target name="publish-docs"
depends="doc"
description="Publish the documentation pages to the server">
<echo message="Copying ${doc.dir}/${dist.docs}/* to ${release.host}:${release.doc.path}"/>
<exec executable="scp" dir="${basedir}">
<arg line="-P ${scp.port} ${doc.dir}/${dist.docs}/* ${scp.user}@${release.host}:${release.doc.path}"/>
</exec>
<!-- Getting the scp task working natively would make this step much easier:
<scp todir="${scp.user}@${release.host}:${release.doc.path}"
port="${scp.port}">
<fileset dir="${doc.dir}/${dist.docs}">
<include name="*"/>
</fileset>
</scp>
--> </target>
<target name="clean"
depends="clean-docs"
description="Delete generated files">
<delete dir="${dist.dir}"/>
</target>
<target name="clean-docs">
<ant dir="${doc.dir}" target="clean"/>
</target>
</project>