Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-15198] [TIMOB-14884] iOS bugs and support files for Android build #4723

Merged
merged 3 commits into from
Sep 20, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions android/cli/lib/detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* Please see the LICENSE included with this distribution for details.
*/

var android = require('titanium-sdk/lib/android')
var android = require('titanium-sdk/lib/android'),
appc = require('node-appc');

/**
* Detects current Android environment.
Expand All @@ -20,4 +21,8 @@ var android = require('titanium-sdk/lib/android')
* @param {Object} opts - Detection options; currently only 'bypassCache'
* @param {Function} finished - Callback when detection is finished
*/
exports.detect = android.detect;
exports.detect = function detect(config, opts, finished) {
opts || (opts = {});
opts.packageJson = appc.pkginfo.package(module);
android.detect(config, opts, finished);
};
14 changes: 9 additions & 5 deletions android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
"name": "titanium-mobile-android",
"title": "Android",
"description": "Appcelerator Titanium Mobile Android",
"minSDKToolsVersion": "22",
"minSDKPlatformToolsVersion": "16",
"minSDKBuildToolsVersion": "16",
"minAPILevel": "10",
"maxAPILevel": "17",
"keywords": [
"appcelerator",
"titanium",
Expand All @@ -23,6 +18,15 @@
"Allen Yeung <ayeung@appcelerator.com>",
"Chris Barber <cbarber@appcelerator.com>"
],
"vendorDependencies": {
"android sdk": ">=10 <=18",
"android build tools": "<18.x",
"android platform tools": "<=18.x",
"android tools": "<=22.x",
"android ndk": "r8e",
"node": ">0.8.0 <=0.10.x",
"java": "<1.8"
},
"repository": {
"type": "git",
"url": "git://github.com/appcelerator/titanium_mobile_android.git"
Expand Down
640 changes: 323 additions & 317 deletions iphone/cli/commands/_build.js

Large diffs are not rendered by default.

50 changes: 26 additions & 24 deletions iphone/cli/lib/detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ exports.detect = function detect(config, opts, finished) {
selected: dir == selectedXcodePath,
version: p.CFBundleShortVersionString,
build: p.ProductBuildVersion,
supported: appc.version.gte(p.CFBundleShortVersionString, iosPackageJson.minXcodeVersion)
? (appc.version.lt(p.CFBundleShortVersionString, iosPackageJson.maxXcodeVersion + '.9999') ? true : 'maybe') : false,
supported: appc.version.satisfies(p.CFBundleShortVersionString, iosPackageJson.vendorDependencies.xcode, true),
sdks: null,
sims: null
};
Expand All @@ -190,14 +189,14 @@ exports.detect = function detect(config, opts, finished) {
id: 'IOS_XCODE_TOO_OLD',
type: 'warning',
message: __('Xcode %s is too old and is no longer supported by Titanium SDK %s.', '__' + info.version + '__', manifestJson.version) + '\n' +
__('The minimumm supported Xcode version by Titanium SDK %s is Xcode %s.', manifestJson.version, iosPackageJson.minXcodeVersion)
__('The minimumm supported Xcode version by Titanium SDK %s is Xcode %s.', manifestJson.version, appc.version.parseMin(iosPackageJson.vendorDependencies.xcode))
});
} else if (info.supported == 'maybe') {
issues.push({
id: 'IOS_XCODE_TOO_NEW',
type: 'warning',
message: __('Xcode %s is too new and may or may not work with Titanium SDK %s.', '__' + info.version + '__', manifestJson.version) + '\n' +
__('The maximum supported Xcode version by Titanium SDK %s is Xcode %s.', manifestJson.version, iosPackageJson.maxXcodeVersion) + '\n'
__('The maximum supported Xcode version by Titanium SDK %s is Xcode %s.', manifestJson.version, appc.version.parseMax(iosPackageJson.vendorDependencies.xcode)) + '\n'
});
}

Expand Down Expand Up @@ -246,26 +245,17 @@ exports.detect = function detect(config, opts, finished) {
}
},

xcodeCLIToolsInstalled: function (done) {
var check = function (installed) {
if (!installed) {
issues.push({
id: 'IOS_XCODE_CLI_TOOLS_NOT_INSTALLED',
type: 'error',
message: __('The Xcode Command Line Tools are not installed.') + '\n' +
__('Titanium requires that the Xcode Command Line Tools be installed.') + '\n' +
__('You can install them from the Xcode Preferences > Downloads tab.')
});
}
done(null, installed);
}

xcodeCLITools: function (done) {
if (executables.pkgutil) {
run(executables.pkgutil, '--pkg-info=com.apple.pkg.DeveloperToolsCLI', function (err, stdout, stderr) {
check(!err);
if (!err) {
var m = stdout.match(/version: (.+)/m);
if (m) return done(null, m[1]);
}
done(null, false);
});
} else {
check(false);
done(null, false);
}
},

Expand Down Expand Up @@ -573,11 +563,23 @@ exports.detect = function detect(config, opts, finished) {
}, function (err, results) {
appc.util.mix(results, executables);

var xcodeCLIToolsVersion = appc.version.format(results.xcodeCLITools, 2, 2),
notInstalled = [];
Object.keys(results.xcode).forEach(function (name) {
var installed = results.xcode[name].cliTools = appc.version.gte(xcodeCLIToolsVersion, appc.version.format(results.xcode[name].version, 2, 2));
installed || notInstalled.push(results.xcode[name].version);
});
if (notInstalled.length) {
issues.push({
id: 'IOS_XCODE_CLI_TOOLS_NOT_INSTALLED',
type: 'error',
message: __('The Xcode Command Line Tools are not installed for the following Xcode versions: %s.', notInstalled.join(', ')) + '\n' +
__('Titanium requires that the Xcode Command Line Tools be installed.') + '\n' +
__('You can install them from the Xcode Preferences > Downloads tab.')
});
}

results.detectVersion = '2.0';
results.minIosSdkVersion = iosPackageJson.minIosSdkVersion;
results.maxIosSdkVersion = iosPackageJson.maxIosSdkVersion;
results.minXcodeVersion = iosPackageJson.minXcodeVersion;
results.maxXcodeVersion = iosPackageJson.maxXcodeVersion;
results.issues = issues;

finished(envCache = results);
Expand Down
9 changes: 5 additions & 4 deletions iphone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"name": "titanium-mobile-ios",
"title": "iOS",
"description": "Appcelerator Titanium Mobile iOS",
"minIosSdkVersion": "5.0",
"maxIosSdkVersion": "6.1",
"minXcodeVersion": "4.3",
"maxXcodeVersion": "4.6",
"keywords": [
"appcelerator",
"titanium",
Expand All @@ -22,6 +18,11 @@
"Vishal Duggal <vduggal@appcelerator.com>",
"Chris Barber <cbarber@appcelerator.com>"
],
"vendorDependencies": {
"xcode": ">=4.3 <=5.0.x",
"ios sdk": ">=5.0 <=6.x",
"node": ">0.8.0 <=0.10.x"
},
"repository": {
"type": "git",
"url": "git://github.com/appcelerator/titanium_mobile_ios.git"
Expand Down
4 changes: 4 additions & 0 deletions mobileweb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"Chris Barber <cbarber@appcelerator.com>",
"Bryan Hughes <bhughes@appcelerator.com>"
],
"vendorDependencies": {
"node": ">0.8.0 <=0.10.x",
"java": "<=1.6.x"
},
"repository": {
"type": "git",
"url": "git://github.com/appcelerator/titanium_mobile_web.git"
Expand Down
25 changes: 20 additions & 5 deletions support/cli/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var appc = require('node-appc'),

// TODO: need to support building modules... how do we know if --dir is a module or app? where is the module _build.js located?

exports.cliVersion = '>=3.X';
exports.cliVersion = '>=3.2';
exports.title = __('Build');
exports.desc = __('builds a project');
exports.extendedDesc = 'Builds an existing app or module project.';
Expand Down Expand Up @@ -108,10 +108,25 @@ exports.validate = function (logger, config, cli) {
cli.argv.type = 'app';

ti.validatePlatform(logger, cli, 'platform');
if (ti.validatePlatformOptions(logger, config, cli, 'build') === false) {
return false;
}
ti.loadPlugins(logger, cli, config, cli.argv['project-dir']);

return function (finished) {
function next(result) {
if (result !== false) {
ti.loadPlugins(logger, config, cli, cli.argv['project-dir'], function () {
finished(result);
});
} else {
finished(result);
}
}

var result = ti.validatePlatformOptions(logger, config, cli, 'build');
if (result && typeof result == 'function') {
result(next);
} else {
next(result);
}
};
};

exports.run = function (logger, config, cli) {
Expand Down
15 changes: 10 additions & 5 deletions support/cli/commands/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var appc = require('node-appc'),
wrench = require('wrench'),
async = require('async');

exports.cliVersion = '>=3.X';
exports.cliVersion = '>=3.2';
exports.desc = __('removes previous build directories');

exports.config = function (logger, config, cli) {
Expand Down Expand Up @@ -50,7 +50,7 @@ exports.validate = function (logger, config, cli) {
var platforms = cli.argv.platforms || cli.argv.platform;
if (platforms) {
platforms = ti.scrubPlatforms(platforms);

if (platforms.bad.length) {
logger.error(__n('Invalid platform: %%s', 'Invalid platforms: %%s', platforms.bad.length, platforms.bad.join(', ')) + '\n');
logger.log(__('Available platforms for SDK version %s:', ti.manifest.sdkVersion) + '\n');
Expand All @@ -60,14 +60,19 @@ exports.validate = function (logger, config, cli) {
logger.log();
process.exit(1);
}

cli.argv.platforms = platforms.scrubbed;
} else {
cli.argv.platforms = null;
}

ti.validateProjectDir(logger, cli, cli.argv, 'project-dir');
ti.loadPlugins(logger, cli, config, cli.argv['project-dir']);

return function (finished) {
ti.loadPlugins(logger, config, cli, cli.argv['project-dir'], function () {
finished();
});
};
};

exports.run = function (logger, config, cli) {
Expand Down