forked from leafo/lapis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (39 loc) · 1.78 KB
/
Makefile
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
.PHONY: test local build lint test_db mysql_test_db clean test_lua51 test_lua52 test_lua53 clean_luarocks
test:
busted spec
busted spec_postgres
busted spec_mysql
busted spec_openresty
local: build
luarocks --lua-version=5.1 make --force --local lapis-dev-1.rockspec
clean_luarocks:
rm -rf luarocks51 luarocks52 luarocks53
luarocks5%:
@echo "$$(tput setaf 3)Preparing Luarocks for 5.$*$$(tput sgr0)"
luarocks --lua-version=5.$* --tree=luarocks5$* install busted
luarocks --lua-version=5.$* --tree=luarocks5$* install moonscript
luarocks --lua-version=5.$* --tree=luarocks5$* install https://raw.githubusercontent.com/leafo/lua-cjson/master/lua-cjson-dev-1.rockspec
test_lua51: luarocks51 build
luarocks --lua-version=5.1 --tree=luarocks51 make lapis-dev-1.rockspec
LUA_PATH="$$(luarocks --lua-version=5.1 path --lr-path);;" LUA_CPATH="$$(luarocks --lua-version=5.1 path --lr-cpath);;" luarocks51/bin/busted spec
test_lua52: luarocks52 build
luarocks --lua-version=5.2 --tree=luarocks52 make lapis-dev-1.rockspec
LUA_PATH="$$(luarocks --lua-version=5.2 path --lr-path);;" LUA_CPATH="$$(luarocks --lua-version=5.2 path --lr-cpath);;" luarocks52/bin/busted spec
test_lua53: luarocks53 build
luarocks --lua-version=5.3 --tree=luarocks53 make lapis-dev-1.rockspec
LUA_PATH="$$(luarocks --lua-version=5.3 path --lr-path);;" LUA_CPATH="$$(luarocks --lua-version=5.3 path --lr-cpath);;" luarocks53/bin/busted spec
build:
moonc lapis
moonc spec_openresty/s2
moonc spec_mysql/models.moon
lint:
moonc lint_config.moon
moonc -l $$(find lapis | grep moon$$)
test_db:
-dropdb -U postgres lapis_test
createdb -U postgres lapis_test
mysql_test_db:
echo 'drop database if exists lapis_test' | mysql -u root
echo 'create database lapis_test' | mysql -u root
clean:
rm $$(find lapis/ | grep \.lua$$)