Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function updateConfigFilesFrom(sourceConfig, configMunger, locations) {
events.emit('verbose', 'Generating platform-specific config.xml from defaults for android at ' + locations.configXml);
// First cleanup current config and merge project's one into own
// Overwrite platform config.xml with defaults.xml.
shell.cp('-f', locations.defaultConfigXml, locations.configXml);
// Then apply config changes from global munge to all config files
// in project (including project's config)
configMunger.reapply_global_munge().save_all();
events.emit('verbose', 'Merging project\'s config.xml into platform-specific android config.xml');
// Merge changes from app's config.xml into platform's one
var config = new ConfigParser(locations.configXml);
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'android', /*clobber=*/true);
config.write();
return config;
}
function updateConfigFilesFrom(sourceConfig, configMunger, locations) {
events.emit('verbose', 'Generating platform-specific config.xml from defaults for android at ' + locations.configXml);
// First cleanup current config and merge project's one into own
// Overwrite platform config.xml with defaults.xml.
shell.cp('-f', locations.defaultConfigXml, locations.configXml);
// Then apply config changes from global munge to all config files
// in project (including project's config)
configMunger.reapply_global_munge().save_all();
events.emit('verbose', 'Merging project\'s config.xml into platform-specific android config.xml');
// Merge changes from app's config.xml into platform's one
var config = new ConfigParser(locations.configXml);
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'android', /*clobber=*/true);
config.write();
return config;
}
// If defaults.xml is present, overwrite platform config.xml with it.
// Otherwise save whatever is there as defaults so it can be
// restored or copy project config into platform if none exists.
if (fs.existsSync(defaultConfig)) {
this.events.emit('verbose', 'Generating config.xml from defaults for platform "' + this.platform + '"');
shell.cp('-f', defaultConfig, ownConfig);
} else if (fs.existsSync(ownConfig)) {
shell.cp('-f', ownConfig, defaultConfig);
} else {
shell.cp('-f', sourceCfg.path, ownConfig);
}
this._munger.reapply_global_munge().save_all();
this._config = new ConfigParser(ownConfig);
xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
this._config.doc.getroot(), this.platform, true);
// CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
// we allow using windows8 tag for new windows platform
if (this.platform == 'windows') {
xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
this._config.doc.getroot(), 'windows8', true);
}
this._config.write();
// Update own www dir with project's www assets and plugins' assets and js-files
this._parser.update_www(cordovaProject.locations.www);
// update project according to config.xml changes.
return this._parser.update_project(this._config);
};
function updateConfigFilesFrom(sourceConfig, configMunger, locations) {
events.emit('verbose', 'Generating platform-specific config.xml from defaults for android at ' + locations.configXml);
// First cleanup current config and merge project's one into own
// Overwrite platform config.xml with defaults.xml.
shell.cp('-f', locations.defaultConfigXml, locations.configXml);
// Then apply config changes from global munge to all config files
// in project (including project's config)
configMunger.reapply_global_munge().save_all();
events.emit('verbose', 'Merging project\'s config.xml into platform-specific android config.xml');
// Merge changes from app's config.xml into platform's one
var config = new ConfigParser(locations.configXml);
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'android', /*clobber=*/true);
config.write();
return config;
}
events.emit('verbose', 'Generating platform-specific config.xml from defaults for windows at ' + ownConfig);
shell.cp('-f', defaultConfig, ownConfig);
} else if (fs.existsSync(ownConfig)) {
shell.cp('-f', ownConfig, defaultConfig);
} else {
shell.cp('-f', sourceCfg, ownConfig);
}
// Then apply config changes from global munge to all config files
// in project (including project's config)
configMunger.reapply_global_munge().save_all();
events.emit('verbose', 'Merging project\'s config.xml into platform-specific windows config.xml');
// Merge changes from app's config.xml into platform's one
var config = new ConfigParser(ownConfig);
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'windows', /*clobber=*/true);
config.write();
return config;
}
if (fs.existsSync(defaultConfig)) {
events.emit('verbose', 'Generating config.xml from defaults for platform "windows"');
shell.cp('-f', defaultConfig, ownConfig);
} else if (fs.existsSync(ownConfig)) {
shell.cp('-f', ownConfig, defaultConfig);
} else {
shell.cp('-f', sourceCfg, ownConfig);
}
// Then apply config changes from global munge to all config files
// in project (including project's config)
configMunger.reapply_global_munge().save_all();
// Merge changes from app's config.xml into platform's one
var config = new ConfigParser(ownConfig);
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'windows', /*clobber=*/true);
// CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
// we allow using windows8 tag for new windows platform
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'windows8', /*clobber=*/true);
config.write();
return config;
}
if (fs.existsSync(defaultConfig)) {
events.emit('verbose', 'Generating config.xml from defaults for platform "windows"');
shell.cp('-f', defaultConfig, ownConfig);
} else if (fs.existsSync(ownConfig)) {
shell.cp('-f', ownConfig, defaultConfig);
} else {
shell.cp('-f', sourceCfg, ownConfig);
}
// Then apply config changes from global munge to all config files
// in project (including project's config)
configMunger.reapply_global_munge().save_all();
// Merge changes from app's config.xml into platform's one
var config = new ConfigParser(ownConfig);
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'windows', /*clobber=*/true);
// CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
// we allow using windows8 tag for new windows platform
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'windows8', /*clobber=*/true);
config.write();
return config;
}
function updateConfigFilesFrom(sourceConfig, configMunger, locations) {
events.emit('verbose', 'Generating platform-specific config.xml from defaults for android at ' + locations.configXml);
// First cleanup current config and merge project's one into own
// Overwrite platform config.xml with defaults.xml.
shell.cp('-f', locations.defaultConfigXml, locations.configXml);
// Then apply config changes from global munge to all config files
// in project (including project's config)
configMunger.reapply_global_munge().save_all();
events.emit('verbose', 'Merging project\'s config.xml into platform-specific android config.xml');
// Merge changes from app's config.xml into platform's one
var config = new ConfigParser(locations.configXml);
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'android', /*clobber=*/true);
config.write();
return config;
}
shell.cp('-f', ownConfig, defaultConfig);
} else {
shell.cp('-f', sourceCfg, ownConfig);
}
// Then apply config changes from global munge to all config files
// in project (including project's config)
configMunger.reapply_global_munge().save_all();
// Merge changes from app's config.xml into platform's one
var config = new ConfigParser(ownConfig);
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'windows', /*clobber=*/true);
// CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
// we allow using windows8 tag for new windows platform
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
config.doc.getroot(), 'windows8', /*clobber=*/true);
config.write();
return config;
}
shell.cp('-f', defaultConfig, ownConfig);
} else if (fs.existsSync(ownConfig)) {
shell.cp('-f', ownConfig, defaultConfig);
} else {
shell.cp('-f', sourceCfg.path, ownConfig);
}
this._munger.reapply_global_munge().save_all();
this._config = new ConfigParser(ownConfig);
xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
this._config.doc.getroot(), this.platform, true);
// CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
// we allow using windows8 tag for new windows platform
if (this.platform == 'windows') {
xmlHelpers.mergeXml(cordovaProject.projectConfig.doc.getroot(),
this._config.doc.getroot(), 'windows8', true);
}
this._config.write();
// Update own www dir with project's www assets and plugins' assets and js-files
this._parser.update_www(cordovaProject.locations.www);
// update project according to config.xml changes.
return this._parser.update_project(this._config);
};