How to use the node-titanium-sdk.validateTiappXml 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 / commands / clean.js View on Github external
// load the tiapp.xml/timodule.xml
							if (fs.existsSync(path.join(projectDir, 'tiapp.xml'))) {
								let tiapp;
								try {
									tiapp = cli.tiapp = new tiappxml(path.join(projectDir, 'tiapp.xml'));
								} catch (ex) {
									logger.error(ex);
									logger.log();
									process.exit(1);
								}

								tiapp.properties || (tiapp.properties = {});

								// make sure the tiapp.xml is sane
								ti.validateTiappXml(logger, config, tiapp);

								// check that the Titanium SDK version is correct
								if (!ti.validateCorrectSDK(logger, config, cli, 'clean')) {
									throw new cli.GracefulShutdown();
								}

								cli.argv.type = 'app';

							} else if (fs.existsSync(path.join(projectDir, 'timodule.xml'))) {
								let timodule;
								try {
									timodule = cli.tiapp = cli.timodule = new tiappxml(path.join(projectDir, 'timodule.xml'));
								} catch (ex) {
									logger.error(ex);
									logger.log();
									process.exit(1);
github appcelerator / titanium_mobile / cli / commands / build.js View on Github external
// load the tiapp.xml/timodule.xml
								if (fs.existsSync(path.join(projectDir, 'tiapp.xml'))) {
									let tiapp;
									try {
										tiapp = cli.tiapp = new tiappxml(path.join(projectDir, 'tiapp.xml'));
									} catch (ex) {
										logger.error(ex);
										logger.log();
										process.exit(1);
									}

									tiapp.properties || (tiapp.properties = {});

									// make sure the tiapp.xml is sane
									ti.validateTiappXml(logger, config, tiapp);

									// check that the Titanium SDK version is correct
									if (!ti.validateCorrectSDK(logger, config, cli, 'build')) {
										throw new cli.GracefulShutdown();
									}

									cli.argv.type = 'app';

								} else if (fs.existsSync(path.join(projectDir, 'timodule.xml'))) {
									let timodule;
									try {
										timodule = cli.tiapp = cli.timodule = new tiappxml(path.join(projectDir, 'timodule.xml'));
									} catch (ex) {
										logger.error(ex);
										logger.log();
										process.exit(1);
github appcelerator / titanium_mobile / cli / lib / creators / applewatch.js View on Github external
projectDir = appc.fs.resolvePath(projectDir);

			// load the tiapp.xml
			try {
				this.tiapp = new tiappxml(path.join(projectDir, 'tiapp.xml'));
			} catch (ex) {
				logger.error(ex);
				logger.log();
				process.exit(1);
			}

			this.tiapp.properties || (this.tiapp.properties = {});

			// make sure the tiapp.xml is sane
			ti.validateTiappXml(this.logger, this.config, this.tiapp);

			// set the --name default to the app's name
			this.conf.options.name.default = appc.string.capitalize(this.tiapp.name);

			return projectDir;
		}.bind(this),
		desc: __('the directory containing the project'),