-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
130 lines (98 loc) · 4.01 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<project name="pintadOS-una Framework build script" basedir="." default="debug" xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks">
<property name="file.build.properties" value="${project}/build.properties" />
<property file="${file.build.properties}" />
<property name="file.version.properties" value="${project}/version.properties" />
<property file="${file.version.properties}" />
<property file="${project}/project.properties" />
<property name="buildtools.version" value="1.0.0" />
<!-- Custom Tasks -->
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<target name="debug">
<available file="${file.build.properties}" property="legacy.build"/>
<available property="project.exist" file="${project}"/>
<fail unless="project.exist" message="Invalid project specified. Please check the path." />
<if>
<equals arg1="${legacy.build}" arg2="true"/>
<then>
<ant antfile="build.xml" target="debug" dir="mach/legacy"/>
</then>
<else>
<antcall target="format-version-numbers"/>
<if>
<equals arg1="${kernel}" arg2="true"/>
<then>
<ant antfile="${machine.family}.xml" target="kernel-debug" dir="mach/${machine.manufacturer}-${machine.family}"/>
</then>
<else>
<ant antfile="${machine.family}.xml" target="debug" dir="mach/${machine.manufacturer}-${machine.family}"/>
</else>
</if>
</else>
</if>
</target>
<target name="release" depends="format-version-numbers">
<available file="${file.build.properties}" property="legacy.build"/>
<available property="project.exist" file="${project}"/>
<fail unless="project.exist" message="Invalid project specified. Please check the path." />
<if>
<equals arg1="${legacy.build}" arg2="true"/>
<then>
<if>
<equals arg1="${kernel}" arg2="true"/>
<then>
<ant antfile="build.xml" target="kernel-release" dir="mach/legacy"/>
</then>
<else>
<ant antfile="build.xml" target="release" dir="mach/legacy"/>
</else>
</if>
</then>
<else>
<antcall target="format-version-numbers"/>
<if>
<equals arg1="${kernel}" arg2="true"/>
<then>
<ant antfile="${machine.family}.xml" target="kernel-release" dir="mach/${machine.manufacturer}-${machine.family}"/>
</then>
<else>
<ant antfile="${machine.family}.xml" target="release" dir="mach/${machine.manufacturer}-${machine.family}"/>
</else>
</if>
</else>
</if>
</target>
<target name="release-minor" depends="format-version-numbers">
<available file="${file.build.properties}" property="legacy.build"/>
<available property="project.exist" file="${project}"/>
<fail unless="project.exist" message="Invalid project specified. Please check the path." />
<if>
<equals arg1="${legacy.build}" arg2="true"/>
<then>
<ant antfile="build.xml" target="release-minor" dir="mach/legacy"/>
</then>
<else>
<antcall target="format-version-numbers"/>
<if>
<equals arg1="${kernel}" arg2="true"/>
<then>
<ant antfile="${machine.family}.xml" target="kernel-release" dir="mach/${machine.manufacturer}-${machine.family}"/>
</then>
<else>
<ant antfile="${machine.family}.xml" target="release-minor" dir="mach/${machine.manufacturer}-${machine.family}"/>
</else>
</if>
</else>
</if>
</target>
<target name="format-version-numbers">
<propertyregex property="number.swcode.trim" input="${number.swcode}"
regexp="\s*" replace=""/>
<propertyregex property="number.version.trim" input="${number.version}"
regexp="\s*" replace=""/>
<propertyregex property="number.version.minor.trim" input="${number.version.minor}"
regexp="\s*" replace=""/>
<var name="number.swcode" value="${number.swcode.trim}"/>
<var name="number.version" value="${number.version.trim}"/>
<var name="number.version.minor" value="${number.version.minor.trim}"/>
</target>
</project>