forked from crossbario/autobahn-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
108 lines (84 loc) · 2.29 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
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
.PHONY: clean test build_browser build_npm publish_browser publish_npm
default:
@echo "Targets:"
@echo " - clean Clean the build"
@echo " - test Run all unit tests"
@echo " - build_browser Build browser version of the library"
@echo " - build_npm NOOP (there is nothing to prebuild here)"
@echo " - publish_browser Publish the browser version of the library"
@echo " - publish_npm Publish the npm version of the library"
#
# Cleanup targets (we use "sudo" to cleanup when building not on host, but via target "docker_build_browser")
#
distclean: clean
-sudo rm -rf ./node_modules
-sudo rm -f ./package-lock.json
clean:
-sudo rm -f .sconsign.dblite
-sudo rm -rf ./build
#
# Docker based build targets (normally, use these!)
#
# build Docker toolchain image
docker_build_toolchain:
docker build \
-t autobahnjs-toolchain \
-f Dockerfile \
.
docker_toolchain_shell:
docker run -it --rm \
--net=host \
-v ${PWD}:/work \
autobahnjs-toolchain \
bash
# use the Docker toolchain image to build AutobahnJS
# for browsers
docker_build_browser:
docker run -it --rm \
--net=host \
-v ${PWD}:/work \
autobahnjs-toolchain \
make build_browser_docker
#
# host native build targets
#
requirements:
pip install -U scons boto taschenmesser
sudo apt update
sudo apt install -y npm nodejs default-jre
node -v
build_browser_docker:
npm install --only=dev
npm install
scons
build_browser_host:
npm install --only=dev
npm install
JAVA_HOME=/usr/lib/jvm/default-java JS_COMPILER=${PWD}/node_modules/google-closure-compiler-java/compiler.jar scons
build_build_npm:
@echo "Ok, npm doesn't need a build step"
#
# Package publication targets
#
publish: publish_browser publish_npm
publish_browser:
git -C ../autobahn-js-browser pull
cp ./build/* ../autobahn-js-browser/
cp ./build/* ../crossbar-examples/_shared-web-resources/autobahn/
@echo "Now commit and push these repos: autobahn-js-browser, crossbar-examples"
publish_npm: build_npm
npm publish
#
# Test targets
#
crossbar:
crossbar start
test:
npm test
npm list ws bufferutil when crypto-js
test_connect:
nodeunit test/test_connect.js
test_serialization_cbor:
nodeunit test/test_serialization_cbor.js
test_pubsub_multiple_matching_subs:
nodeunit test/test_pubsub_multiple_matching_subs.js