You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/08/18 16:42:38 UTC

git commit: CB-3445: Android: Fail gracefully when adding plugins to nongradle project

Repository: cordova-lib
Updated Branches:
  refs/heads/CB-3445 8a2ca5839 -> 72eed8e76


CB-3445: Android: Fail gracefully when adding plugins to nongradle project


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/72eed8e7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/72eed8e7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/72eed8e7

Branch: refs/heads/CB-3445
Commit: 72eed8e76c7a807ab112caf9ce5d78e1bb4c4518
Parents: 8a2ca58
Author: Ian Clelland <ic...@chromium.org>
Authored: Mon Aug 18 10:41:56 2014 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Mon Aug 18 10:41:56 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/util/android-project.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/72eed8e7/cordova-lib/src/plugman/util/android-project.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/android-project.js b/cordova-lib/src/plugman/util/android-project.js
index 65f65e7..fd01347 100644
--- a/cordova-lib/src/plugman/util/android-project.js
+++ b/cordova-lib/src/plugman/util/android-project.js
@@ -201,7 +201,9 @@ AndroidProject.prototype = {
 
         var gradleSettingsFile = path.resolve(parentDir, 'settings.gradle');
         var gradleLibrariesFile = path.resolve(parentDir, 'libraries.gradle');
-        addGradleLibraryReference(gradleSettingsFile, gradleLibrariesFile, module.exports.getRelativeLibraryPath(parentDir, subDir).split('/'));
+        if (fs.existsSync(gradleSettingsFile)) {
+            addGradleLibraryReference(gradleSettingsFile, gradleLibrariesFile, module.exports.getRelativeLibraryPath(parentDir, subDir).split('/'));
+        }
 
         this._subProjectDirs[subDir] = true;
         this._dirty = true;
@@ -212,7 +214,9 @@ AndroidProject.prototype = {
         removeLibraryReference(parentProperties, module.exports.getRelativeLibraryPath(parentDir, subDir));
         var gradleSettingsFile = path.resolve(parentDir, 'settings.gradle');
         var gradleLibrariesFile = path.resolve(parentDir, 'libraries.gradle');
-        removeGradleLibraryReference(gradleSettingsFile, gradleLibrariesFile, module.exports.getRelativeLibraryPath(parentDir, subDir).split('/'));
+        if (fs.existsSync(gradleSettingsFile)) {
+            removeGradleLibraryReference(gradleSettingsFile, gradleLibrariesFile, module.exports.getRelativeLibraryPath(parentDir, subDir).split('/'));
+        }
         delete this._subProjectDirs[subDir];
         this._dirty = true;
     },