From affc79830bcc305a86dbcd5bcf1712d53f3bdfe2 Mon Sep 17 00:00:00 2001 From: Dale Snowdon Date: Fri, 12 Jul 2019 20:47:45 +0100 Subject: [PATCH 1/4] Update new IOS app icon paths --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index b83ef55..8358d05 100644 --- a/index.js +++ b/index.js @@ -39,8 +39,14 @@ var getPlatforms = function (projectName) { { name: 'icon-20.png', size : 20 }, { name: 'icon-20@2x.png', size : 40 }, { name: 'icon-20@3x.png', size : 60 }, + { name: 'icon-24@2x.png', size : 48 }, + { name: 'icon-27.5@2x.png', size : 55 }, + { name: 'icon-29.png', size : 29 }, + { name: 'icon-29@2x.png', size : 58 }, + { name: 'icon-29@3x.png', size : 87 }, { name: 'icon-40.png', size : 40 }, { name: 'icon-40@2x.png', size : 80 }, + { name: 'icon-44@2x.png', size : 88 }, { name: 'icon-50.png', size : 50 }, { name: 'icon-50@2x.png', size : 100 }, { name: 'icon-60@2x.png', size : 120 }, @@ -50,6 +56,8 @@ var getPlatforms = function (projectName) { { name: 'icon-76.png', size : 76 }, { name: 'icon-76@2x.png', size : 152 }, { name: 'icon-83.5@2x.png', size : 167 }, + { name: 'icon-86@2x.png', size : 172 }, + { name: 'icon-98@2x.png', size : 196 }, { name: 'icon-1024.png', size : 1024 }, { name: 'icon-small.png', size : 29 }, { name: 'icon-small@2x.png', size : 58 }, From 00ce00d0ac79c590c786df7cdfee579489321a2a Mon Sep 17 00:00:00 2001 From: Dale Snowdon Date: Sun, 14 Jul 2019 17:44:55 +0100 Subject: [PATCH 2/4] Add android paths. --- index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.js b/index.js index 8358d05..fcdb12f 100644 --- a/index.js +++ b/index.js @@ -80,6 +80,19 @@ var getPlatforms = function (projectName) { iconsPath : 'platforms/android/app/src/main/res/', icons : [ { name : 'drawable/icon.png', size : 96 }, + { name : 'drawable/icon.png', size : 96 }, + { name : 'drawable-hdpi/icon.png', size : 72 }, + { name : 'drawable-ldpi/icon.png', size : 36 }, + { name : 'drawable-mdpi/icon.png', size : 48 }, + { name : 'drawable-xhdpi/icon.png', size : 96 }, + { name : 'drawable-xxhdpi/icon.png', size : 144 }, + { name : 'drawable-xxxhdpi/icon.png', size : 192 }, + { name : 'mipmap-hdpi/icon.png', size : 72 }, + { name : 'mipmap-ldpi/icon.png', size : 36 }, + { name : 'mipmap-mdpi/icon.png', size : 48 }, + { name : 'mipmap-xhdpi/icon.png', size : 96 }, + { name : 'mipmap-xxhdpi/icon.png', size : 144 }, + { name : 'mipmap-xxxhdpi/icon.png', size : 192 } { name : 'drawable-hdpi/icon.png', size : 72 }, { name : 'drawable-ldpi/icon.png', size : 36 }, { name : 'drawable-mdpi/icon.png', size : 48 }, From 3b7461265b7461bea3f935e85479ac01909c4542 Mon Sep 17 00:00:00 2001 From: Dale Snowdon Date: Sun, 14 Jul 2019 17:48:23 +0100 Subject: [PATCH 3/4] Save. --- index.js | 2 +- package-lock.json | 170 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/index.js b/index.js index fcdb12f..93faf74 100644 --- a/index.js +++ b/index.js @@ -92,7 +92,7 @@ var getPlatforms = function (projectName) { { name : 'mipmap-mdpi/icon.png', size : 48 }, { name : 'mipmap-xhdpi/icon.png', size : 96 }, { name : 'mipmap-xxhdpi/icon.png', size : 144 }, - { name : 'mipmap-xxxhdpi/icon.png', size : 192 } + { name : 'mipmap-xxxhdpi/icon.png', size : 192 }, { name : 'drawable-hdpi/icon.png', size : 72 }, { name : 'drawable-ldpi/icon.png', size : 36 }, { name : 'drawable-mdpi/icon.png', size : 48 }, diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..4a70aa0 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,170 @@ +{ + "name": "cordova-icon", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==" + }, + "imagemagick": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/imagemagick/-/imagemagick-0.1.3.tgz", + "integrity": "sha1-dIPOoJO02fLi85aFetyIIbU3xWo=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "requires": { + "glob": "^7.1.3" + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~9.0.1" + } + }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" + } + } +} From f3ccdce82daa3810bd1da700dfd86da5d93d6f2c Mon Sep 17 00:00:00 2001 From: Dale Snowdon Date: Sun, 14 Jul 2019 18:18:30 +0100 Subject: [PATCH 4/4] Copy files in correct. --- index.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 93faf74..94e41ca 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,6 @@ var getPlatforms = function (projectName) { isAdded : fs.existsSync('platforms/android'), iconsPath : 'platforms/android/app/src/main/res/', icons : [ - { name : 'drawable/icon.png', size : 96 }, { name : 'drawable/icon.png', size : 96 }, { name : 'drawable-hdpi/icon.png', size : 72 }, { name : 'drawable-ldpi/icon.png', size : 36 }, @@ -93,18 +92,18 @@ var getPlatforms = function (projectName) { { name : 'mipmap-xhdpi/icon.png', size : 96 }, { name : 'mipmap-xxhdpi/icon.png', size : 144 }, { name : 'mipmap-xxxhdpi/icon.png', size : 192 }, - { name : 'drawable-hdpi/icon.png', size : 72 }, - { name : 'drawable-ldpi/icon.png', size : 36 }, - { name : 'drawable-mdpi/icon.png', size : 48 }, - { name : 'drawable-xhdpi/icon.png', size : 96 }, - { name : 'drawable-xxhdpi/icon.png', size : 144 }, - { name : 'drawable-xxxhdpi/icon.png', size : 192 }, - { name : 'mipmap-hdpi/icon.png', size : 72 }, - { name : 'mipmap-ldpi/icon.png', size : 36 }, - { name : 'mipmap-mdpi/icon.png', size : 48 }, - { name : 'mipmap-xhdpi/icon.png', size : 96 }, - { name : 'mipmap-xxhdpi/icon.png', size : 144 }, - { name : 'mipmap-xxxhdpi/icon.png', size : 192 } + { name : 'mipmap-hdpi/ic_launcher.png', size : 72 }, + { name : 'mipmap-ldpi/ic_launcher.png', size : 36 }, + { name : 'mipmap-mdpi/ic_launcher.png', size : 48 }, + { name : 'mipmap-xhdpi/ic_launcher.png', size : 96 }, + { name : 'mipmap-xxhdpi/ic_launcher.png', size : 144 }, + { name : 'mipmap-xxxhdpi/ic_launcher.png', size : 192 }, + { name : 'mipmap-hdpi-v26/ic_launcher_foreground.png', size : 72 }, + { name : 'mipmap-ldpi-v26/ic_launcher_foreground.png', size : 36 }, + { name : 'mipmap-mdpi-v26/ic_launcher_foreground.png', size : 48 }, + { name : 'mipmap-xhdpi-v26/ic_launcher_foreground.png', size : 96 }, + { name : 'mipmap-xxhdpi-v26/ic_launcher_foreground.png', size : 144 }, + { name : 'mipmap-xxxhdpi-v26/ic_launcher_foreground.png', size : 192 }, ] }); platforms.push({ @@ -232,6 +231,8 @@ var getProjectName = function () { * @return {Promise} */ var generateIcon = function (platform, icon) { + console.log(platform); + console.log(icon); var deferred = Q.defer(); var srcPath = settings.ICON_FILE; var platformPath = srcPath.replace(/\.png$/, '-' + platform.name + '.png'); @@ -239,6 +240,9 @@ var generateIcon = function (platform, icon) { srcPath = platformPath; } var dstPath = platform.iconsPath + icon.name; + console.log('platformPath' + platformPath); + console.log('srcPAth: ' + srcPath); + console.log('iconsPath: ' + platform.iconsPath); var dst = path.dirname(dstPath); if (!fs.existsSync(dst)) { fs.mkdirsSync(dst);