Commit 61ac26af by Dane Springmeyer

add test for node-webkit

parent a3bfb4c2
...@@ -76,7 +76,12 @@ After the `sqlite3` module is installed (according to the previous section), d ...@@ -76,7 +76,12 @@ After the `sqlite3` module is installed (according to the previous section), d
1. Install [`nw-gyp`](https://github.com/rogerwang/nw-gyp) globally: `npm install nw-gyp -g` *(unless already installed)* 1. Install [`nw-gyp`](https://github.com/rogerwang/nw-gyp) globally: `npm install nw-gyp -g` *(unless already installed)*
2. Use `nw-gyp` to rebuild the module: `nw-gyp rebuild --target=0.6.2` 2. Use `nw-gyp` to rebuild the module:
```
NODE_WEBKIT_VERSION="0.8.4" # see latest version at https://github.com/rogerwang/node-webkit#downloads
nw-gyp rebuild --target=${NODE_WEBKIT_VERSION}
```
Remember the following: Remember the following:
......
node-webkit.app
node-webkit-v0.8.4-osx-ia32.zip
node_modules
\ No newline at end of file
NODE_WEBKIT_VERSION=0.8.4
all: app.nw
node_modules/sqlite3:
npm install https://github.com/mapbox/node-sqlite3/tarball/master
node_modules/sqlite3/lib/node_sqlite3.node: node_modules/sqlite3
cd node_modules/sqlite3 && nw-gyp rebuild --target=$(NODE_WEBKIT_VERSION) && rm -rf build/
node-webkit-v$(NODE_WEBKIT_VERSION)-osx-ia32.zip:
wget https://s3.amazonaws.com/node-webkit/v$(NODE_WEBKIT_VERSION)/node-webkit-v$(NODE_WEBKIT_VERSION)-osx-ia32.zip
./node-webkit.app: node-webkit-v$(NODE_WEBKIT_VERSION)-osx-ia32.zip
unzip -o node-webkit-v$(NODE_WEBKIT_VERSION)-osx-ia32.zip
app.nw: ./node-webkit.app Makefile package.json index.html node_modules/sqlite3/lib/node_sqlite3.node
zip app.nw index.html package.json node_modules
test: ./node-webkit.app app.nw
./node-webkit.app/Contents/MacOS/node-webkit app.nw
package: ./node-webkit.app Makefile package.json index.html node_modules/sqlite3
rm -rf node-sqlite-test.app
cp -r ./node-webkit.app node-sqlite-test.app
mkdir ./node-sqlite-test.app/Contents/Resources/app.nw/
cp package.json ./node-sqlite-test.app/Contents/Resources/app.nw/
cp index.html ./node-sqlite-test.app/Contents/Resources/app.nw/
cp -r node_modules/ ./node-sqlite-test.app/Contents/Resources/app.nw/
./node-sqlite-test.app/Contents/MacOS/node-webkit
clean:
rm -rf ./node_modules/sqlite3/build
rm -f ./node_modules/sqlite3/lib/node_sqlite3.node
rm -f ./app.nw
rm -rf node-sqlite-test.app
rm -f credits.html
rm -f nwsnapshot
.PHONY: test
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
Using node-sqlite3:
<script>
var sqlite = require('sqlite3');
document.write(sqlite.VERSION);
</script>.
</body>
</html>
\ No newline at end of file
{
"name": "nw-demo",
"main": "index.html",
"window": {
"toolbar": false,
"width": 800,
"height": 600
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment