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-11488] Fixed analytics event name for creating projects. #3277

Merged
merged 2 commits into from
Oct 18, 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
2 changes: 2 additions & 0 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ exports.validate = function (logger, config, cli) {
};

exports.run = function (logger, config, cli, finished) {
cli.argv.platform = 'ios';

if (cli.argv.xcode) {
// basically, we bypass the pre, post, and finalize hooks for xcode builds
var buildObj = new build(logger, config, cli, finished);
Expand Down
2 changes: 1 addition & 1 deletion support/cli/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ exports.validate = function (logger, config, cli) {
};

exports.run = function (logger, config, cli) {
var buildModule = path.join(path.dirname(module.filename), '..', '..', cli.argv.platform, 'cli', 'commands', '_build.js'),
var buildModule = path.join(__dirname, '..', '..', cli.argv.platform, 'cli', 'commands', '_build.js'),
tiapp = new ti.tiappxml(appc.fs.resolvePath(path.join(cli.argv['project-dir'], 'tiapp.xml')));

if (!appc.fs.exists(buildModule)) {
Expand Down
21 changes: 14 additions & 7 deletions support/cli/commands/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports.config = function (logger, config, cli) {
abbr: 'p',
desc: __('the target build platform'),
prompt: {
default: ti.availablePlatforms,
default: ti.availablePlatformsNames,
label: __('Target platforms'),
error: __('Invalid list of target platforms'),
validator: function (platforms) {
Expand All @@ -43,7 +43,7 @@ exports.config = function (logger, config, cli) {
},
},
required: true,
values: ti.availablePlatforms,
values: ti.availablePlatformsNames,
skipValueCheck: true // we do our own validation
},
type: {
Expand Down Expand Up @@ -146,8 +146,14 @@ exports.run = function (logger, config, cli) {
projectConfig.version = '1.0';
projectConfig.guid = uuid.v4();
projectConfig['deployment-targets'] = {};
ti.availablePlatforms.forEach(function (p) {
projectConfig['deployment-targets'][p] = platforms.indexOf(p) != -1;
if (platforms.indexOf('ios') != -1) {
platforms.indexOf('ipad') != -1 || platforms.push('ipad');
platforms.indexOf('iphone') != -1 || platforms.push('iphone');
}
ti.availablePlatformsNames.forEach(function (p) {
if (p != 'ios') {
projectConfig['deployment-targets'][p] = platforms.indexOf(p) != -1;
}
});
projectConfig['sdk-version'] = sdk.name;
projectConfig.save(projectDir + '/tiapp.xml');
Expand Down Expand Up @@ -180,6 +186,8 @@ exports.run = function (logger, config, cli) {
runtime: '1.0',
date: (new Date()).toDateString()
};

cli.addAnalyticsEvent('project.create.mobile', analyticsPayload);
} else if (type == 'module') {
logger.info(__('Creating Titanium Mobile module project'));

Expand Down Expand Up @@ -230,6 +238,8 @@ exports.run = function (logger, config, cli) {
platforms: platforms.sort().join(', '),
date: (new Date()).toDateString()
};

cli.addAnalyticsEvent('project.create.module', analyticsPayload);
}

platforms.forEach(function (platform) {
Expand All @@ -240,7 +250,4 @@ exports.run = function (logger, config, cli) {
});

logger.info(__("Project '%s' created successfully in %s", projectName.cyan, appc.time.prettyDiff(cli.startTime, Date.now())) + '\n');

// This will be something like 'project.create.app' ... do we want it to be something like 'project.create.mobile' like studio?
cli.addAnalyticsEvent('project.create.' + cli.argv.type, analyticsPayload);
};