Skip to content

Commit

Permalink
Revert "remove google repo"
Browse files Browse the repository at this point in the history
  • Loading branch information
soumak77 authored Sep 28, 2018
1 parent 6cff6e7 commit db0df8a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/lib/android-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,28 @@ function addDependencies(buildGradle) {
// find the known line to match
var match = buildGradle.match(/^(\s*)classpath 'com.android.tools.build(.*)/m);
var whitespace = match[1];

// modify the line to add the necessary dependencies
var googlePlayDependency = whitespace + 'classpath \'com.google.gms:google-services:4.1.0\' // google-services dependency from cordova-plugin-firebase';
var fabricDependency = whitespace + 'classpath \'io.fabric.tools:gradle:1.25.4\' // fabric dependency from cordova-plugin-firebase'
var modifiedLine = match[0] + '\n' + googlePlayDependency + '\n' + fabricDependency;

// modify the actual line
return buildGradle.replace(/^(\s*)classpath 'com.android.tools.build(.*)/m, modifiedLine);
}

/*
* Add Crashlytics repos to the repository list
* Add 'google()' to the repository repo list
*/
function addRepos(buildGradle) {
// find the known line to match
var match = buildGradle.match(/^(\s*)jcenter\(\)/m);
var whitespace = match[1];

// modify the line to add the necessary repo
var googlesMavenRepo = whitespace + 'google() // Google\'s Maven repository from cordova-plugin-firebase';
var fabricMavenRepo = whitespace + 'maven { url \'https://maven.fabric.io/public\' } // Fabrics Maven repository from cordova-plugin-firebase'
var modifiedLine = match[0] + '\n' + fabricMavenRepo;
var modifiedLine = match[0] + '\n' + googlesMavenRepo + '\n' + fabricMavenRepo;

// modify the actual line
return buildGradle.replace(/^(\s*)jcenter\(\)/m, modifiedLine);
Expand All @@ -67,7 +68,7 @@ module.exports = {

// Add Google Play Services Dependency
buildGradle = addDependencies(buildGradle);

// Add Google's Maven Repo
buildGradle = addRepos(buildGradle);

Expand All @@ -84,7 +85,7 @@ module.exports = {

// remove any lines we added
buildGradle = buildGradle.replace(/(?:^|\r?\n)(.*)cordova-plugin-firebase*?(?=$|\r?\n)/g, '');

writeRootBuildGradle(buildGradle);
}
};
};

0 comments on commit db0df8a

Please sign in to comment.