diff --git a/Gruntfile.js b/Gruntfile.js index 01406f682..3dfa69460 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,7 +14,7 @@ module.exports = function(grunt) { command: 'rm -Rf bower_components node_modules' }, osx: { - command: 'webkitbuilds/build-osx.sh' + command: 'webkitbuilds/build-osx.sh sign' } }, watch: { @@ -218,5 +218,6 @@ module.exports = function(grunt) { grunt.registerTask('translate', ['nggettext_extract']); grunt.registerTask('test', ['karma:unit']); grunt.registerTask('test-coveralls', ['karma:prod', 'coveralls']); - grunt.registerTask('desktop', ['prod', 'nodewebkit', 'copy:linux', 'compress:linux', 'exec:osx']); + grunt.registerTask('desktop', ['prod', 'nodewebkit', 'copy:linux', 'compress:linux']); + grunt.registerTask('osx', ['prod', 'nodewebkit', 'exec:osx']); }; diff --git a/webkitbuilds/build-osx.sh b/webkitbuilds/build-osx.sh index 749c763a2..5563f90eb 100755 --- a/webkitbuilds/build-osx.sh +++ b/webkitbuilds/build-osx.sh @@ -1,5 +1,11 @@ #!/bin/bash +SHOULD_SIGN=$1 +if [ "$SHOULD_SIGN" ] +then + echo "Will sign the APP" +fi + # by Andy Maloney # http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/ @@ -55,6 +61,26 @@ SIZE=150 if [ $? -ne 0 ]; then echo "Error: Cannot compute size of staging dir" exit + fi + +# Sign Code (MATIAS) +if [ $SHOULD_SIGN ] +then + echo "Signing Copay DMG" + + export IDENTITY="3rd Party Mac Developer Application: BitPay, Inc. (884JRH5R93)" + + # not need for 'out of app store' distribution (?) +# export PARENT_PLIST=parent.plist +# export CHILD_PLIST=child.plist + export APP_PATH=${STAGING_DIR}/${APP_NAME}.app + + codesign --deep -s "${IDENTITY}" $APP_PATH"/Contents/Frameworks/nwjs Helper.app" && echo "Sign 1" + codesign --deep -s "${IDENTITY}" $APP_PATH"/Contents/Frameworks/nwjs Helper EH.app" && echo "Sign 2" + codesign --deep -s "${IDENTITY}" $APP_PATH"/Contents/Frameworks/nwjs Helper NP.app" && echo "Sign 3" + codesign --deep -s "${IDENTITY}" $APP_PATH && echo "Sign 4" + echo "Signing Done" + fi # create the temp DMG file