Merge branch 'ios-build' into devel

Allows to build projects with 'ios' platform included on linux machines that
cannot build for iOS. Creates an easier workaround for #2867.
This commit is contained in:
Slava Kim
2014-10-21 12:34:25 -07:00
2 changed files with 10 additions and 0 deletions

View File

@@ -79,6 +79,13 @@ cordova.buildTargets = function (localPath, targets, options) {
verboseLog('Running build for platforms:', platforms);
checkRequestedPlatforms(platforms);
platforms = _.filter(platforms, function (platform) {
if (! _.contains(availablePlatforms, platform)) {
Console.warn(platform + ': skipping platform not available on your system');
return false;
}
return true;
});
_.each(platforms, function (platform) {
requirePlatformReady(platform);

View File

@@ -733,6 +733,8 @@ var buildCommand = function (options) {
appName: appName
}));
} catch (err) {
if (err instanceof main.ExitWithCode)
throw err;
Console.printError(err, "Error while building for mobile platforms");
return 1;
}
@@ -814,6 +816,7 @@ var buildCommand = function (options) {
var platformPath = path.join(outputPath, platformName);
if (platformName === 'ios') {
if (process.platform !== 'darwin') return;
files.cp_r(buildPath, path.join(platformPath, 'project'));
fs.writeFileSync(
path.join(platformPath, 'README'),