Permalink
Browse files

more cleanups

  • Loading branch information...
oberstet committed Nov 15, 2016
1 parent 61e6d60 commit 902b14574829d940c562674e98bd015c19ebdf8f
Showing with 63 additions and 61 deletions.
  1. +1 −1 LICENSE.md → LICENSE
  2. +1 −1 SConstruct
  3. +0 −9 copy2crossbar.py
  4. +60 −38 doc/building.md
  5. +1 −12 DEVELOPERS.md → doc/releasesteps.md
View
@@ -1,4 +1,4 @@
Copyright (C) Tavendo GmbH and contributors.
Copyright (C) Crossbar.io Technologies GmbH and contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
View
@@ -50,7 +50,7 @@ checksums.append(env.SHA256("build/CHECKSUM.SHA256", artifacts))
# fixed static files to be included
statics = []
for f in ["LICENSE.md"]:
for f in ["LICENSE"]:
statics.append(Command("build/{}".format(f), [], Copy("$TARGET", f)))
# The default target consists of all artifacts that
View
@@ -1,9 +0,0 @@
import os
import re
import shutil
for r, d, files in os.walk("../../crossbar/crossbar/crossbar/crossbar/templates/"):
for f in files:
if f == "autobahn.min.js":
fn = os.path.normpath(os.path.join(r, f))
shutil.copyfile("build/autobahn.min.js", fn)
View
@@ -1,23 +1,15 @@
# 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)
## Installing build requirements
## Build environment (browser build)
Install [Node.js](http://nodejs.org/)
sudo apt-get install -y nodejs nodejs-legacy npm
Install browserify
Install [browserify](http://browserify.org/)
sudo npm install -g browserify
@@ -29,7 +21,7 @@ Install Java JDK
sudo apt install -y openjdk-8-jdk
Install
Install [Google Closure Compiler](https://developers.google.com/closure/compiler/)
cd ~
rm -f compiler-latest.zip
@@ -49,35 +41,65 @@ Set environment variables (add that to `$HOME/.profile`):
export NODE_PATH=/usr/local/lib/node_modules/
## Building for browsers
**Clone the Autobahn|JS repo**
git clone git@github.com:tavendo/AutobahnJS.git
cd autobahnjs
**Install JavaScript dependencies in NodeJS**
npm install ws when crypto-js msgpack-lite utf-8-validate
**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
```
@@ -1,15 +1,4 @@
## Google Closure
For building the browser version of AutobahnJS, you will need the [Google Closure Compiler](https://developers.google.com/closure/compiler/index).
Download from [here](https://dl.google.com/closure-compiler/compiler-latest.zip).
cd ~
wget https://dl.google.com/closure-compiler/compiler-latest.zip
unzip -o compiler-latest.zip
Set `$JS_COMPILER` to `${HOME}/compiler.jar`.
# Releasing Autobahn|JS
## Release Steps

0 comments on commit 902b145

Please sign in to comment.