Repository navigation
Expand file tree
/
Copy pathpremake5.lua
More file actions
256 lines (215 loc) · 6.76 KB
/
Copy pathpremake5.lua
File metadata and controls
256 lines (215 loc) · 6.76 KB
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
newoption {
trigger = 'no-example',
description = 'Disable examples.'
}
newoption {
trigger = 'no-tutorial',
description = 'Disable tutorials.'
}
newoption {
trigger = 'no-plugin',
description = 'Disable plugins.'
}
newoption {
trigger = 'no-test',
description = 'Disable tests.'
}
newoption {
trigger = 'dist-dir',
description = 'Output folder for the redistributable SDK built with the \'dist\' action.'
}
solution "minko"
MINKO_HOME = path.getabsolute(os.getcwd())
dofile('sdk.lua')
-- buildable SDK
MINKO_SDK_DIST = false
include 'framework'
-- tutorial
if not _OPTIONS['no-tutorial'] then
include 'tutorial/01-hello-cube'
include 'tutorial/02-handle-canvas-resizing'
include 'tutorial/03-rotating-the-camera-around-an-object-with-the-mouse'
include 'tutorial/04-moving-objects'
include 'tutorial/05-moving-objects-with-the-keyboard'
include 'tutorial/06-load-3d-files'
include 'tutorial/07-loading-scene-files'
include 'tutorial/08-my-first-script'
include 'tutorial/09-scripting-mouse-inputs'
include 'tutorial/10-working-with-the-basic-material'
include 'tutorial/11-working-with-the-phong-material'
include 'tutorial/12-working-with-normal-maps'
include 'tutorial/13-working-with-environment-maps'
include 'tutorial/14-working-with-specular-maps'
include 'tutorial/15-loading-and-using-textures'
include 'tutorial/16-loading-effects'
include 'tutorial/17-creating-a-custom-effect'
include 'tutorial/18-creating-custom-materials'
include 'tutorial/19-binding-the-model-to-world-transform'
include 'tutorial/20-binding-the-camera'
include 'tutorial/21-authoring-uber-shaders'
include 'tutorial/22-creating-a-simple-post-processing-effect'
include 'tutorial/23-using-external-glsl-code-in-effect-files'
include 'tutorial/24-working-with-custom-vertex-attributes'
include 'tutorial/25-working-with-ambient-lights'
include 'tutorial/26-working-with-directional-lights'
include 'tutorial/27-working-with-point-lights'
include 'tutorial/28-working-with-spot-lights'
include 'tutorial/29-hello-falling-cube'
include 'tutorial/30-applying-anti-aliasing-effect'
end
-- plugin
if not _OPTIONS['no-plugin'] then
include 'plugin/android'
include 'plugin/lua'
include 'plugin/angle'
include 'plugin/zlib'
include 'plugin/assimp'
include 'plugin/devil'
include 'plugin/bullet'
include 'plugin/fx'
include 'plugin/html-overlay'
include 'plugin/http-loader'
include 'plugin/http-worker'
include 'plugin/jpeg'
include 'plugin/leap'
include 'plugin/oculus'
include 'plugin/offscreen'
include 'plugin/particles'
include 'plugin/png'
include 'plugin/sdl'
include 'plugin/serializer'
include 'plugin/webgl'
-- work around the inability of Xcode to build all projects if no dependency exists between them
if os.is("macosx") and (_ACTION == "xcode-ios" or _ACTION == "xcode-osx") then
minko.project.library "all"
objdir "/tmp/minko/obj"
links { "minko-framework" }
local plugins = os.matchdirs('plugin/*')
for i, basedir in ipairs(plugins) do
local pluginName = path.getbasename(basedir)
minko.plugin.enable(pluginName)
end
end
end
-- example
if not _OPTIONS['no-example'] then
include 'example/clone'
include 'example/assimp'
include 'example/cube'
include 'example/devil'
include 'example/effect-config'
include 'example/flares'
include 'example/fog'
include 'example/frustum'
include 'example/hologram'
include 'example/html-overlay'
include 'example/http'
include 'example/jobs'
include 'example/joystick'
include 'example/keyboard'
include 'example/leap-motion'
include 'example/light'
include 'example/line-geometry'
include 'example/lua-scripts'
include 'example/multi-surfaces'
include 'example/oculus'
include 'example/offscreen'
include 'example/particles'
include 'example/physics'
include 'example/picking'
include 'example/raycasting'
include 'example/serializer'
include 'example/sky-box'
include 'example/stencil'
include 'example/visibility'
include 'example/water'
end
-- test
if not _OPTIONS['no-test'] then
include 'test'
end
newaction {
trigger = 'dist',
description = 'Generate the distributable version of the Minko SDK.',
execute = function()
-- print("Building documentation...")
-- os.execute("doxygen doc/Doxyfile")
local distDir = 'dist'
if _OPTIONS['dist-dir'] then
distDir = _OPTIONS['dist-dir']
end
os.rmdir(distDir)
os.mkdir(distDir)
os.copyfile('sdk.lua', distDir .. '/sdk.lua')
print("Packaging core framework...")
-- framework
os.mkdir(distDir .. '/framework')
os.mkdir(distDir .. '/framework/bin')
minko.os.copyfiles('framework/bin', distDir .. '/framework/bin')
os.mkdir(distDir .. '/framework/include')
minko.os.copyfiles('framework/include', distDir .. '/framework/include')
os.mkdir(distDir .. '/framework/lib')
minko.os.copyfiles('framework/lib', distDir .. '/framework/lib')
os.mkdir(distDir .. '/framework/asset')
minko.os.copyfiles('framework/asset', distDir .. '/framework/asset')
-- skeleton
os.mkdir(distDir .. '/skeleton')
minko.os.copyfiles('skeleton', distDir .. '/skeleton')
-- module
os.mkdir(distDir .. '/module')
minko.os.copyfiles('module', distDir .. '/module')
-- -- doc
-- os.mkdir(distDir .. '/doc')
-- minko.os.copyfiles('doc/html', distDir .. '/doc')
-- tool
os.mkdir(distDir .. '/tool/')
minko.os.copyfiles('tool', distDir .. '/tool')
-- plugin
local plugins = os.matchdirs('plugin/*')
os.mkdir(distDir .. '/plugin')
for i, basedir in ipairs(plugins) do
local pluginName = path.getbasename(basedir)
print('Packaging plugin "' .. pluginName .. '"...')
-- plugins
local dir = distDir .. '/plugin/' .. path.getbasename(basedir)
local binDir = dir .. '/bin'
-- plugin.lua
assert(os.isfile(basedir .. '/plugin.lua'), 'missing plugin.lua')
os.mkdir(dir)
os.copyfile(basedir .. '/plugin.lua', dir .. '/plugin.lua')
if minko.plugin[pluginName] and minko.plugin[pluginName].dist then
minko.plugin[pluginName]:dist(dir)
end
-- bin
if os.isdir(basedir .. '/bin') then
os.mkdir(binDir)
minko.os.copyfiles(basedir .. '/bin', binDir)
end
-- includes
if os.isdir(basedir .. '/include') then
os.mkdir(dir .. '/include')
minko.os.copyfiles(basedir .. '/include', dir .. '/include')
end
-- assets
if os.isdir(basedir .. '/asset') then
os.mkdir(dir .. '/asset')
minko.os.copyfiles(basedir .. '/asset', dir .. '/asset')
end
end
minko.action.zip(distDir, distDir .. '.zip')
end
}
newaction {
trigger = "doc",
description = "Create developer reference.",
execute = function()
os.execute("doxygen doc/Doxyfile")
end
}
newaction {
trigger = "clean",
description = "Remove generated files.",
execute = function()
minko.action.clean()
end
}