diff --git a/README.md b/README.md new file mode 100644 index 00000000..6765ff80 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# About GridTracker + +# Developing GridTracker + +GridTracker runs using [NWJS](https://nwjs.io/), a tools that wraps both Chrome windows and node processes into a native application. + +To work on GridTracker you need to clone this git repository and then invoke NWJS with the contents of `package.nw`. + +NWJS comes in two flavors, "normal" and "sdk". GridTracker is distributed with the normal flavor, but for development work +we recommend the SDK flavor because it provides access to Chrome's Developer Tools, among other things. + +## Developing on Windows + +To access the Developer Tools, right-click on an unused area of a window, or press F12. + +## Developing on Linux + +To access the Developer Tools, right-click on an unused area of a window, or press F12. + +## Developing on Mac + +We suggest using the `macos/run.sh` script to launch GridTracker while developing. It will download the sdk flavor of NWJS if needed, +and use it to run the app. + +To access the Developer Tools, right-click on an unused area of a window, or press F12. diff --git a/macos/run.sh b/macos/run.sh index 62c28900..4431973c 100755 --- a/macos/run.sh +++ b/macos/run.sh @@ -1,16 +1,21 @@ NWJS_VERSION=0.49.0 +NWJS_FULL_NAME=nwjs-sdk-v$NWJS_VERSION-osx-x64 -if [ ! -e build/macos/nwjs-v$NWJS_VERSION-osx-x64/nwjs.app ]; then - echo "Downloading NWJS $NWJS_VERSION" +if [ ! -e build/macos/$NWJS_FULL_NAME/nwjs.app ]; then + echo "Downloading NWJS $NWJS_VERSION ($NWJS_FULL_NAME)" mkdir -p build/macos cd build/macos - curl -O https://dl.nwjs.io/v$NWJS_VERSION/nwjs-v$NWJS_VERSION-osx-x64.zip - unzip nwjs-v$NWJS_VERSION-osx-x64.zip + curl -O https://dl.nwjs.io/v$NWJS_VERSION/$NWJS_FULL_NAME.zip + unzip $NWJS_FULL_NAME.zip cd ../.. fi +# Disable `product_string` before running nwjs (see https://github.com/nwjs/nw.js/issues/7253) sed -i "" -e s/\"product_string\"/\"ignore_product_string\"/g package.nw/package.json -build/macos/nwjs-v$NWJS_VERSION-osx-x64/nwjs.app/Contents/MacOS/nwjs ./package.nw +# Give time (15 seconds) for nwjs to start and then restore `product_string` +( sleep 15 ; sed -i "" -e s/\"ignore_product_string\"/\"product_string\"/g package.nw/package.json ) & + +build/macos/$NWJS_FULL_NAME/nwjs.app/Contents/MacOS/nwjs ./package.nw + -sed -i "" -e s/\"ignore_product_string\"/\"product_string\"/g package.nw/package.json diff --git a/package.nw/GridTracker.html b/package.nw/GridTracker.html index 83238cd2..821997db 100644 --- a/package.nw/GridTracker.html +++ b/package.nw/GridTracker.html @@ -153,7 +153,7 @@