-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlakefile
42 lines (36 loc) · 1.16 KB
/
lakefile
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
J = J or path.join
if LUA_VER == '5.3' then
LUA_NEED = 'lua52'
LUA_DIR = ENV.LUA_DIR_5_3 or ENV.LUA_DIR
LUA_RUNNER = 'lua53'
elseif LUA_VER == '5.2' then
LUA_NEED = 'lua52'
LUA_DIR = ENV.LUA_DIR_5_2 or ENV.LUA_DIR
LUA_RUNNER = 'lua52'
else
LUA_NEED = 'lua'
LUA_DIR = ENV.LUA_DIR
LUA_RUNNER = 'lua'
end
PROJECT = 'ZipWriter'
INSTALL_DIR = INSTALL_DIR or J(LUA_DIR,'libs',PROJECT)
install = target('install', {
file.group{odir=J(INSTALL_DIR, 'lua' );recurse = true; src = J('lua', '*.*' )};
file.group{odir=J(INSTALL_DIR, 'doc' );recurse = true; src = J('doc', '*.*' )};
file.group{odir=J(INSTALL_DIR, 'utils' );recurse = true; src = J('utils','*.*' )};
file.group{odir=J(INSTALL_DIR, 'test' );recurse = true; src = J('test', '*.*' )};
})
local function run(file, cwd)
print()
print("run " .. file)
if not TESTING then
if cwd then lake.chdir(cwd) end
os.execute( LUA_RUNNER .. ' ' .. file )
if cwd then lake.chdir("<") end
print()
end
end
target('test', install, function()
local test_dir = J(INSTALL_DIR,'test')
run(J(test_dir,'test.lua'), test_dir)
end)