forked from crossbario/autobahn-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request crossbario#240 from oberstet/reorg_repo
Reorg repo
- Loading branch information
Showing
94 changed files
with
121 additions
and
15,653 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ node_modules | |
*.pyc | ||
*.pid | ||
.idea/ | ||
.*.swp | ||
.lock-* | ||
package/.crossbar/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,105 @@ | ||
# Building Autobahn|JS | ||
|
||
To build **Autobahn|JS** for use in browsers, you will need | ||
The following describes how to build and publish **Autobahn|JS** for browser and Node. | ||
|
||
- [Node.js](http://nodejs.org/) | ||
- [Google Closure Compiler](http://dl.google.com/closure-compiler/compiler-latest.zip) | ||
- [SCons](http://www.scons.org/) | ||
- [Taschenmesser](https://github.com/oberstet/taschenmesser) | ||
- [browserify](http://browserify.org/) | ||
- [ws](http://websockets.github.io/ws/) | ||
- [crypto-js](https://www.npmjs.org/package/crypto-js) | ||
|
||
**Install NodeJS** | ||
## Build environment (browser build) | ||
|
||
*on Windows* | ||
Install [Node.js](http://nodejs.org/) | ||
|
||
Download the installer from [the NodeJS website](http://nodejs.org/download/). | ||
sudo apt-get install -y nodejs nodejs-legacy npm | ||
|
||
*on Ubuntu* | ||
Install [browserify](http://browserify.org/) | ||
|
||
sudo apt-get install nodejs nodejs-legacy npm | ||
sudo npm install -g browserify nodeunit | ||
|
||
SCons is a Python based build tool, so you will need [Python](http://python.org/) as well. | ||
Install Python tools (preferrably into a dedicated virtualenv) | ||
|
||
**Install Taschenmesser**, a SCons toolbelt also written in Python | ||
pip install -U scons boto scour taschenmesser | ||
|
||
*on Windows* | ||
Install Java JDK | ||
|
||
pip install --upgrade taschenmesser[aws,svg] | ||
sudo apt install -y openjdk-8-jdk | ||
|
||
*on Ubuntu* | ||
Install [Google Closure Compiler](https://developers.google.com/closure/compiler/) | ||
|
||
sudo pip install --upgrade taschenmesser[aws,svg] | ||
cd ~ | ||
rm -f compiler-latest.zip | ||
wget https://dl.google.com/closure-compiler/compiler-latest.zip | ||
unzip -o compiler-latest.zip | ||
|
||
**Set environment variables** | ||
This will produce a file like `closure-compiler-v20161024.jar` in your `$HOME`. | ||
|
||
*on Windows* | ||
Install library dependencies | ||
|
||
1. `JAVA_HOME` pointing to your Java run-time | ||
sudo npm install -g ws when crypto-js msgpack-lite utf-8-validate | ||
|
||
C:\Program Files\Java\jre7 | ||
Set environment variables (add that to `$HOME/.profile`): | ||
|
||
1. Add Python and Python script to `PATH` | ||
|
||
C:\Python27;C:\Python27\Scripts; | ||
|
||
1. Set `JS_COMPILER` pointing to the Google Closure `compiler.jar` | ||
|
||
C:\Program Files\Google Closure\compiler.jar | ||
|
||
*on Ubuntu* | ||
|
||
export JS_COMPILER=$HOME/compiler.jar | ||
export JS_COMPILER=$HOME/closure-compiler-v20161024.jar | ||
export JAVA_HOME=/usr/lib/jvm/default-java | ||
export NODE_PATH=/usr/local/lib/node_modules/ | ||
|
||
**Clone the Autobahn|JS repo** | ||
|
||
git clone [email protected]:tavendo/AutobahnJS.git | ||
cd autobahnjs | ||
|
||
**Install JavaScript dependencies in NodeJS** | ||
## Building for browsers | ||
|
||
npm install ws when crypto-js | ||
|
||
**Start the build**: | ||
To start the build: | ||
|
||
scons | ||
|
||
> **note** | ||
> | ||
> When using a bash shell under Windows (e.g. git shell), use 'scons.py'. | ||
**You get 3 files inside the** `build` **directory** | ||
|
||
build/autobahn.js | ||
build/autobahn.min.js | ||
build/autobahn.min.jgz | ||
|
||
To **clean up your build** (i.e. remove previously created files): | ||
To clean up your build: | ||
|
||
scons -uc | ||
|
||
Here is a typical build output (*some* warnings are "ok" - they come from dependencies we don't control): | ||
|
||
|
||
```console | ||
(cpy2712_1) oberstet@office-corei7:~/scm/crossbario/autobahn-js$ scons | ||
scons: Reading SConscript files ... | ||
Building AutobahnJS 0.11.0 | ||
scons: done reading SConscript files. | ||
scons: Building targets ... | ||
browserify lib/autobahn.js --standalone autobahn -o build/autobahn.js | ||
js_builder(["build/autobahn.min.js"], ["build/autobahn.js"]) | ||
java -jar /home/oberstet/closure-compiler-v20161024.jar --compilation_level SIMPLE_OPTIMIZATIONS --js build/autobahn.js --js_output_file build/autobahn.min.js | ||
build/autobahn.js:772: WARNING - Suspicious negated left operand of in operator. | ||
while ( k < len && ! k in t ) k++; | ||
^ | ||
|
||
build/autobahn.js:866: WARNING - Suspicious negated left operand of in operator. | ||
while ( k >= 0 && ! k in t ) k--; | ||
^ | ||
|
||
build/autobahn.js:6098: WARNING - Suspicious code. The result of the 'getprop' operator is not being used. | ||
array.byteLength // this throws if `array` is not a valid ArrayBuffer | ||
^ | ||
|
||
build/autobahn.js:15857: WARNING - Suspicious code. The result of the 'not' operator is not being used. | ||
!function(exports) { | ||
^ | ||
|
||
0 error(s), 4 warning(s) | ||
gzipper(["build/autobahn.min.jgz"], ["build/autobahn.min.js"]) | ||
checksumsMD5(["build/CHECKSUM.MD5"], ["build/autobahn.js", "build/autobahn.min.js", "build/autobahn.min.jgz"]) | ||
checksumsSHA1(["build/CHECKSUM.SHA1"], ["build/autobahn.js", "build/autobahn.min.js", "build/autobahn.min.jgz"]) | ||
checksumsSHA256(["build/CHECKSUM.SHA256"], ["build/autobahn.js", "build/autobahn.min.js", "build/autobahn.min.jgz"]) | ||
Copy("build/LICENSE", "LICENSE") | ||
scons: done building targets. | ||
``` | ||
|
||
This should produce the following build artifacts: | ||
|
||
```console | ||
(cpy2712_1) oberstet@office-corei7:~/scm/crossbario/autobahn-js$ ls -la build/ | ||
insgesamt 896 | ||
drwxrwxr-x 2 oberstet oberstet 4096 Nov 15 10:51 . | ||
drwxrwxr-x 7 oberstet oberstet 4096 Nov 15 10:51 .. | ||
-rw-rw-r-- 1 oberstet oberstet 573208 Nov 15 10:51 autobahn.js | ||
-rw-rw-r-- 1 oberstet oberstet 58009 Nov 15 10:51 autobahn.min.jgz | ||
-rw-rw-r-- 1 oberstet oberstet 198906 Nov 15 10:51 autobahn.min.js | ||
-rw-rw-r-- 1 oberstet oberstet 168 Nov 15 10:51 CHECKSUM.MD5 | ||
-rw-rw-r-- 1 oberstet oberstet 195 Nov 15 10:51 CHECKSUM.SHA1 | ||
-rw-rw-r-- 1 oberstet oberstet 273 Nov 15 10:51 CHECKSUM.SHA256 | ||
-rw-rw-r-- 1 oberstet oberstet 1086 Nov 15 10:46 LICENSE | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.