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-16846] Forgot to add the changes for the tiapp.xml parser and fix... #5683

Merged
merged 1 commit into from
May 14, 2014
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
65 changes: 35 additions & 30 deletions mobileweb/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,38 @@ MobileWebBuilder.prototype.config = function config(logger, config, cli) {
};

if (process.platform == 'win32') {
function determineTargetSDK() {
// determine the target Windows Phone SDK version
var availableSDKs = Object.keys(_t.windowsInfo.windowsphone).sort().filter(function (v) { return _t.windowsInfo.windowsphone[v].supported; })
targetSDK = cli.tiapp['windows-phone'] && cli.tiapp['windows-phone']['target-sdk'];

if (!availableSDKs.length) {
logger.error(__('Unable to find any supported Windows Phone devices or emulators'));
logger.error(__('Run "ti info" for more info.') + '\n');
process.exit(1);
}

// make sure the target sdk is good
if (targetSDK && availableSDKs.indexOf(targetSDK) == -1) {
logger.error(__('Invalid Windows Phone Target SDK "%s"', targetSDK) + '\n');
logger.log(__('Available Target SDKs:'));
availableSDKs.forEach(function (ver) {
logger.log(' ' + String(ver).cyan);
});
logger.log();
process.exit(1);
}

// auto select the oldest, most compatible (in theory) version
if (!targetSDK) {
targetSDK = availableSDKs.shift();
}

cli.tiapp['windows-phone'] || (cli.tiapp['windows-phone'] = {});
cli.tiapp['windows-phone']['target-sdk'] = targetSDK;
return targetSDK;
}

conf.options['device-id'] = {
abbr: 'C',
callback: function (value) {
Expand All @@ -169,37 +201,9 @@ MobileWebBuilder.prototype.config = function config(logger, config, cli) {
desc: __('On Windows Phone 8, the device-id of the emulator/device to run the app in, "xd" for any emulator, or "de" for any device'),
order: 130,
prompt: function (callback) {
// determine the target Windows Phone SDK version
var availableSDKs = Object.keys(_t.windowsInfo.windowsphone).sort().filter(function (v) { return _t.windowsInfo.windowsphone[v].supported; })
targetSDK = cli.tiapp['windows-phone'] && cli.tiapp['windows-phone']['target-sdk'];

if (!availableSDKs.length) {
logger.error(__('Unable to find any supported Windows Phone devices or emulators'));
logger.error(__('Run "ti info" for more info.') + '\n');
process.exit(1);
}

// make sure the target sdk is good
if (targetSDK && availableSDKs.indexOf(targetSDK) == -1) {
logger.error(__('Invalid Windows Phone Target SDK "%s"', targetSDK) + '\n');
logger.log(__('Available Target SDKs:'));
availableSDKs.forEach(function (ver) {
logger.log(' ' + String(ver).cyan);
});
logger.log();
process.exit(1);
}

// auto select the oldest, most compatible (in theory) version
if (!targetSDK) {
targetSDK = availableSDKs.shift();
}

cli.tiapp['windows-phone'] || (cli.tiapp['windows-phone'] = {});
cli.tiapp['windows-phone']['target-sdk'] = targetSDK;

// get target sdk's devices
var devices = _t.windowsInfo.devices = _t.windowsInfo.windowsphone[targetSDK].devices;
var targetSDK = determineTargetSDK(),
devices = _t.windowsInfo.devices = _t.windowsInfo.windowsphone[targetSDK].devices;

if (!devices) {
cli.argv['build-only'] = true;
Expand All @@ -223,6 +227,7 @@ MobileWebBuilder.prototype.config = function config(logger, config, cli) {
}));
},
validate: function (value, callback) {
determineTargetSDK();
if (!value || (value != 'xd' && value != 'de' && _t.windowsInfo.devices && !_t.windowsInfo.devices[value])) {
return callback(new Error(__('Invalid device id: %s', value)));
}
Expand Down
22 changes: 22 additions & 0 deletions node_modules/titanium-sdk/lib/tiappxml.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.