mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-04 00:02:03 +08:00
CB-13741: Updating checked-in node_modules, otherwise plugin installation fails
This commit is contained in:
37
node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
generated
vendored
37
node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
generated
vendored
@@ -184,16 +184,34 @@ function resolveConfigFilePath (project_dir, platform, file) {
|
||||
return filepath;
|
||||
}
|
||||
|
||||
// special-case config.xml target that is just "config.xml". This should be resolved to the real location of the file.
|
||||
// TODO: move the logic that contains the locations of config.xml from cordova CLI into plugman.
|
||||
// XXX this checks for android studio projects
|
||||
// only if none of the options above are satisfied does this get called
|
||||
// TODO: Move this out of cordova-common and into the platforms somehow
|
||||
if (platform === 'android' && !fs.existsSync(filepath)) {
|
||||
if (file === 'AndroidManifest.xml') {
|
||||
filepath = path.join(project_dir, 'app', 'src', 'main', 'AndroidManifest.xml');
|
||||
} else if (file.endsWith('config.xml')) {
|
||||
filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml');
|
||||
} else if (file.endsWith('strings.xml')) {
|
||||
// Plugins really shouldn't mess with strings.xml, since it's able to be localized
|
||||
filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'values', 'strings.xml');
|
||||
} else if (file.match(/res\/xml/)) {
|
||||
// Catch-all for all other stored XML configuration in legacy plugins
|
||||
var config_file = path.basename(file);
|
||||
filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', config_file);
|
||||
}
|
||||
return filepath;
|
||||
}
|
||||
|
||||
// special-case config.xml target that is just "config.xml" for other platforms. This should
|
||||
// be resolved to the real location of the file.
|
||||
// TODO: Move this out of cordova-common into platforms
|
||||
if (file === 'config.xml') {
|
||||
if (platform === 'ubuntu') {
|
||||
filepath = path.join(project_dir, 'config.xml');
|
||||
} else if (platform === 'ios') {
|
||||
var iospath = getIOSProjectname(project_dir);
|
||||
var iospath = module.exports.getIOSProjectname(project_dir);
|
||||
filepath = path.join(project_dir, iospath, 'config.xml');
|
||||
} else if (platform === 'android') {
|
||||
filepath = path.join(project_dir, 'res', 'xml', 'config.xml');
|
||||
} else {
|
||||
matches = modules.glob.sync(path.join(project_dir, '**', 'config.xml'));
|
||||
if (matches.length) filepath = matches[0];
|
||||
@@ -201,12 +219,6 @@ function resolveConfigFilePath (project_dir, platform, file) {
|
||||
return filepath;
|
||||
}
|
||||
|
||||
// XXX this checks for android studio projects
|
||||
// only if none of the options above are satisfied does this get called
|
||||
if (platform === 'android' && !fs.existsSync(filepath)) {
|
||||
filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml');
|
||||
}
|
||||
|
||||
// None of the special cases matched, returning project_dir/file.
|
||||
return filepath;
|
||||
}
|
||||
@@ -240,3 +252,6 @@ function isBinaryPlist (filename) {
|
||||
}
|
||||
|
||||
module.exports = ConfigFile;
|
||||
module.exports.isBinaryPlist = isBinaryPlist;
|
||||
module.exports.getIOSProjectname = getIOSProjectname;
|
||||
module.exports.resolveConfigFilePath = resolveConfigFilePath;
|
||||
|
||||
5
node_modules/cordova-common/src/PluginInfo/PluginInfo.js
generated
vendored
5
node_modules/cordova-common/src/PluginInfo/PluginInfo.js
generated
vendored
@@ -312,6 +312,11 @@ function PluginInfo (dirname) {
|
||||
var src = el.attrib.src;
|
||||
if (options) {
|
||||
var vars = options.cli_variables || {};
|
||||
|
||||
if (Object.keys(vars).length === 0) {
|
||||
// get variable defaults from plugin.xml for removal
|
||||
vars = self.getPreferences(platform);
|
||||
}
|
||||
var regExp;
|
||||
// Iterate over plugin variables.
|
||||
// Replace them in framework src if they exist
|
||||
|
||||
Reference in New Issue
Block a user