-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (36 loc) · 1.73 KB
/
Copy pathMakefile
File metadata and controls
43 lines (36 loc) · 1.73 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
LUA := lua
VERSION := $($(LUA) -e "m = require [[colyseus.client]]; print(m.VERSION)")
TARBALL := lua-colyseus-$(VERSION).tar.gz
REV := 1
LUAVER := 5.2
PREFIX := /usr/local
DPREFIX := $(DESTDIR)$(PREFIX)
LIBDIR := $(DPREFIX)/share/lua/$(LUAVER)
INSTALL := install
.PHONY: luacheck testsuite clean-engine
luacheck:
luacheck --std=max --codes colyseus
# Headless run of example/testsuite.collection: test/testsuite.ini swaps the
# bootstrap collection, so the built engine runs deftest and exits. Exits
# non-zero when deftest reports a failure or an error — usable as a CI gate.
# (Keep testsuite.ini free of comments; bob's settings parser rejects them.)
#
# BOB must match your editor's engine_sha1 (see README), and JAVA must be 25+ —
# the macOS editor bundles one, which is what the default picks up.
DEFOLD_APP ?= /Applications/Defold.app
JAVA ?= $(shell ls -d "$(DEFOLD_APP)"/Contents/Resources/packages/jdk-*/bin/java 2>/dev/null | tail -1)
BOB ?= bob.jar
PLATFORM ?= arm64-macos
TEST_BUNDLE ?= .testsuite-bundle
TEST_APP ?= $(TEST_BUNDLE)/Colyseus Defold SDK.app/Contents/MacOS/ColyseusDefoldSDK
## bob caches the extender's engine at .internal/cache/<platform>/build.zip and
## does NOT key it by --variant, so a desktop build followed by this gate would
## bundle the windowed engine — which prints nothing headless and exits 0, a
## false pass. Dropping both caches costs one extender round-trip.
clean-engine:
rm -rf .internal/cache build/arm64-osx build/x86_64-osx build/x86_64-linux build/arm64-linux
testsuite: clean-engine
"$(JAVA)" -jar "$(BOB)" --platform $(PLATFORM) --variant headless \
--settings test/testsuite.ini --archive \
resolve build bundle --bundle-output $(TEST_BUNDLE)
"$(TEST_APP)"