Merge pull request #558 from cmgustavo/ref/build-desktop

Ref/build desktop
This commit is contained in:
Matias Alejo Garcia 2016-10-18 16:28:26 -03:00 committed by GitHub
commit bff78a31a0
50 changed files with 36 additions and 52 deletions

23
.gitignore vendored
View File

@ -13,11 +13,6 @@ cordova/*.keystore
cache cache
webkitbuilds/* webkitbuilds/*
!webkitbuilds/README.md !webkitbuilds/README.md
!webkitbuilds/setup-win.iss
!webkitbuilds/favicon.ico
!webkitbuilds/.desktop
!webkitbuilds/build-osx.sh
!webkitbuilds/Background.png
# chrome extensions # chrome extensions
chrome-app/build/* chrome-app/build/*
@ -105,30 +100,14 @@ externalServices.json
cordova/Makefile cordova/Makefile
cordova/ProjectMakefile cordova/ProjectMakefile
app-template/bitpay-wallet app-template/bitpay-wallet
cordova/ProjectMakefile
cordova/config.xml cordova/config.xml
cordova/wp/Package.appxmanifest cordova/wp/Package.appxmanifest
www/img/logo-negative.svg
www/img/logo.svg
src/js/appConfig.js src/js/appConfig.js
src/js/externalServices.js src/js/externalServices.js
chrome-app/manifest.json chrome-app/manifest.json
webkitbuilds/.desktop www/img/app
webkitbuilds/setup-win.iss
www/img/favicon.ico
www/img/icon-128.png
cordova/Makefile
cordova/ProjectMakefile
app-template/bitpay-wallet
cordova/ProjectMakefile
cordova/config.xml
cordova/wp/Package.appxmanifest
www/img/logo-negative.svg
www/img/logo.svg
src/js/appConfig.js
cordova/android/res/ cordova/android/res/
cordova/wp/Assets/ cordova/wp/Assets/
cordova/wp/*.png cordova/wp/*.png

View File

@ -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-osx.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/icon-256.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/icon.icns', macIcns: './www/img/app/logo.icns',
exeIco: './www/img/icons/icon.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']);

View File

@ -13,7 +13,7 @@ var templates = {
'Package.appxmanifest': 'cordova/wp/', 'Package.appxmanifest': 'cordova/wp/',
'.desktop': 'webkitbuilds/', '.desktop': 'webkitbuilds/',
'setup-win.iss': 'webkitbuilds/', 'setup-win.iss': 'webkitbuilds/',
'manifest.json': 'chrome-app/', 'build-macos.sh': 'webkitbuilds/',
// 'bower.json': '/', // 'bower.json': '/',
}; };
var configDir = process.argv[2] || 'copay'; var configDir = process.argv[2] || 'copay';
@ -117,6 +117,6 @@ function copyDir(from, to, cb) {
} }
copyDir(configDir + '/img/', '../www/img/', function() { copyDir(configDir + '/img/', '../www/img/app/', function() {
console.log("apply.js finished. \n\n"); console.log("apply.js finished. \n\n");
}); });

View File

@ -18,6 +18,7 @@
"winAppName": "BitPayWallet", "winAppName": "BitPayWallet",
"wpPublisherId": "{}", "wpPublisherId": "{}",
"wpProductId": "{}", "wpProductId": "{}",
"windowsAppId": "",
"pushSenderId": "1036948132229", "pushSenderId": "1036948132229",
"description": "Secure Bitcoin Wallet", "description": "Secure Bitcoin Wallet",
"version": "0.14.0", "version": "0.14.0",

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
app-template/bitpay/img/16x16.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

BIN
app-template/bitpay/img/24x24.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
app-template/bitpay/img/32x32.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
app-template/bitpay/img/48x48.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
app-template/bitpay/img/64x64.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
app-template/bitpay/img/96x96.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
SHOULD_SIGN=$1 SHOULD_SIGN=$1
if [ "$SHOULD_SIGN" ] if [ "$SHOULD_SIGN" ]
then then
echo "Will sign the APP" echo "Will sign the APP"
fi fi
@ -16,10 +16,10 @@ if [ -d "$dir" ]; then
fi 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="Copay" APP_NAME="*USERVISIBLENAME*"
DMG_BACKGROUND_IMG="Background.png" DMG_BACKGROUND_IMG="Background.png"
PATH_NAME="Copay/osx64/" PATH_NAME="${APP_NAME}/osx64/"
# you should not need to change these # you should not need to change these
APP_EXE="${PATH_NAME}${APP_NAME}.app/Contents/MacOS/nwjs" APP_EXE="${PATH_NAME}${APP_NAME}.app/Contents/MacOS/nwjs"
@ -35,11 +35,11 @@ _BACKGROUND_IMAGE_DPI_W=`sips -g dpiWidth ${DMG_BACKGROUND_IMG} | grep -Eo '[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 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 "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." echo " I will convert it to 72 DPI for you."
_DMG_BACKGROUND_TMP="${DMG_BACKGROUND_IMG%.*}"_dpifix."${DMG_BACKGROUND_IMG##*.}" _DMG_BACKGROUND_TMP="${DMG_BACKGROUND_IMG%.*}"_dpifix."${DMG_BACKGROUND_IMG##*.}"
sips -s dpiWidth 72 -s dpiHeight 72 ${DMG_BACKGROUND_IMG} --out ${_DMG_BACKGROUND_TMP} sips -s dpiWidth 72 -s dpiHeight 72 ${DMG_BACKGROUND_IMG} --out ${_DMG_BACKGROUND_TMP}
DMG_BACKGROUND_IMG="${_DMG_BACKGROUND_TMP}" DMG_BACKGROUND_IMG="${_DMG_BACKGROUND_TMP}"
fi fi
@ -66,11 +66,11 @@ if [ $? -ne 0 ]; then
# Sign Code (MATIAS) # Sign Code (MATIAS)
if [ $SHOULD_SIGN ] if [ $SHOULD_SIGN ]
then then
echo "Signing Copay DMG" echo "Signing ${APP_NAME} DMG"
export IDENTITY="3rd Party Mac Developer Application: BitPay, Inc. (884JRH5R93)" export IDENTITY="3rd Party Mac Developer Application: BitPay, Inc. (884JRH5R93)"
# not need for 'out of app store' distribution (?) # not need for 'out of app store' distribution (?)
# export PARENT_PLIST=parent.plist # export PARENT_PLIST=parent.plist
# export CHILD_PLIST=child.plist # export CHILD_PLIST=child.plist
export APP_PATH=${STAGING_DIR}/${APP_NAME}.app export APP_PATH=${STAGING_DIR}/${APP_NAME}.app

View File

@ -18,6 +18,7 @@
"winAppName": "CopayWallet", "winAppName": "CopayWallet",
"wpPublisherId": "{31cdd08b-457c-413d-b440-f6665eec847d}", "wpPublisherId": "{31cdd08b-457c-413d-b440-f6665eec847d}",
"wpProductId": "{5381aa50-9069-11e4-84cc-293caf9cbdc8}", "wpProductId": "{5381aa50-9069-11e4-84cc-293caf9cbdc8}",
"windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
"pushSenderId": "1036948132229", "pushSenderId": "1036948132229",
"description": "A Secure Bitcoin Wallet", "description": "A Secure Bitcoin Wallet",
"version": "2.5.0", "version": "2.5.0",

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
app-template/copay/img/16x16.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

BIN
app-template/copay/img/24x24.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
app-template/copay/img/32x32.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
app-template/copay/img/48x48.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
app-template/copay/img/64x64.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
app-template/copay/img/96x96.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

View File

@ -12,9 +12,10 @@
"bitcore" "bitcore"
], ],
"main": "www/index.html", "main": "www/index.html",
"title": "*USERVISIBLENAME*",
"window": { "window": {
"title": "*USERVISIBLENAME* - *PURPOSELINE*", "title": "*USERVISIBLENAME* - *PURPOSELINE*",
"icon": "www/img/icon-128.png", "icon": "www/img/icons/logo.ico",
"toolbar": false, "toolbar": false,
"show": true, "show": true,
"visible": true, "visible": true,
@ -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",

View File

@ -5,10 +5,11 @@
#define MyAppVersion "*VERSION*" #define MyAppVersion "*VERSION*"
#define MyAppPublisher "BitPay" #define MyAppPublisher "BitPay"
#define MyAppURL "*URL*" #define MyAppURL "*URL*"
#define MyAppExeName "*PACKAGENAME.exe" #define MyAppExeName "*PACKAGENAME*.exe"
#define AppId "*WINDOWSAPPID*"
[Setup] [Setup]
AppId={804636ee-b017-4cad-8719-e58ac97ffa5c} AppId={#AppId}
AppName={#MyAppName} AppName={#MyAppName}
AppVersion={#MyAppVersion} AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion}

View File

@ -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
View File

@ -0,0 +1 @@
../www/img/app/Background.png

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 29 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -8,7 +8,7 @@
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="css/copay.css"> <link rel="stylesheet" type="text/css" href="css/copay.css">
<title>{{appConfig.nameCase}} - {{appConfig.description}}</title> <title>{{appConfig.nameCase}} - {{appConfig.description}}</title>
<link rel="shortcut icon" href="img/favicon.ico"> <link rel="shortcut icon" href="img/app/favicon.ico">
</head> </head>
<body> <body>