Fix build macos
This commit is contained in:
parent
ed22f5b501
commit
e50d5123aa
7 changed files with 20 additions and 164 deletions
27
Gruntfile.js
27
Gruntfile.js
|
|
@ -6,6 +6,7 @@ module.exports = function(grunt) {
|
||||||
|
|
||||||
// Project Configuration
|
// Project Configuration
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
exec: {
|
exec: {
|
||||||
appConfig: {
|
appConfig: {
|
||||||
command: 'node ./util/buildAppConfig.js'
|
command: 'node ./util/buildAppConfig.js'
|
||||||
|
|
@ -19,8 +20,8 @@ module.exports = function(grunt) {
|
||||||
cordovaclean: {
|
cordovaclean: {
|
||||||
command: 'make -C cordova clean'
|
command: 'make -C cordova clean'
|
||||||
},
|
},
|
||||||
osx: {
|
macos: {
|
||||||
command: 'webkitbuilds/build-macos.sh sign'
|
command: 'sh webkitbuilds/build-macos.sh sign'
|
||||||
},
|
},
|
||||||
coveralls: {
|
coveralls: {
|
||||||
command: 'cat coverage/report-lcov/lcov.info |./node_modules/coveralls/bin/coveralls.js'
|
command: 'cat coverage/report-lcov/lcov.info |./node_modules/coveralls/bin/coveralls.js'
|
||||||
|
|
@ -60,10 +61,10 @@ module.exports = function(grunt) {
|
||||||
stdin: true,
|
stdin: true,
|
||||||
},
|
},
|
||||||
desktopsign: {
|
desktopsign: {
|
||||||
cmd: 'gpg -u 1112CFA1 --output webkitbuilds/Copay-linux.zip.sig --detach-sig webkitbuilds/Copay-linux.zip && gpg -u 1112CFA1 --output webkitbuilds/Copay-win.exe.sig --detach-sig webkitbuilds/Copay-win.exe'
|
cmd: 'gpg -u 1112CFA1 --output webkitbuilds/<%= pkg.title %>-linux.zip.sig --detach-sig webkitbuilds/<%= pkg.title %>-linux.zip && gpg -u 1112CFA1 --output webkitbuilds/<%= pkg.title %>-win.exe.sig --detach-sig webkitbuilds/<%= pkg.title %>-win.exe'
|
||||||
},
|
},
|
||||||
desktopverify: {
|
desktopverify: {
|
||||||
cmd: 'gpg --verify webkitbuilds/Copay-linux.zip.sig webkitbuilds/Copay-linux.zip && gpg --verify webkitbuilds/Copay-win.exe.sig webkitbuilds/Copay-win.exe'
|
cmd: 'gpg --verify webkitbuilds/<%= pkg.title %>-linux.zip.sig webkitbuilds/<%= pkg.title %>-linux.zip && gpg --verify webkitbuilds/<%= pkg.title %>-win.exe.sig webkitbuilds/<%= pkg.title %>-win.exe'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -209,8 +210,8 @@ module.exports = function(grunt) {
|
||||||
files: [{
|
files: [{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'webkitbuilds/',
|
cwd: 'webkitbuilds/',
|
||||||
src: ['.desktop', '../www/img/icons/favicon.ico', '../www/img/icons/512x512.png'],
|
src: ['.desktop', '../www/img/app/favicon.ico', '../www/img/app/512x512.png'],
|
||||||
dest: 'webkitbuilds/Copay/linux64/',
|
dest: 'webkitbuilds/<%= pkg.title %>/linux64/',
|
||||||
flatten: true,
|
flatten: true,
|
||||||
filter: 'isFile'
|
filter: 'isFile'
|
||||||
}],
|
}],
|
||||||
|
|
@ -218,24 +219,24 @@ module.exports = function(grunt) {
|
||||||
},
|
},
|
||||||
nwjs: {
|
nwjs: {
|
||||||
options: {
|
options: {
|
||||||
appName: 'Copay',
|
appName: '<%= pkg.title %>',
|
||||||
platforms: ['win64', 'osx64', 'linux64'],
|
platforms: ['win64', 'osx64', 'linux64'],
|
||||||
buildDir: './webkitbuilds',
|
buildDir: './webkitbuilds',
|
||||||
version: '0.16.0',
|
version: '0.16.0',
|
||||||
macIcns: './www/img/icons/logo.icns',
|
macIcns: './www/img/app/logo.icns',
|
||||||
exeIco: './www/img/icons/logo.ico'
|
exeIco: './www/img/app/logo.ico'
|
||||||
},
|
},
|
||||||
src: ['./package.json', './www/**/*']
|
src: ['./package.json', './www/**/*']
|
||||||
},
|
},
|
||||||
compress: {
|
compress: {
|
||||||
linux: {
|
linux: {
|
||||||
options: {
|
options: {
|
||||||
archive: './webkitbuilds/Copay-linux.zip'
|
archive: './webkitbuilds/<%= pkg.title %>-linux.zip'
|
||||||
},
|
},
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: './webkitbuilds/Copay/linux64/',
|
cwd: './webkitbuilds/<%= pkg.title %>/linux64/',
|
||||||
src: ['**/*'],
|
src: ['**/*'],
|
||||||
dest: 'copay-linux/'
|
dest: '<%= pkg.title %>-linux/'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
browserify: {
|
browserify: {
|
||||||
|
|
@ -252,7 +253,7 @@ module.exports = function(grunt) {
|
||||||
grunt.registerTask('prod', ['default', 'uglify']);
|
grunt.registerTask('prod', ['default', 'uglify']);
|
||||||
grunt.registerTask('translate', ['nggettext_extract']);
|
grunt.registerTask('translate', ['nggettext_extract']);
|
||||||
grunt.registerTask('desktop', ['prod', 'nwjs', 'copy:linux', 'compress:linux']);
|
grunt.registerTask('desktop', ['prod', 'nwjs', 'copy:linux', 'compress:linux']);
|
||||||
grunt.registerTask('osx', ['prod', 'nwjs', 'exec:osx']);
|
grunt.registerTask('macos', ['prod', 'nwjs', 'exec:macos']);
|
||||||
grunt.registerTask('chrome', ['exec:chrome']);
|
grunt.registerTask('chrome', ['exec:chrome']);
|
||||||
grunt.registerTask('wp', ['prod', 'exec:wp']);
|
grunt.registerTask('wp', ['prod', 'exec:wp']);
|
||||||
grunt.registerTask('wp-copy', ['default', 'exec:wpcopy']);
|
grunt.registerTask('wp-copy', ['default', 'exec:wpcopy']);
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 148 KiB |
|
|
@ -17,7 +17,7 @@ fi
|
||||||
|
|
||||||
# set up your app name, architecture, and background image file name
|
# set up your app name, architecture, and background image file name
|
||||||
APP_NAME="*USERVISIBLENAME*"
|
APP_NAME="*USERVISIBLENAME*"
|
||||||
DMG_BACKGROUND_IMG="../www/img/Background.png"
|
DMG_BACKGROUND_IMG="Background.png"
|
||||||
|
|
||||||
PATH_NAME="${APP_NAME}/osx64/"
|
PATH_NAME="${APP_NAME}/osx64/"
|
||||||
# you should not need to change these
|
# you should not need to change these
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
"bitcore"
|
"bitcore"
|
||||||
],
|
],
|
||||||
"main": "www/index.html",
|
"main": "www/index.html",
|
||||||
|
"title": "*USERVISIBLENAME*",
|
||||||
"window": {
|
"window": {
|
||||||
"title": "*USERVISIBLENAME* - *PURPOSELINE*",
|
"title": "*USERVISIBLENAME* - *PURPOSELINE*",
|
||||||
"icon": "www/img/icons/logo.ico",
|
"icon": "www/img/icons/logo.ico",
|
||||||
|
|
@ -80,7 +81,6 @@
|
||||||
"start": "npm run build:www && ionic serve --nolivereload --nogulp -s",
|
"start": "npm run build:www && ionic serve --nolivereload --nogulp -s",
|
||||||
"start:ios": "npm run build:www && npm run build:ios && npm run open:ios",
|
"start:ios": "npm run build:www && npm run build:ios && npm run open:ios",
|
||||||
"start:android": "npm run build:www && npm run build:android && npm run run:android",
|
"start:android": "npm run build:www && npm run build:android && npm run run:android",
|
||||||
"start:desktop": "grunt desktop",
|
|
||||||
"watch": "grunt watch",
|
"watch": "grunt watch",
|
||||||
"build:www": "grunt",
|
"build:www": "grunt",
|
||||||
"build:www-release": "grunt prod",
|
"build:www-release": "grunt prod",
|
||||||
|
|
@ -88,12 +88,13 @@
|
||||||
"build:android": "cordova prepare android && cordova build android --debug",
|
"build:android": "cordova prepare android && cordova build android --debug",
|
||||||
"build:ios-release": "cordova prepare ios && cordova build ios --release",
|
"build:ios-release": "cordova prepare ios && cordova build ios --release",
|
||||||
"build:android-release": "cordova prepare android && cordova build android --release",
|
"build:android-release": "cordova prepare android && cordova build android --release",
|
||||||
|
"build:desktop": "grunt desktop",
|
||||||
|
"build:macos": "grunt macos",
|
||||||
"open:ios": "open platforms/ios/*.xcodeproj",
|
"open:ios": "open platforms/ios/*.xcodeproj",
|
||||||
"open:android": "open -a open -a /Applications/Android\\ Studio.app platforms/android",
|
"open:android": "open -a open -a /Applications/Android\\ Studio.app platforms/android",
|
||||||
"final:www": "npm run build:www-release",
|
"final:www": "npm run build:www-release",
|
||||||
"final:ios": "npm run final:www && npm run build:ios-release && npm run open:ios",
|
"final:ios": "npm run final:www && npm run build:ios-release && npm run open:ios",
|
||||||
"final:android": "npm run final:www && npm run build:android-release && npm run run:android",
|
"final:android": "npm run final:www && npm run build:android-release && npm run run:android",
|
||||||
"final:desktop": "grunt desktop",
|
|
||||||
"run:android": "cordova run android --device",
|
"run:android": "cordova run android --device",
|
||||||
"log:android": "adb logcat | grep chromium",
|
"log:android": "adb logcat | grep chromium",
|
||||||
"apply:copay": "cd app-template && node apply.js copay && cordova prepare",
|
"apply:copay": "cd app-template && node apply.js copay && cordova prepare",
|
||||||
|
|
|
||||||
|
|
@ -893,7 +893,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService, scannerService) {
|
.run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, $window, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService, scannerService) {
|
||||||
|
|
||||||
uxLanguage.init();
|
uxLanguage.init();
|
||||||
openURLService.init();
|
openURLService.init();
|
||||||
|
|
@ -1005,7 +1005,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
type: "menubar"
|
type: "menubar"
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
nativeMenuBar.createMacBuiltin("Copay");
|
nativeMenuBar.createMacBuiltin($window.appConfig.nameCase);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
$log.debug('This is not OSX');
|
$log.debug('This is not OSX');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 29 B |
1
webkitbuilds/Background.png
Symbolic link
1
webkitbuilds/Background.png
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
../www/img/app/Background.png
|
||||||
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 29 B |
|
|
@ -1,146 +0,0 @@
|
||||||
#!/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/
|
|
||||||
|
|
||||||
# make sure we are in the correct dir when we double-click a .command file
|
|
||||||
dir=${0%/*}
|
|
||||||
if [ -d "$dir" ]; then
|
|
||||||
cd "$dir"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set up your app name, architecture, and background image file name
|
|
||||||
APP_NAME="Copay"
|
|
||||||
DMG_BACKGROUND_IMG="Background.png"
|
|
||||||
|
|
||||||
PATH_NAME="Copay/osx64/"
|
|
||||||
# you should not need to change these
|
|
||||||
APP_EXE="${PATH_NAME}${APP_NAME}.app/Contents/MacOS/nwjs"
|
|
||||||
|
|
||||||
VOL_NAME="${APP_NAME}-osx"
|
|
||||||
DMG_TMP="${VOL_NAME}-temp.dmg"
|
|
||||||
DMG_FINAL="${VOL_NAME}.dmg"
|
|
||||||
STAGING_DIR="tmp"
|
|
||||||
|
|
||||||
# Check the background image DPI and convert it if it isn't 72x72
|
|
||||||
_BACKGROUND_IMAGE_DPI_H=`sips -g dpiHeight ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+'`
|
|
||||||
_BACKGROUND_IMAGE_DPI_W=`sips -g dpiWidth ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+'`
|
|
||||||
|
|
||||||
if [ $(echo " $_BACKGROUND_IMAGE_DPI_H != 72.0 " | bc) -eq 1 -o $(echo " $_BACKGROUND_IMAGE_DPI_W != 72.0 " | bc) -eq 1 ]; then
|
|
||||||
echo "WARNING: The background image's DPI is not 72. This will result in distorted backgrounds on Mac OS X 10.7+."
|
|
||||||
echo " I will convert it to 72 DPI for you."
|
|
||||||
|
|
||||||
_DMG_BACKGROUND_TMP="${DMG_BACKGROUND_IMG%.*}"_dpifix."${DMG_BACKGROUND_IMG##*.}"
|
|
||||||
|
|
||||||
sips -s dpiWidth 72 -s dpiHeight 72 ${DMG_BACKGROUND_IMG} --out ${_DMG_BACKGROUND_TMP}
|
|
||||||
|
|
||||||
DMG_BACKGROUND_IMG="${_DMG_BACKGROUND_TMP}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# clear out any old data
|
|
||||||
rm -rf "${STAGING_DIR}" "${DMG_TMP}" "${DMG_FINAL}"
|
|
||||||
|
|
||||||
# copy over the stuff we want in the final disk image to our staging dir
|
|
||||||
mkdir -p "${STAGING_DIR}"
|
|
||||||
cp -rpf "${PATH_NAME}${APP_NAME}.app" "${STAGING_DIR}"
|
|
||||||
# ... cp anything else you want in the DMG - documentation, etc.
|
|
||||||
|
|
||||||
pushd "${STAGING_DIR}"
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
# Fix size to 250MB
|
|
||||||
SIZE=250
|
|
||||||
|
|
||||||
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/Versions/52.0.2743.82/nwjs Helper.app" && echo "Sign 1"
|
|
||||||
codesign --deep -s "${IDENTITY}" $APP_PATH"/Contents/Versions/52.0.2743.82/nwjs Framework.framework/Resources/app_mode_loader.app" && echo "Sign 2"
|
|
||||||
codesign --deep -s "${IDENTITY}" $APP_PATH && echo "Sign 3"
|
|
||||||
echo "Signing Done"
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# create the temp DMG file
|
|
||||||
hdiutil create -srcfolder "${STAGING_DIR}" -volname "${VOL_NAME}" -fs HFS+ \
|
|
||||||
-fsargs "-c c=64,a=16,e=16" -format UDRW -megabytes ${SIZE} "${DMG_TMP}"
|
|
||||||
|
|
||||||
echo "Created DMG: ${DMG_TMP}"
|
|
||||||
|
|
||||||
# mount it and save the device
|
|
||||||
DEVICE=$(hdiutil attach -readwrite -noverify "${DMG_TMP}" | \
|
|
||||||
egrep '^/dev/' | sed 1q | awk '{print $1}')
|
|
||||||
|
|
||||||
sleep 2
|
|
||||||
|
|
||||||
# add a link to the Applications dir
|
|
||||||
echo "Add link to /Applications"
|
|
||||||
pushd /Volumes/"${VOL_NAME}"
|
|
||||||
ln -s /Applications
|
|
||||||
popd
|
|
||||||
|
|
||||||
# add a background image
|
|
||||||
mkdir /Volumes/"${VOL_NAME}"/.background
|
|
||||||
cp "${DMG_BACKGROUND_IMG}" /Volumes/"${VOL_NAME}"/.background/
|
|
||||||
|
|
||||||
# tell the Finder to resize the window, set the background,
|
|
||||||
# change the icon size, place the icons in the right position, etc.
|
|
||||||
echo '
|
|
||||||
tell application "Finder"
|
|
||||||
tell disk "'${VOL_NAME}'"
|
|
||||||
open
|
|
||||||
set current view of container window to icon view
|
|
||||||
set toolbar visible of container window to false
|
|
||||||
set statusbar visible of container window to false
|
|
||||||
set the bounds of container window to {400, 100, 920, 440}
|
|
||||||
set viewOptions to the icon view options of container window
|
|
||||||
set arrangement of viewOptions to not arranged
|
|
||||||
set icon size of viewOptions to 72
|
|
||||||
set background picture of viewOptions to file ".background:'${DMG_BACKGROUND_IMG}'"
|
|
||||||
set position of item "'${APP_NAME}'.app" of container window to {160, 205}
|
|
||||||
set position of item "Applications" of container window to {360, 205}
|
|
||||||
close
|
|
||||||
open
|
|
||||||
update without registering applications
|
|
||||||
delay 2
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
' | osascript
|
|
||||||
|
|
||||||
sync
|
|
||||||
|
|
||||||
# unmount it
|
|
||||||
hdiutil detach "${DEVICE}"
|
|
||||||
|
|
||||||
# now make the final image a compressed disk image
|
|
||||||
echo "Creating compressed image"
|
|
||||||
hdiutil convert "${DMG_TMP}" -format UDZO -imagekey zlib-level=9 -o "${DMG_FINAL}"
|
|
||||||
|
|
||||||
# clean up
|
|
||||||
rm -rf "${DMG_TMP}"
|
|
||||||
rm -rf "${STAGING_DIR}"
|
|
||||||
|
|
||||||
echo 'Done.'
|
|
||||||
|
|
||||||
exit
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue