CB-10618 Handle gradle frameworks on plugin installation/uninstallation

This closes #259
This commit is contained in:
Vladimir Kotikov
2016-02-17 16:37:58 +03:00
parent 7233931681
commit 7be9e880c2
7 changed files with 132 additions and 9 deletions
+2 -2
View File
@@ -126,8 +126,8 @@ function writeProjectProperties(projectPath, target_api) {
}
function prepBuildFiles(projectPath) {
var buildModule = require(path.join(path.resolve(projectPath), 'cordova', 'lib', 'build'));
buildModule.prepBuildFiles();
var buildModule = require(path.resolve(projectPath, 'cordova/lib/builders/builders'));
buildModule.getBuilder('gradle').prepBuildFiles();
}
function copyBuildRules(projectPath) {
+10
View File
@@ -219,6 +219,11 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
.add_plugin_changes(plugin, installOptions.variables, /*is_top_level=*/true, /*should_increment=*/true)
.save_all();
if (plugin.getFrameworks(self.platform).length > 0) {
self.events.emit('verbose', 'Updating build files since android plugin contained <framework>');
require('./lib/builders/builders').getBuilder('gradle').prepBuildFiles();
}
var targetDir = installOptions.usePlatformWww ?
self.locations.platformWww :
self.locations.www;
@@ -272,6 +277,11 @@ Api.prototype.removePlugin = function (plugin, uninstallOptions) {
.remove_plugin_changes(plugin, /*is_top_level=*/true)
.save_all();
if (plugin.getFrameworks(self.platform).length > 0) {
self.events.emit('verbose', 'Updating build files since android plugin contained <framework>');
require('./lib/builders/builders').getBuilder('gradle').prepBuildFiles();
}
var targetDir = uninstallOptions.usePlatformWww ?
self.locations.platformWww :
self.locations.www;
-5
View File
@@ -169,11 +169,6 @@ module.exports.run = function(options, optResolvedTarget) {
});
};
// Called by plugman after installing plugins, and by create script after creating project.
module.exports.prepBuildFiles = function() {
return builders.getBuilder('gradle').prepBuildFiles();
};
/*
* Detects the architecture of a device/emulator
* Returns "arm" or "x86".