How to use the node-titanium-sdk/lib/builder.prototype 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 / android / cli / commands / _buildModule.js View on Github external
AndroidModuleBuilder.prototype.run = async function run(logger, config, cli, finished) {
	try {
		// Call the base builder's run() method.
		Builder.prototype.run.apply(this, arguments);

		// Notify plugins that we're about to begin.
		await new Promise((resolve) => {
			cli.emit('build.module.pre.construct', this, resolve);
		});

		// Update module's config files, if necessary.
		await this.migrate();

		// Post build anlytics.
		await this.doAnalytics();

		// Initialize build variables and directory.
		await this.initialize();
		await this.loginfo();
		await this.cleanup();
github appcelerator / titanium_mobile_windows / cli / commands / _build / validate.js View on Github external
function validate(logger, config, cli) {
	Builder.prototype.validate.apply(this, arguments);

	this.target = cli.argv.target;
	this.wpsdk  = this.getWindowsSDKTarget();
	this.deployType = !/^dist-$/.test(this.target) && cli.argv['deploy-type'] ? cli.argv['deploy-type'] : this.deployTypes[this.target];
	this.buildType = cli.argv['build-type'] || '';

	if (this.wpsdk == '8.1') {
		logger.warn(__('Support for Windows 8.1 and Windows Phone 8.1 SDKs has been dropped as of Titanium SDK 6.3.0.GA, and will be removed in Titanium SDK 7.0.0.GA'));
	}

	// ti.deploytype is deprecated and so we force the real deploy type
	if (cli.tiapp.properties['ti.deploytype']) {
		logger.warn(__('The %s tiapp.xml property has been deprecated, please use the %s option', 'ti.deploytype'.cyan, '--deploy-type'.cyan));
	}
	cli.tiapp.properties['ti.deploytype'] = {type: 'string', value: this.deployType};
github appcelerator / titanium_mobile / mobileweb / cli / commands / _build.js View on Github external
MobileWebBuilder.prototype.config = function config(logger, config, cli) {
	Builder.prototype.config.apply(this, arguments);

	// we need to load all Mobile Web hooks immediately so that the hooks can
	// modify the config. the cli will do this, but only after config() has
	// been called.
	cli.scanHooks(path.resolve(__dirname, '..', 'hooks'));

	// make sure we have Java before we waste time validating the command line arguments
	cli.on('cli:pre-validate', function (obj, callback) {
		if (cli.argv.platform && cli.argv.platform != 'mobileweb') {
			return callback();
		}

		appc.jdk.detect(config, null, function (jdkInfo) {
			if (!jdkInfo.executables.java) {
				logger.error(__('Unable to locate Java'));
				logger.error(__("If you already have Java installed, make sure it's in the system PATH"));
github appcelerator / titanium_mobile / android / cli / commands / _buildModule.js View on Github external
AndroidModuleBuilder.prototype.validate = function validate(logger, config, cli) {
	Builder.prototype.config.apply(this, arguments);
	Builder.prototype.validate.apply(this, arguments);

	return function (finished) {
		this.projectDir = cli.argv['project-dir'];
		this.buildOnly = cli.argv['build-only'];

		this.cli = cli;
		this.logger = logger;
		fields.setup({ colors: cli.argv.colors });

		this.manifest = this.cli.manifest;

		// detect android environment
		androidDetect(config, { packageJson: this.packageJson }, function (androidInfo) {
			this.androidInfo = androidInfo;

			if (!this.androidInfo.ndk) {
github appcelerator / titanium_mobile / android / cli / commands / _buildModule.js View on Github external
AndroidModuleBuilder.prototype.validate = function validate(logger, config, cli) {
	Builder.prototype.config.apply(this, arguments);
	Builder.prototype.validate.apply(this, arguments);

	return function (finished) {
		this.projectDir = cli.argv['project-dir'];
		this.buildOnly = cli.argv['build-only'];

		this.cli = cli;
		this.logger = logger;
		fields.setup({ colors: cli.argv.colors });

		this.manifest = this.cli.manifest;

		// detect android environment
		androidDetect(config, { packageJson: this.packageJson }, function (androidInfo) {
			this.androidInfo = androidInfo;
github appcelerator / titanium_mobile / iphone / cli / commands / _buildModule.js View on Github external
iOSModuleBuilder.prototype.validate = function validate(logger, config, cli) {
	Builder.prototype.config.apply(this, arguments);
	Builder.prototype.validate.apply(this, arguments);

	// cli.manifest is set by the --project-dir option's callback in cli/commands/build.js
	this.manifest      = cli.manifest;
	this.moduleId      = cli.manifest.moduleid;
	this.moduleName    = cli.manifest.name;
	this.moduleIdAsIdentifier = this.scrubbedModuleId();
	this.moduleVersion = cli.manifest.version;
	this.moduleGuid    = cli.manifest.guid;
	this.isFramework   = fs.existsSync(path.join(this.projectDir, 'Info.plist')); // TODO: There MUST be a better way to determine if it's a framework (Swift)

	this.buildOnly     = cli.argv['build-only'];
	this.xcodeEnv      = null;

	const sdkModuleAPIVersion = cli.sdk.manifest && cli.sdk.manifest.moduleAPIVersion && cli.sdk.manifest.moduleAPIVersion['iphone'];
	if (this.manifest.apiversion && sdkModuleAPIVersion && this.manifest.apiversion !== sdkModuleAPIVersion) {
		logger.error(__('The module manifest apiversion is currently set to %s', this.manifest.apiversion));
github appcelerator / titanium_mobile / mobileweb / cli / commands / _build.js View on Github external
MobileWebBuilder.prototype.run = function run(logger, config, cli, finished) {
	Builder.prototype.run.apply(this, arguments);

	appc.async.series(this, [
		function (next) {
			cli.emit('build.pre.construct', this, next);
		},

		'doAnalytics',
		'initialize',

		function (next) {
			cli.emit('build.pre.compile', this, next);
		},

		'createBuildDirs',

		function (next) {
github appcelerator / titanium_mobile_windows / cli / commands / _build / run.js View on Github external
function run(logger, config, cli, finished) {
	Builder.prototype.run.apply(this, arguments);

	appc.async.series(this, [
		function (next) {
			cli.emit('build.pre.construct', this, next);
		},

		'doAnalytics',
		'initialize',
		'loginfo',
		'computeHashes',
		'readBuildManifest',
		'checkIfNeedToRecompile',
		'generateBuildVersion',

		function (next) {
			cli.emit('build.pre.compile', this, next);
github appcelerator / titanium_mobile / iphone / cli / commands / _buildModule.js View on Github external
iOSModuleBuilder.prototype.run = function run(logger, config, cli, finished) {
	Builder.prototype.run.apply(this, arguments);

	series(this, [
		function (next) {
			cli.emit('build.module.pre.construct', this, next);
		},

		'doAnalytics',
		'initialize',
		'loginfo',

		function (next) {
			cli.emit('build.module.pre.compile', this, next);
		},

		'processLicense',
		'processTiXcconfig',
github appcelerator / titanium_mobile_windows / cli / commands / _build / config.js View on Github external
function config(logger, config, cli) {
	Builder.prototype.config.apply(this, arguments);

	var target = (cli.argv['target'] || cli.argv['T']),
		vstarget = (cli.argv['vs-target'] || cli.argv['V']);

	this.windowslibOptions = {
		powershell: config.get('windows.executables.powershell'),
		pvk2pfx: config.get('windows.executables.pvk2pfx'),
		preferredWindowsPhoneSDK: config.get('windows.wpsdk.selectedVersion'),
		preferredWindowsSDK: config.get('windows.sdk.selectedVersion'),
		preferredVisualStudio: vstarget || config.get('windows.visualstudio.selectedVersion'),
		supportedMSBuildVersions: windowsPackageJson.vendorDependencies['msbuild'],
		supportedVisualStudioVersions: windowsPackageJson.vendorDependencies['visual studio'],
		supportedWindowsPhoneSDKVersions: windowsPackageJson.vendorDependencies['windows phone sdk'],
		supportedWindows10SDKVersions: windowsPackageJson.vendorDependencies['windows 10 sdk'],
		tasklist: config.get('windows.executables.tasklist'),
		skipWpTool: cli.argv['build-only'] || (target !== 'wp-device' && target !== 'wp-emulator' && target !== undefined && this.targets.indexOf(target) !== -1)