Skip to content

Commit 902b145

Browse files
author
Tobias Oberstein
committed
more cleanups
1 parent 61e6d60 commit 902b145

File tree

5 files changed

+63
-61
lines changed

5 files changed

+63
-61
lines changed

LICENSE.md LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) Tavendo GmbH and contributors.
1+
Copyright (C) Crossbar.io Technologies GmbH and contributors.
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of
44
this software and associated documentation files (the "Software"), to deal in

SConstruct

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ checksums.append(env.SHA256("build/CHECKSUM.SHA256", artifacts))
5050

5151
# fixed static files to be included
5252
statics = []
53-
for f in ["LICENSE.md"]:
53+
for f in ["LICENSE"]:
5454
statics.append(Command("build/{}".format(f), [], Copy("$TARGET", f)))
5555

5656
# The default target consists of all artifacts that

copy2crossbar.py

-9
This file was deleted.

doc/building.md

+60-38
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
# Building Autobahn|JS
22

3-
To build **Autobahn|JS** for use in browsers, you will need
3+
The following describes how to build and publish **Autobahn|JS** for browser and Node.
44

5-
- [Node.js](http://nodejs.org/)
6-
- [Google Closure Compiler](http://dl.google.com/closure-compiler/compiler-latest.zip)
7-
- [SCons](http://www.scons.org/)
8-
- [Taschenmesser](https://github.com/oberstet/taschenmesser)
9-
- [browserify](http://browserify.org/)
10-
- [ws](http://websockets.github.io/ws/)
11-
- [crypto-js](https://www.npmjs.org/package/crypto-js)
125

13-
14-
## Installing build requirements
6+
## Build environment (browser build)
157

168
Install [Node.js](http://nodejs.org/)
179

1810
sudo apt-get install -y nodejs nodejs-legacy npm
1911

20-
Install browserify
12+
Install [browserify](http://browserify.org/)
2113

2214
sudo npm install -g browserify
2315

@@ -29,7 +21,7 @@ Install Java JDK
2921

3022
sudo apt install -y openjdk-8-jdk
3123

32-
Install
24+
Install [Google Closure Compiler](https://developers.google.com/closure/compiler/)
3325

3426
cd ~
3527
rm -f compiler-latest.zip
@@ -49,35 +41,65 @@ Set environment variables (add that to `$HOME/.profile`):
4941
export NODE_PATH=/usr/local/lib/node_modules/
5042

5143

44+
## Building for browsers
5245

53-
54-
55-
56-
57-
58-
**Clone the Autobahn|JS repo**
59-
60-
git clone [email protected]:tavendo/AutobahnJS.git
61-
cd autobahnjs
62-
63-
**Install JavaScript dependencies in NodeJS**
64-
65-
npm install ws when crypto-js msgpack-lite utf-8-validate
66-
67-
**Start the build**:
46+
To start the build:
6847

6948
scons
7049

71-
> **note**
72-
>
73-
> When using a bash shell under Windows (e.g. git shell), use 'scons.py'.
74-
75-
**You get 3 files inside the** `build` **directory**
76-
77-
build/autobahn.js
78-
build/autobahn.min.js
79-
build/autobahn.min.jgz
80-
81-
To **clean up your build** (i.e. remove previously created files):
50+
To clean up your build:
8251

8352
scons -uc
53+
54+
Here is a typical build output (*some* warnings are "ok" - they come from dependencies we don't control):
55+
56+
57+
```console
58+
(cpy2712_1) oberstet@office-corei7:~/scm/crossbario/autobahn-js$ scons
59+
scons: Reading SConscript files ...
60+
Building AutobahnJS 0.11.0
61+
scons: done reading SConscript files.
62+
scons: Building targets ...
63+
browserify lib/autobahn.js --standalone autobahn -o build/autobahn.js
64+
js_builder(["build/autobahn.min.js"], ["build/autobahn.js"])
65+
java -jar /home/oberstet/closure-compiler-v20161024.jar --compilation_level SIMPLE_OPTIMIZATIONS --js build/autobahn.js --js_output_file build/autobahn.min.js
66+
build/autobahn.js:772: WARNING - Suspicious negated left operand of in operator.
67+
while ( k < len && ! k in t ) k++;
68+
^
69+
70+
build/autobahn.js:866: WARNING - Suspicious negated left operand of in operator.
71+
while ( k >= 0 && ! k in t ) k--;
72+
^
73+
74+
build/autobahn.js:6098: WARNING - Suspicious code. The result of the 'getprop' operator is not being used.
75+
array.byteLength // this throws if `array` is not a valid ArrayBuffer
76+
^
77+
78+
build/autobahn.js:15857: WARNING - Suspicious code. The result of the 'not' operator is not being used.
79+
!function(exports) {
80+
^
81+
82+
0 error(s), 4 warning(s)
83+
gzipper(["build/autobahn.min.jgz"], ["build/autobahn.min.js"])
84+
checksumsMD5(["build/CHECKSUM.MD5"], ["build/autobahn.js", "build/autobahn.min.js", "build/autobahn.min.jgz"])
85+
checksumsSHA1(["build/CHECKSUM.SHA1"], ["build/autobahn.js", "build/autobahn.min.js", "build/autobahn.min.jgz"])
86+
checksumsSHA256(["build/CHECKSUM.SHA256"], ["build/autobahn.js", "build/autobahn.min.js", "build/autobahn.min.jgz"])
87+
Copy("build/LICENSE", "LICENSE")
88+
scons: done building targets.
89+
```
90+
91+
This should produce the following build artifacts:
92+
93+
```console
94+
(cpy2712_1) oberstet@office-corei7:~/scm/crossbario/autobahn-js$ ls -la build/
95+
insgesamt 896
96+
drwxrwxr-x 2 oberstet oberstet 4096 Nov 15 10:51 .
97+
drwxrwxr-x 7 oberstet oberstet 4096 Nov 15 10:51 ..
98+
-rw-rw-r-- 1 oberstet oberstet 573208 Nov 15 10:51 autobahn.js
99+
-rw-rw-r-- 1 oberstet oberstet 58009 Nov 15 10:51 autobahn.min.jgz
100+
-rw-rw-r-- 1 oberstet oberstet 198906 Nov 15 10:51 autobahn.min.js
101+
-rw-rw-r-- 1 oberstet oberstet 168 Nov 15 10:51 CHECKSUM.MD5
102+
-rw-rw-r-- 1 oberstet oberstet 195 Nov 15 10:51 CHECKSUM.SHA1
103+
-rw-rw-r-- 1 oberstet oberstet 273 Nov 15 10:51 CHECKSUM.SHA256
104+
-rw-rw-r-- 1 oberstet oberstet 1086 Nov 15 10:46 LICENSE
105+
```

DEVELOPERS.md doc/releasesteps.md

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
## Google Closure
2-
3-
For building the browser version of AutobahnJS, you will need the [Google Closure Compiler](https://developers.google.com/closure/compiler/index).
4-
5-
Download from [here](https://dl.google.com/closure-compiler/compiler-latest.zip).
6-
7-
cd ~
8-
wget https://dl.google.com/closure-compiler/compiler-latest.zip
9-
unzip -o compiler-latest.zip
10-
11-
Set `$JS_COMPILER` to `${HOME}/compiler.jar`.
12-
1+
# Releasing Autobahn|JS
132

143
## Release Steps
154

0 commit comments

Comments
 (0)