forked from tolmasky/cappuccino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.xml
231 lines (174 loc) · 6.66 KB
/
common.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<project name = "common">
<property environment = "env" />
<dirname property = "Checkout" file = "${ant.file.common}" />
<property name = "Configuration" value = "Release" />
<property name = "Build" location = "${env.STEAM_BUILD}" />
<property name = "env.OBJJ_HOME" value = "/usr/local/share/objj" />
<property name = "env.OBJJ_LIB" value = "${env.OBJJ_HOME}/lib" />
<!-- allow bootstrapping: use installed js.jar if it's present, otherwise use local version -->
<condition property = "jsjar" value = "${env.OBJJ_LIB}/js.jar">
<and>
<available file = "${env.OBJJ_LIB}/js.jar" />
<!-- hack to prevent deprecation warnings for overwriting properties -->
<not>
<isset property = "jsjar" />
</not>
</and>
</condition>
<property name = "jsjar" value = "${Checkout}/Tools/Utilities/js.jar" />
<!-- Steam Version Checking -->
<target name = "steam-uptodate">
<exec executable = "steam" outputproperty = "steam.version">
<arg line = "--version" />
</exec>
<fail>
!
**********************************************
You version of Steam is out of date.
----------------------------------------------
Please run the following commands to update:
$sudo echo
$ant bootstrap
**********************************************
<condition>
<not>
<contains string = "${steam.version}" substring = "steam version 0.6" />
</not>
</condition>
</fail>
</target>
<!-- <macrodef name = "safe-steam-build" >
<element name = "args" optional = "true" implicit = "true" />
<sequential>
<antcall target = "steam-uptodate" />
<steam-build>
<arguments>
<args/>
</arguments>
</steam-build>
</sequential>
</macrodef> -->
<!-- Short Hands -->
<target name = "build-release">
<ant antfile = "build.xml">
<property name = "Configuration" value = "Release" />
</ant>
</target>
<target name = "clean-release">
<ant antfile = "build.xml" target = "clean">
<property name = "Configuration" value = "Release" />
</ant>
</target>
<target name = "build-debug">
<ant antfile = "build.xml">
<property name = "Configuration" value = "Debug" />
</ant>
</target>
<target name = "clean-debug">
<ant antfile = "build.xml" target = "clean">
<property name = "Configuration" value = "Debug" />
</ant>
</target>
<target name = "release" >
<antcall target = "build-release" />
</target>
<target name = "debug" >
<antcall target = "build-debug" />
</target>
<target name = "all" >
<antcall target = "build-debug" />
<antcall target = "build-release" />
</target>
<target name = "clean-all" >
<antcall target = "clean-debug" />
<antcall target = "clean-release" />
</target>
<!-- Iterate -->
<macrodef name = "iterate">
<attribute name = "target"/>
<element name = "files" />
<sequential>
<subant target = "@{target}" inheritall = "false" inheritrefs = "false" >
<files/>
</subant>
</sequential>
</macrodef>
<macrodef name = "iterate-build">
<attribute name = "target"/>
<sequential>
<subant target = "@{target}" inheritall = "false" inheritrefs = "false" >
<fileset dir = "." includes = "*/build.xml" />
</subant>
</sequential>
</macrodef>
<!-- JavaScript Compiler -->
<macrodef name = "jsc">
<attribute name = "dir" default = "." />
<element name = "arguments"/>
<sequential>
<java classname = "org.mozilla.javascript.tools.jsc.Main" dir = "@{dir}" fork = "true">
<classpath>
<pathelement location = "${jsjar}" />
<pathelement location = "." />
</classpath>
<arguments/>
</java>
</sequential>
</macrodef>
<!-- JavaScript "Preprocessor" -->
<macrodef name = "preprocess">
<attribute name = "file" />
<attribute name = "output"/>
<element name = "arguments" optional = "true" />
<sequential>
<exec executable = "gcc" output = "@{output}" error = "@{output}.err">
<!-- Preprocessing only -->
<arg value = "-E" />
<!-- Interpret files as C source files (instead of treating them as object files); this option is given to make the compiler preprocess them -->
<arg value = "-x" />
<arg value = "c" />
<!-- Don't generate #line directives (which would of course mess things up in HTML documents!) -->
<arg value = "-P" />
<arguments/>
<arg value = "@{file}" />
</exec>
</sequential>
</macrodef>
<!-- git tasks -->
<macrodef name = "git">
<attribute name = "command" />
<attribute name = "dir" default = "" />
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}">
<arg value = "@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name = "git-clone-pull">
<attribute name = "repository" />
<attribute name = "dest" />
<sequential>
<git command = "clone">
<args>
<arg value = "@{repository}" />
<arg value = "@{dest}" />
</args>
</git>
<git command = "pull" dir = "@{dest}" />
</sequential>
</macrodef>
<!-- ojtest task -->
<macrodef name = "ojtest">
<attribute name = "frameworks" default = "${env.STEAM_BUILD}/Release" />
<element name = "tests" />
<sequential>
<apply executable = "ojtest" parallel = "true">
<env key = "OBJJ_INCLUDE_PATHS" value = "@{frameworks}" />
<tests/>
</apply>
</sequential>
</macrodef>
</project>