-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #784 from gvieduc/master
Move from Firebase Crash to Firebase Crashlytics and stop opt-in users
- Loading branch information
Showing
49 changed files
with
2,259 additions
and
1,765 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
.build-browser | ||
package-lock.json | ||
node_modules | ||
cordova-plugin-firebase.code-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
var androidHelper = require('./lib/android-helper'); | ||
var iosHelper = require("./lib/ios-helper"); | ||
var utilities = require("./lib/utilities"); | ||
|
||
module.exports = function(context) { | ||
|
||
var platforms = context.opts.cordova.platforms; | ||
|
||
// Modify the Gradle build file to add a task that will upload the debug symbols | ||
// at build time. | ||
if (platforms.indexOf("android") !== -1) { | ||
androidHelper.removeFabricBuildToolsFromGradle(); | ||
androidHelper.addFabricBuildToolsGradle(); | ||
} | ||
|
||
// Add a build phase which runs a shell script that executes the Crashlytics | ||
// run command line tool which uploads the debug symbols at build time. | ||
if (platforms.indexOf("ios") !== -1) { | ||
var xcodeProjectPath = utilities.getXcodeProjectPath(context); | ||
iosHelper.removeShellScriptBuildPhase(context, xcodeProjectPath); | ||
iosHelper.addShellScriptBuildPhase(context, xcodeProjectPath); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
var androidHelper = require('./lib/android-helper'); | ||
var iosHelper = require("./lib/ios-helper"); | ||
var utilities = require("./lib/utilities"); | ||
|
||
module.exports = function(context) { | ||
|
||
var platforms = context.opts.cordova.platforms; | ||
|
||
// Remove the Gradle modifications that were added when the plugin was installed. | ||
if (platforms.indexOf("android") !== -1) { | ||
androidHelper.removeFabricBuildToolsFromGradle(); | ||
} | ||
|
||
// Remove the build script that was added when the plugin was installed. | ||
if (platforms.indexOf("ios") !== -1) { | ||
var xcodeProjectPath = utilities.getXcodeProjectPath(context); | ||
iosHelper.removeShellScriptBuildPhase(context, xcodeProjectPath); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
var utilities = require("./utilities"); | ||
|
||
module.exports = { | ||
|
||
addFabricBuildToolsGradle: function () { | ||
|
||
var buildGradle = utilities.readBuildGradle(); | ||
|
||
var addToBuildGradle = [ | ||
"", | ||
"// Fabric Cordova Plugin - Start Fabric Build Tools ", | ||
"buildscript {", | ||
" repositories {", | ||
" maven { url 'https://maven.fabric.io/public' }", | ||
" maven { url 'https://maven.google.com' }", | ||
" }", | ||
" dependencies {", | ||
" classpath 'io.fabric.tools:gradle:1.25.4'", | ||
" classpath 'com.google.gms:google-services:+'", | ||
" }", | ||
"}", | ||
"", | ||
"apply plugin: 'io.fabric'", | ||
"apply plugin: 'com.google.gms.google-services'", | ||
"// Fabric Cordova Plugin - End Fabric Build Tools" | ||
].join("\n"); | ||
|
||
buildGradle = buildGradle.replace(/(\/\/ PLUGIN GRADLE EXTENSIONS START)/, addToBuildGradle + '\n\n$1'); | ||
|
||
utilities.writeBuildGradle(buildGradle); | ||
}, | ||
|
||
removeFabricBuildToolsFromGradle: function () { | ||
|
||
var buildGradle = utilities.readBuildGradle(); | ||
|
||
buildGradle = buildGradle.replace(/\n\/\/ Fabric Cordova Plugin - Start Fabric Build Tools[\s\S]*\/\/ Fabric Cordova Plugin - End Fabric Build Tools/, ""); | ||
|
||
utilities.writeBuildGradle(buildGradle); | ||
} | ||
}; |
Oops, something went wrong.