forked from crossbario/autobahn-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
107 lines (83 loc) · 2.21 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
.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
#
clean:
sudo rm -rf build
dist_clean: clean
sudo rm -rf ./node_modules
sudo rm -f .sconsign.dblite
#
# 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 browser_deps build_browser
#
# host native build targets
#
requirements:
pip install -U scons boto taschenmesser
sudo apt update
sudo apt install -y npm nodejs-legacy default-jre
node -v
sudo npm install -g google-closure-compiler nodeunit
browser_deps:
npm install
npm update
build_browser:
scons
java -jar /usr/local/lib/node_modules/google-closure-compiler/compiler.jar --version
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/
cp ./build/* ../crossbar/crossbar/templates/default/web/js/
@echo "Now commit and push these repos: autobahn-js-browser, crossbar"
publish_npm: build_npm
npm publish
#
# Test targets
#
crossbar:
crossbar start --personality=community
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