-
Notifications
You must be signed in to change notification settings - Fork 0
/
tao.build
224 lines (213 loc) · 9.28 KB
/
tao.build
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
<?xml version="1.0" ?>
<project name="Tao" default="package">
<!--
Targets:
buildrelease: builds release versions of libraries and examples.
package: creates release zip file for .NET and Mono.
-->
<echo message="Using '${nant.settings.currentframework}' Framework"/>
<!-- global project settings -->
<property name="project.config" value="Release" />
<property name="project.version" value="2.0.0" />
<property name="src.dir" value="src" />
<property name="examples.dir" value="examples" />
<property name="tests.dir" value="tests" />
<property name="dist.dir" value="dist" />
<property name="source.dir" value="source" />
<property name="bin.dir" value="bin" />
<property name="obj.dir" value="obj" />
<property name="lib.dir" value="lib" />
<property name="doc.dir" value="doc" />
<property name="dmg.dir" value="TaoFramework" />
<property name="is-osx" value="false"/>
<target name="net-2.0" description="Sets framework to .NET 2.0">
<property name="nant.settings.currentframework" value="net-2.0" />
</target>
<target name="mono-2.0" description="Sets framework to mono 2.0">
<call target="check-osx" />
<property name="nant.settings.currentframework" value="mono-2.0" />
</target>
<target name="check-osx" description="Checks if running on OSX">
<if test="${file::exists('/System/Library/Frameworks/Cocoa.framework/Cocoa')}">
<property name="is-osx" value="true" />
</if>
</target>
<target name="clean" description="Clean project">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
<delete dir="${dist.dir}" failonerror="false" />
<nant buildfile="${src.dir}/Tao.DevIl/Tao.DevIl.build" target="clean" />
<nant buildfile="${src.dir}/Tao.Ode/Tao.Ode.build" target="clean" />
<nant buildfile="${src.dir}/Tao.PhysFs/Tao.PhysFs.build" target="clean" />
<nant buildfile="${src.dir}/Tao.Sdl/Tao.Sdl.build" target="clean" />
<nant buildfile="${src.dir}/Tao.Lua/Tao.Lua.build" target="clean" />
<nant buildfile="${src.dir}/Tao.OpenGl/Tao.OpenGl.build" target="clean" />
</target>
<target name="package" depends="clean" description="Package">
<nant buildfile="${src.dir}/Tao.DevIl/Tao.DevIl.build" target="${nant.settings.currentframework} package" />
<nant buildfile="${src.dir}/Tao.Ode/Tao.Ode.build" target="${nant.settings.currentframework} package" />
<nant buildfile="${src.dir}/Tao.PhysFs/Tao.PhysFs.build" target="${nant.settings.currentframework} package" />
<nant buildfile="${src.dir}/Tao.Sdl/Tao.Sdl.build" target="${nant.settings.currentframework} package" />
<nant buildfile="${src.dir}/Tao.Lua/Tao.Lua.build" target="${nant.settings.currentframework} package" />
<nant buildfile="${src.dir}/Tao.OpenGl/Tao.OpenGl.build" target="${nant.settings.currentframework} package" />
<call target="copyfiles" />
<call target="zip" />
</target>
<target name="package-debug" description="Package Debug Mode" depends="clean">
<property name="project.config" value="Debug" />
<nant buildfile="${src.dir}/Tao.DevIl/Tao.DevIl.build" target="${nant.settings.currentframework} clean build-debug" />
<nant buildfile="${src.dir}/Tao.Ode/Tao.Ode.build" target="${nant.settings.currentframework} clean build-debug" />
<nant buildfile="${src.dir}/Tao.PhysFs/Tao.PhysFs.build" target="${nant.settings.currentframework} clean build-debug" />
<nant buildfile="${src.dir}/Tao.Sdl/Tao.Sdl.build" target="${nant.settings.currentframework} clean build-debug" />
<nant buildfile="${src.dir}/Tao.Lua/Tao.Lua.build" target="${nant.settings.currentframework} clean build-debug" />
<nant buildfile="${src.dir}/Tao.OpenGl/Tao.OpenGl.build" target="${nant.settings.currentframework} clean build-debug" />
<call target="copyfiles" />
</target>
<!-- copy project files -->
<target name="copyfiles">
<if test="${is-osx}">
<property name="dist.dir" value="${dist.dir}/${dmg.dir}" />
</if>
<if test="${project.config=='Release'}">
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${source.dir}">
<fileset>
<include name="**" />
<exclude name="**/${obj.dir}/**" />
<exclude name="**/${bin.dir}/**" />
<exclude name="**/*j.user" />
<exclude name="**.suo" />
<exclude name="**/*.build" />
<exclude name="**/*.mdp" />
<exclude name="**/*.mds" />
<exclude name="**/*.sln" />
<exclude name="**/*.cmbx" />
<exclude name="**/*.csproj" />
<exclude name="**/*.old" />
<exclude name="**/*.prjx" />
<exclude name="**/*.am" />
<exclude name="**/Makefile" />
<exclude name="**/configure" />
<exclude name="**/configure.ac" />
<exclude name="**/*.in" />
<exclude name="**/*.pc" />
<exclude name="**/*.stackdump" />
<exclude name="**/*.lnk" />
<exclude name="**/config.status" />
<exclude name="**/config.log" />
<exclude name="**/aclocal.m4" />
<exclude name="**/doc/**" />
<exclude name="**/dist/**" />
<exclude name="**/autom4te.cache/**" />
<exclude name="**/Debug/**" />
<exclude name="**/Release/**" />
<exclude name="**.swp" />
<exclude name="**.bak" />
<exclude name="**.project" />
</fileset>
</copy>
</if>
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${doc.dir}" flatten="true">
<fileset basedir="${src.dir}">
<include name="**/*.chm"/>
</fileset>
</copy>
<if test="${platform::is-unix()}">
<foreach item="Folder" property="foldername">
<echo message="${foldername}"/>
<in>
<items>
<include name="${src.dir}/*"/>
</items>
</in>
<do>
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${doc.dir}" >
<fileset basedir="${foldername}/${bin.dir}/${project.config}/doc">
<include name="**" />
<exclude name="*.chm"/>
</fileset>
</copy>
</do>
</foreach>
</if>
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${bin.dir}/assemblies" flatten="true">
<fileset basedir="${src.dir}">
<include name="**/*.dll"/>
<include name="**/*.xml"/>
<exclude name="**/prebuild.xml"/>
<exclude name="**/nunit.framework.dll"/>
<exclude name="**/*Bind*"/>
</fileset>
</copy>
<if test="${platform::is-unix() and not is-osx}">
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${bin.dir}/assemblies" flatten="true">
<fileset basedir="${src.dir}">
<include name="**/*.config"/>
<exclude name="**/app.config"/>
</fileset>
</copy>
</if>
<if test="${is-osx}">
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${bin.dir}/assemblies" flatten="true">
<fileset basedir="${src.dir}">
<include name="**/*.config.osx"/>
</fileset>
</copy>
</if>
<if test="${platform::is-win32()}">
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${bin.dir}/win32deps">
<fileset basedir="${project::get-base-directory()}/${lib.dir}/win32deps">
<include name="**"/>
</fileset>
</copy>
</if>
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${bin.dir}/${examples.dir}" flatten="true">
<fileset>
<include name="${examples.dir}/**/*.sh" />
<include name="${examples.dir}/**/*.exe" />
<include name="${src.dir}/**/*.dll" />
<exclude name="**/nunit.framework.dll"/>
<exclude name="**/app.config"/>
<exclude name="**/*Bind*"/>
</fileset>
</copy>
<if test="${platform::is-unix() and not is-osx}">
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${bin.dir}/${examples.dir}" flatten="true">
<fileset basedir="${src.dir}">
<include name="**/*.config"/>
<exclude name="**/app.config"/>
</fileset>
</copy>
</if>
<if test="${is-osx}">
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${bin.dir}/${examples.dir}" flatten="true">
<fileset basedir="other/config/osx">
<include name="**/*.config"/>
</fileset>
</copy>
</if>
<copy todir="${dist.dir}/${string::to-lower(project::get-name())}-${project.version}/${bin.dir}/${examples.dir}/Data" flatten="true">
<fileset>
<include name="${examples.dir}/**/Data/**" />
</fileset>
</copy>
</target>
<!-- create zip file -->
<target name="zip" description="zip/gzip files">
<property name="project.zip-path" value="${project::get-base-directory()}/${dist.dir}/${string::to-lower(project::get-name())}-${project.version}"/>
<if test="${platform::is-unix() and not is-osx}">
<tar destfile="${project.zip-path}.tar.gz" compression="GZip">
<fileset basedir="${dist.dir}">
<include name="${project.zip-path}/**" />
</fileset>
</tar>
</if>
<if test="${platform::is-win32()}">
<zip zipfile="${project.zip-path}.zip">
<fileset basedir="${dist.dir}">
<include name="${project.zip-path}/**" />
</fileset>
</zip>
</if>
<echo message="Created '${project::get-name()}' packages at ${project.zip-path}" />
</target>
</project>