How to use the node-titanium-sdk.platforms function in node-titanium-sdk

To help you get started, we’ve selected a few node-titanium-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appcelerator / titanium_mobile / cli / lib / creators / app.js View on Github external
function AppCreator(logger, config, cli) { // eslint-disable-line no-unused-vars
	Creator.apply(this, arguments);

	this.title = __('Titanium App');
	this.titleOrder = 1;
	this.type = 'app';

	// build list of all valid platforms
	const availablePlatforms = {},
		validPlatforms = {};

	ti.platforms.forEach(function (platform) {
		if (/^iphone|ios|ipad$/.test(platform)) {
			validPlatforms['iphone'] = availablePlatforms['iphone'] = 1;
			validPlatforms['ipad'] = availablePlatforms['ipad'] = 1;
			validPlatforms['ios'] = 1;
		} else {
			validPlatforms[platform] = availablePlatforms[platform] = 1;
		}
	});

	// add "all"
	validPlatforms['all'] = 1;

	this.availablePlatforms = [ 'all' ].concat(Object.keys(availablePlatforms));
	this.validPlatforms = validPlatforms;
}
github appcelerator / titanium_mobile / cli / lib / creators / module.js View on Github external
function ModuleCreator(logger, config, cli) { // eslint-disable-line no-unused-vars
	Creator.apply(this, arguments);

	this.title = __('Titanium Module');
	this.titleOrder = 2;
	this.type = 'module';

	// build list of all valid platforms
	const availablePlatforms = {},
		validPlatforms = {};

	ti.platforms.forEach(function (platform) {
		if (/^iphone|ios|ipad$/.test(platform)) {
			validPlatforms['iphone'] = 1;
			validPlatforms['ipad'] = 1;
			validPlatforms['ios'] = availablePlatforms['ios'] = 1;
		} else {
			validPlatforms[platform] = availablePlatforms[platform] = 1;
		}
	});

	// add "all"
	validPlatforms['all'] = 1;

	this.availablePlatforms = [ 'all' ].concat(Object.keys(availablePlatforms));
	this.validPlatforms = validPlatforms;
}