-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
103 lines (89 loc) · 3.55 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
<project name="PiFire" default="dist" basedir=".">
<description>
Software for managing a pellet smoker
</description>
<target name="clean"
description="Remove generated artifacts for a clean build environment">
<delete quiet="true">
<fileset dir="generated/">
<filename name="generated-version.inc"/>
<filename name="generated-build-date.inc"/>
<filename name="generated-commit-hash.inc"/>
<filename name="generated-server-version.inc"/>
</fileset>
</delete>
</target>
<target name="dist" depends="dist.debian"
description="Build complete distribution"/>
<target name="generated" depends="generated-version.inc,
generated-build-date.inc,
release-series, generated-commit-hash.inc,
generated-server-version.inc"
description="Build generated files">
</target>
<target name="generated-version.inc">
<exec executable="git" outputproperty="git-rev-count">
<arg value="rev-list"/>
<arg value="HEAD"/>
<arg value="--count"/>
</exec>
<concat destfile="generated/generated-version.inc">
<propertyresource name="git-rev-count"/>
</concat>
</target>
<target name="generated-build-date.inc">
<tstamp/>
<concat destfile="generated/generated-build-date.inc">
<propertyresource name="TODAY"/>
</concat>
</target>
<target name="generated-commit-hash.inc">
<exec executable="git" outputproperty="git-hash">
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
<exec executable="git" outputproperty="git-status-short">
<arg value="status"/>
<arg value="--short"/>
</exec>
<!-- If there's no output, git-status-short doesn't even get set. If it
IS set, this property element has no effect. -->
<property name="git-status-short" value=""/>
<loadresource property="git-dirty">
<propertyresource name="git-status-short"/>
<filterchain>
<striplinebreaks/>
<replaceregex pattern=".+" replace="-modified" flags="s"/>
</filterchain>
</loadresource>
<property name="git-dirty" value=""/>
<concat destfile="generated/generated-commit-hash.inc">
<propertyresource name="git-hash"/>
<propertyresource name="git-dirty"/>
</concat>
</target>
<target name="release-series">
<exec executable="git" outputproperty="git-branch">
<arg value="rev-parse"/>
<arg value="--abbrev-ref"/>
<arg value="HEAD"/>
</exec>
<loadresource property="release-series">
<propertyresource name="git-branch"/>
<filterchain>
<striplinebreaks/>
<replaceregex pattern="master" replace="dev" flags="s"/>
</filterchain>
</loadresource>
</target>
<target name="generated-server-version.inc">
<xmlproperty file="version.xml" collapseAttributes="true"/>
<concat destfile="generated/generated-server-version.inc">
<propertyresource name="server.version"/>
</concat>
</target>
<target name="dist.debian" depends="generated"
description="Build a Debian binary package (.deb) for PiFire">
<ant dir="installer/debian" target="dist"/>
</target>
</project>