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-12107] Moved tiapp.xml validation into the actual build command s... #3630

Merged
merged 4 commits into from
Dec 22, 2012
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
3 changes: 3 additions & 0 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ exports.validate = function (logger, config, cli) {
i;

ti.validateProjectDir(logger, cli, cli.argv, 'project-dir');

ti.validateTiappXml(logger, cli.tiapp);

if (!ti.validateCorrectSDK(logger, config, cli, 'build')) {
// we're running the build command for the wrong SDK version, gracefully return
return false;
Expand Down
4 changes: 3 additions & 1 deletion iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ exports.validate = function (logger, config, cli) {

ti.validateProjectDir(logger, cli, cli.argv, 'project-dir');

ti.validateTiappXml(logger, cli.tiapp);

if (!ti.validateCorrectSDK(logger, config, cli, 'build')) {
// we're running the build command for the wrong SDK version, gracefully return
return false;
Expand Down Expand Up @@ -1911,7 +1913,7 @@ build.prototype = {
'__PROJECT_ID__': this.tiapp.id,
'__DEPLOYTYPE__': this.deployType,
'__APP_ID__': this.tiapp.id,
'__APP_ANALYTICS__': '' + !!this.tiapp.analytics,
'__APP_ANALYTICS__': '' + (this.tiapp.hasOwnProperty('analytics') ? !!this.tiapp.analytics : true),
'__APP_PUBLISHER__': this.tiapp.publisher,
'__APP_URL__': this.tiapp.url,
'__APP_NAME__': this.tiapp.name,
Expand Down
3 changes: 3 additions & 0 deletions mobileweb/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ exports.config = function (logger, config, cli) {

exports.validate = function (logger, config, cli) {
ti.validateProjectDir(logger, cli, cli.argv, 'project-dir');

ti.validateTiappXml(logger, cli.tiapp);

if (!ti.validateCorrectSDK(logger, config, cli, 'build')) {
// we're running the build command for the wrong SDK version, gracefully return
return false;
Expand Down
11 changes: 7 additions & 4 deletions support/cli/commands/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ exports.config = function (logger, config, cli) {
label: __('App ID'),
error: __('Invalid App ID'),
validator: function (id) {
if (!id) {
throw new appc.exception(__('Invalid app id'));
}
if (!/^([a-z_]{1}[a-z0-9_]*(\.[a-z_]{1}[a-z0-9_]*)*)$/.test(id)) {
throw new appc.exception(__('Invalid app id "%s"', tiapp.id), [
throw new appc.exception(__('Invalid app id "%s"', id), [
__('The app id must consist of letters, numbers, and underscores.'),
__('The first character must be a letter or underscore.'),
__("Usually the app id is your company's reversed Internet domain name. (i.e. com.example.myapp)")
Expand All @@ -84,8 +87,8 @@ exports.config = function (logger, config, cli) {
desc: __('the name of the project'),
prompt: {
label: __('Project name'),
error: __('Invalid project name'),
pattern: /^[A-Za-z]+[A-Za-z0-9_-]*$/
error: __('Invalid project name')
// pattern: /^[A-Za-z]+[A-Za-z0-9_-]*$/
},
required: true
},
Expand Down Expand Up @@ -148,7 +151,7 @@ exports.validate = function (logger, config, cli) {
}

cli.argv.name = (cli.argv.name || '').trim();
if (!/^[A-Za-z]+[A-Za-z0-9_-]*$/.test(cli.argv.name)) {
if (!cli.argv.name) { // !/^[A-Za-z]+[A-Za-z0-9_-]*$/.test(cli.argv.name)) {
logger.error(__('Invalid project name "%s"', cli.argv.name) + '\n');
logger.log(__('The project name must consist of letters, numbers, dashes, and underscores.'));
logger.log(__('The first character must be a letter.') + '\n');
Expand Down
34 changes: 31 additions & 3 deletions support/node_modules/titanium-sdk/lib/titanium.js

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