mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
parent
d6fe1a65eb
commit
3a1b4ffcb8
7
bin/templates/cordova/lib/prepare.js
vendored
7
bin/templates/cordova/lib/prepare.js
vendored
@ -32,7 +32,6 @@ var PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger;
|
|||||||
var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
|
var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
|
||||||
|
|
||||||
module.exports.prepare = function (cordovaProject, options) {
|
module.exports.prepare = function (cordovaProject, options) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var platformResourcesDir = path.relative(cordovaProject.root, path.join(this.locations.root, 'res'));
|
var platformResourcesDir = path.relative(cordovaProject.root, path.join(this.locations.root, 'res'));
|
||||||
|
|
||||||
@ -57,18 +56,18 @@ module.exports.prepare = function (cordovaProject, options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports.clean = function (options) {
|
module.exports.clean = function (options) {
|
||||||
|
|
||||||
// A cordovaProject isn't passed into the clean() function, because it might have
|
// A cordovaProject isn't passed into the clean() function, because it might have
|
||||||
// been called from the platform shell script rather than the CLI. Check for the
|
// been called from the platform shell script rather than the CLI. Check for the
|
||||||
// noPrepare option passed in by the non-CLI clean script. If that's present, or if
|
// noPrepare option passed in by the non-CLI clean script. If that's present, or if
|
||||||
// there's no config.xml found at the project root, then don't clean prepared files.
|
// there's no config.xml found at the project root, then don't clean prepared files.
|
||||||
var projectRoot = path.resolve(this.root, '../..');
|
var projectRoot = path.resolve(this.root, '../..');
|
||||||
var projectConfigFile = path.join(projectRoot, 'config.xml');
|
var projectConfigFile = path.join(projectRoot, 'config.xml');
|
||||||
if ((options && options.noPrepare) || !fs.existsSync(projectConfigFile)) {
|
if ((options && options.noPrepare) || !fs.existsSync(projectConfigFile) ||
|
||||||
|
!fs.existsSync(this.locations.configXml)) {
|
||||||
return Q();
|
return Q();
|
||||||
}
|
}
|
||||||
|
|
||||||
var projectConfig = new ConfigParser(projectConfigFile);
|
var projectConfig = new ConfigParser(this.locations.configXml);
|
||||||
var platformResourcesDir = path.relative(projectRoot, path.join(this.locations.root, 'res'));
|
var platformResourcesDir = path.relative(projectRoot, path.join(this.locations.root, 'res'));
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
Loading…
Reference in New Issue
Block a user