diff --git a/.gitignore b/.gitignore index b25ec853a..16ecd65e1 100644 --- a/.gitignore +++ b/.gitignore @@ -41,11 +41,10 @@ lib/* js/copayBundle.js -webapp/copay-webapp -webapp/download -chrome/copay-chrome-extension -chrome/copay-chrome-extension.zip -firefox/firefox-addon +webapp +browser-extensions/chrome/copay-chrome-extension +browser-extensions/chrome/copay-chrome-extension.zip +browser-extensions/firefox/firefox-addon version.js android/package diff --git a/chrome/README.md b/browser-extensions/chrome/README.md similarity index 100% rename from chrome/README.md rename to browser-extensions/chrome/README.md diff --git a/chrome/build.sh b/browser-extensions/chrome/build.sh similarity index 78% rename from chrome/build.sh rename to browser-extensions/chrome/build.sh index f56db58d0..a8c17c2f8 100644 --- a/chrome/build.sh +++ b/browser-extensions/chrome/build.sh @@ -20,7 +20,7 @@ checkOK() { BUILDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" APPDIR="$BUILDDIR/copay-chrome-extension" ZIPFILE="copay-chrome-extension.zip" -VERSION=`cut -d '"' -f2 $BUILDDIR/../version.js` +VERSION=`cut -d '"' -f2 $BUILDDIR/../../version.js` # Move to the build directory cd $BUILDDIR @@ -43,14 +43,17 @@ echo "${OpenColor}${Green}* Copying all chrome-extension files...${CloseColor}" sed "s/APP_VERSION/$VERSION/g" manifest.json > $APPDIR/manifest.json checkOK -cd $BUILDDIR/.. -cp -af {css,font,img,js,lib,sound,config.js,version.js,index.html,./popup.html} $APPDIR +INCLUDE=`cat ../include` +cd $BUILDDIR/../.. +CMD="rsync -rLRv --exclude-from $BUILDDIR/../exclude $INCLUDE $APPDIR" +echo $CMD +$CMD checkOK # Zipping chrome-extension echo "${OpenColor}${Green}* Zipping all chrome-extension files...${CloseColor}" cd $BUILDDIR -zip -r $ZIPFILE "`basename $APPDIR`" +zip -qr $ZIPFILE "`basename $APPDIR`" checkOK -echo "${OpenColor}${Yellow}\nAwesome! We have a brand new Chome Extension, enjoy it!${CloseColor}" +echo "${OpenColor}${Yellow}\nThe chrome Chome Extension is ready at $BUILDDIR.${CloseColor}" diff --git a/chrome/manifest.json b/browser-extensions/chrome/manifest.json similarity index 100% rename from chrome/manifest.json rename to browser-extensions/chrome/manifest.json diff --git a/browser-extensions/exclude b/browser-extensions/exclude new file mode 100644 index 000000000..80d4b5483 --- /dev/null +++ b/browser-extensions/exclude @@ -0,0 +1,18 @@ +lib/socket.io +lib/*/test +lib/*/demo +lib/sjcl/ +lib/angular/angular.js +lib/moment/lang +lib/moment/min/*lang* +lib/moment/moment.js +lib/angular/angular.min.js.gzip +lib/bitcore/node_modules +lib/bitcore/.git +lib/bitcore/docs +lib/bitcore/lib +lib/bitcore/examples +lib/bitcore/coverage +lib/bitcore/build +.git +tests diff --git a/firefox/README.md b/browser-extensions/firefox/README.md similarity index 100% rename from firefox/README.md rename to browser-extensions/firefox/README.md diff --git a/firefox/build.sh b/browser-extensions/firefox/build.sh similarity index 100% rename from firefox/build.sh rename to browser-extensions/firefox/build.sh diff --git a/firefox/lib/main.js b/browser-extensions/firefox/lib/main.js similarity index 100% rename from firefox/lib/main.js rename to browser-extensions/firefox/lib/main.js diff --git a/firefox/package.json b/browser-extensions/firefox/package.json similarity index 100% rename from firefox/package.json rename to browser-extensions/firefox/package.json diff --git a/browser-extensions/include b/browser-extensions/include new file mode 100644 index 000000000..eee36fd98 --- /dev/null +++ b/browser-extensions/include @@ -0,0 +1,22 @@ +css font img js sound config.js version.js index.html popup.html + lib/mousetrap/mousetrap.min.js + js/shell.js + lib/angular/angular-csp.css + lib/angular/angular.min.js + lib/moment/min/moment.min.js + lib/angular-moment/angular-moment.js + lib/qrcode-generator/js/qrcode.js + lib/angular-qrcode/qrcode.js + lib/angular-route/angular-route.min.js + lib/angular-foundation/mm-foundation.min.js + lib/angular-foundation/mm-foundation-tpls.min.js + lib/peerjs/peer.min.js + lib/bitcore/browser/bundle.js + lib/crypto-js/rollups/sha256.js + lib/crypto-js/rollups/pbkdf2.js + lib/crypto-js/rollups/aes.js + lib/file-saver/FileSaver.js + lib/socket.io-client/socket.io.js + lib/sjcl.js + lib/ios-imagefile-megapixel/megapix-image.js + lib/qrcode-decoder-js/lib/qrcode-decoder.min.js diff --git a/index.html b/index.html index bd3604958..d7fb6afe7 100644 --- a/index.html +++ b/index.html @@ -915,7 +915,7 @@ on supported browsers please check http://www.w - + diff --git a/package.json b/package.json index 7b824cbc0..03b577f2d 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "test": "node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter spec test", "shell": "node shell/scripts/launch.js", - "setup-shell": "node shell/scripts/download-atom-shell.js" + "setup-shell": "node shell/scripts/download-atom-shell.js", + "chrome": "source browser-extensions/chrome/build.sh" }, "homepage": "https://github.com/bitpay/copay", "devDependencies": {