From 2e1fae335c839ccf89761f752b5fe341adbaa17a Mon Sep 17 00:00:00 2001 From: Shashank Agrawal Date: Wed, 27 Mar 2019 12:42:17 +0530 Subject: [PATCH] Supporting cordova-cli@9 or cordova-lib@9 --- README.md | 4 ++++ package.json | 4 +++- scripts/ios/helper.js | 6 +----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fab1b072e..d3e2907bd 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,10 @@ Download your Firebase configuration files, GoogleService-Info.plist for iOS and ### PhoneGap Build Hooks do not work with PhoneGap Build. This means you will have to manually make sure the configuration files are included. One way to do that is to make a private fork of this plugin and replace the placeholder config files (see `src/ios` and `src/android`) with your actual ones, as well as hard coding your app id and api key in `plugin.xml`. +### cordova-lib@9 support +If you are using `cordova-cli@9` (i.e. `cordova-lib@9`) then you might need to install the `xcode` npm module dependency separately. To +do that, just run this command `npm i xcode --save-dev` in your app. + ### Google Play Services Your build may fail if you are installing multiple plugins that use Google Play Services. This is caused by the plugins installing different versions of the Google Play Services library. This can be resolved by installing [cordova-android-play-services-gradle-release](https://github.com/dpa99c/cordova-android-play-services-gradle-release). diff --git a/package.json b/package.json index 5ade7135f..20e642ea0 100644 --- a/package.json +++ b/package.json @@ -45,5 +45,7 @@ "test:cordova@7.1.0:browser@5.0.3": "bash ./test/test-default.sh 7.1.0 browser 5.0.3", "test:cordova@8.0.0:browser@5.0.3": "bash ./test/test-default.sh 8.0.0 browser 5.0.3" }, - "dependencies": {} + "dependencies": { + "xcode": "^2.0.0" + } } diff --git a/scripts/ios/helper.js b/scripts/ios/helper.js index 946496a9c..ffc02245d 100644 --- a/scripts/ios/helper.js +++ b/scripts/ios/helper.js @@ -1,6 +1,7 @@ var fs = require("fs"); var path = require("path"); var utilities = require("../lib/utilities"); +var xcode = require("xcode"); /** * This is used as the display text for the build phase block in XCode as well as the @@ -30,8 +31,6 @@ module.exports = { * (dSYMs) so that Crashlytics can display stack trace information in it's web console. */ addShellScriptBuildPhase: function (context, xcodeProjectPath) { - var xcode = context.requireCordovaModule("xcode"); - // Read and parse the XCode project (.pxbproj) from disk. // File format information: http://www.monobjc.net/xcode-project-file-format.html var xcodeProject = xcode.project(xcodeProjectPath); @@ -84,9 +83,6 @@ module.exports = { * by the addShellScriptBuildPhase() helper method. */ removeShellScriptBuildPhase: function (context, xcodeProjectPath) { - - var xcode = context.requireCordovaModule("xcode"); - // Read and parse the XCode project (.pxbproj) from disk. // File format information: http://www.monobjc.net/xcode-project-file-format.html var xcodeProject = xcode.project(xcodeProjectPath);