diff --git a/tools/project-context.js b/tools/project-context.js index 853028b5bf..90f8138433 100644 --- a/tools/project-context.js +++ b/tools/project-context.js @@ -304,7 +304,12 @@ _.extend(exports.ProjectContext.prototype, { getProjectAndLocalPackagesWatchSet: function () { var self = this; var watchSet = self.getProjectWatchSet(); - watchSet.merge(self.isopackCache.allLoadedLocalPackagesWatchSet); + + // Include the loaded local packages (ie, the non-metadata files) but only + // if we've actually gotten to the buildLocalPackages step. + if (self.isopackCache) { + watchSet.merge(self.isopackCache.allLoadedLocalPackagesWatchSet); + } return watchSet; }, @@ -418,10 +423,6 @@ _.extend(exports.ProjectContext.prototype, { localPackageSearchDirs: searchDirs, explicitlyAddedLocalPackageDirs: self._explicitlyAddedLocalPackageDirs }); - if (buildmessage.jobHasMessages()) { - self.projectCatalog = null; - self.localCatalog = null; - } }); self._completedStage = STAGE.INITIALIZE_CATALOG; diff --git a/tools/tests/cordova-plugins.js b/tools/tests/cordova-plugins.js index f0dc218de7..a71f21733b 100644 --- a/tools/tests/cordova-plugins.js +++ b/tools/tests/cordova-plugins.js @@ -124,9 +124,15 @@ selftest.define("change cordova plugins", function () { run.waitSecs(2); run.match("restarted"); + // Introduce an error. s.cp('packages/contains-cordova-plugin/package3.js', 'packages/contains-cordova-plugin/package.js'); run.waitSecs(2); run.match("exact version"); + + // Fix the error. + s.cp('packages/contains-cordova-plugin/package2.js', 'packages/contains-cordova-plugin/package.js'); + run.waitSecs(2); + run.match("restarted"); }); @@ -243,14 +249,14 @@ selftest.define("remove cordova plugins", function () { run = s.run("remove", "cordova:blahblah"); run.matchErr("not in this project"); run.forbidAll("removed"); - run.expectExit(0); + run.expectExit(1); run = s.run("remove", "cordova:blahblah", "cordova:org.apache.cordova.camera"); run.waitSecs(5); run.matchErr("not in this project"); run.match("removed"); - run.expectExit(0); + run.expectExit(1); checkUserPlugins(s, []); });