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

Lots of updates #50

Merged
merged 66 commits into from
Aug 2, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
86abaf3
[TIMOB-11869] [TIMOB-11267] Major surgery to the CLI architecture. Ad…
cb1kenobi Jun 9, 2013
0f2d938
[TIMOB-11869] [TIMOB-11267] More work on the validate step.
cb1kenobi Jun 9, 2013
c3ff972
[TIMOB-11869] [TIMOB-11267] Validation done. More work on getting the…
cb1kenobi Jun 10, 2013
adb71e6
[TIMOB-11869] [TIMOB-11267] Wired up the prompting. Need to start fix…
cb1kenobi Jun 11, 2013
45e94a4
[TIMOB-11869] [TIMOB-11267] Fixed support for subcommands and command…
cb1kenobi Jun 12, 2013
4149cb2
[TIMOB-11869] [TIMOB-11267] Fixed command and subcommand parsing to t…
cb1kenobi Jun 12, 2013
7fcc7b9
[TIMOB-11869] [TIMOB-11267] Finished sdk command. Lots of bug fixes.
cb1kenobi Jun 13, 2013
4d769af
Small fixes.
cb1kenobi Jun 13, 2013
6ffd009
[TIMOB-11869] [TIMOB-11267] Finished up the plugin and module commands.
cb1kenobi Jun 14, 2013
2de45c6
[TIMOB-11869] [TIMOB-11267] Bug fixes. Moved all command loading logi…
cb1kenobi Jun 15, 2013
dc98b49
[TIMOB-11869] [TIMOB-11267] More work on the help command.
cb1kenobi Jun 15, 2013
cf97db7
[TIMOB-11869] [TIMOB-11267] Finished moving command loading code to t…
cb1kenobi Jun 18, 2013
7ae79b1
[TIMOB-11869] [TIMOB-11267] Bug fixes. Removed debug code. Better han…
cb1kenobi Jun 18, 2013
6983b15
[TIMOB-11869] [TIMOB-11267] Bug fixes with missing options. Add platf…
cb1kenobi Jun 18, 2013
4bd15ef
[TIMOB-11869] [TIMOB-11267] Doc updates.
cb1kenobi Jun 18, 2013
708a9ed
[TIMOB-11869] [TIMOB-11267] Work on the setup command. Bug fixes and …
cb1kenobi Jun 19, 2013
5ba9432
[TIMOB-11869] [TIMOB-11267] Bug fixes in main titanium.js when .titan…
cb1kenobi Jun 21, 2013
45be6b6
[TIMOB-11869] [TIMOB-11267] More work on the info command.
cb1kenobi Jun 21, 2013
e0e1ab2
[TIMOB-11869] [TIMOB-11267] Some bug fixes in the info command. Updat…
cb1kenobi Jun 21, 2013
a82d1fa
[TIMOB-11869] [TIMOB-11267] Added support for async command validate(…
cb1kenobi Jun 23, 2013
f03023a
[TIMOB-11869] [TIMOB-11267] Finished up the info command.
cb1kenobi Jun 24, 2013
8b54230
[TIMOB-11869] [TIMOB-11267] Updated api docs.
cb1kenobi Jun 24, 2013
505f801
[TIMOB-11869] [TIMOB-14398] Added config.getDefaults(). Added ignoreD…
cb1kenobi Jun 28, 2013
eb0d665
[TIMOB-11869] Small code cleanup, mostly with i18n stuff.
cb1kenobi Jul 1, 2013
b209a26
[TIMOB-11869] Updated i18n files.
cb1kenobi Jul 1, 2013
ea5bea1
[TIMOB-11869] Added analyticsUrl to send() analytics args.
cb1kenobi Jul 2, 2013
14dff9f
[TIMOB-11869] Updated to latest node-appc auth api.
cb1kenobi Jul 3, 2013
46e662f
[TIMOB-11869] Changed mixObj() signature.
cb1kenobi Jul 4, 2013
c70fbec
[TIMOB-11869] Small bug fixes.
cb1kenobi Jul 8, 2013
8e0fb71
[TIMBO-11869] Added the forge tools and the start of the hook unit test.
cb1kenobi Jul 9, 2013
cc6b571
[TIMOB-11869] Finished unit test for hooks.
cb1kenobi Jul 9, 2013
27cd4d6
[TIMOB-11869] Added __lib() function that helps choose the lib or lib…
cb1kenobi Jul 9, 2013
6ff9f1e
[TIMOB-11869] Work on the context unit test. Small bug fixes. Added -…
cb1kenobi Jul 11, 2013
6c35b3c
[TIMOB-11869] Fixed platform specific hook loading. Removed adm-zip d…
cb1kenobi Jul 12, 2013
229ed02
[TIMOB-11869] Moved renderColumns() to node-appc.
cb1kenobi Jul 12, 2013
b304336
[TIMOB-11869] Removed parseGlobalArgs and moved the logic to the main…
cb1kenobi Jul 15, 2013
a8ffac2
[TIMOB-11869] Fixed bug with option values being defaulted too early.…
cb1kenobi Jul 16, 2013
e5421ad
[TIMOB-11869] Context unit test fixes.
cb1kenobi Jul 16, 2013
3c4d9d0
[TIMOB-11869] Removed docs.
cb1kenobi Jul 16, 2013
fb33a5b
[TIMOB-11869] Added haxm info to info command. Updated ignoreDirs.
cb1kenobi Jul 18, 2013
56c3068
[TIMOB-11869] Bug fixes.
cb1kenobi Jul 18, 2013
4b91620
[TIMOB-11869] Bug fix.
cb1kenobi Jul 18, 2013
76f9fb9
[TIMOB-11869] Another bug fix.
cb1kenobi Jul 18, 2013
82c309c
[TIMOB-11869] Sped up the help command by not loading the entire comm…
cb1kenobi Jul 18, 2013
b5d7dd1
[TIMOB-11869] Bug fixes. More unit test work.
cb1kenobi Jul 18, 2013
4fc5dd5
[TIMOB-11869] More work on the setup command. This commit has issues.
cb1kenobi Jul 24, 2013
a0fa172
[TIMOB-11869] Work on the setup command. Bug fixes with the locale an…
cb1kenobi Jul 24, 2013
f6afef1
[TIMOB-11869] Work.
cb1kenobi Jul 24, 2013
ffacbdf
[TIMOB-11869] Fixes for windows. Cleanup in info command. More work o…
cb1kenobi Jul 25, 2013
b68d742
[TIMOB-11869] Removed doc tools since it's gonna change anyways.
cb1kenobi Jul 25, 2013
cd28d98
[TIMOB-11869] Finished setup check. Bug fixes and small tweaks.
cb1kenobi Jul 26, 2013
18858bc
[TIMOB-11869] Updated i18n strings.
cb1kenobi Jul 26, 2013
0a53fd6
[TIMOB-11869] Fixed typo.
cb1kenobi Jul 29, 2013
772355b
[TIMOB-11869] Fixed whitespace.
cb1kenobi Jul 29, 2013
aa0a596
[TIMOB-11869] Bumped request module version. Fixed bug with --platfor…
cb1kenobi Jul 30, 2013
a6d5150
[TIMOB-11869] Bumped fields version.
cb1kenobi Jul 30, 2013
fdbd983
[TIMOB-11869] Updated readme.
cb1kenobi Jul 30, 2013
215a4c9
[TIMOB-11869] Fixed bug with sdk install command.
cb1kenobi Jul 30, 2013
f0c45f5
[TIMOB-11869] Added the config param to the plugin and module detecti…
cb1kenobi Jul 30, 2013
63a0d6f
Updated to the latest fields module.
cb1kenobi Jul 31, 2013
9a1515e
[TIMOB-13079] Fixed bug with config command not properly displaying s…
cb1kenobi Jul 31, 2013
53a6fa3
[TIMOB-11869] [TIMOB-13511] Fixed bug with command/platform specific …
cb1kenobi Jul 31, 2013
5bc9efa
[TIMOB-11869] Fixed missing semicolons.
cb1kenobi Aug 1, 2013
2d80a02
[TIMOB-13633] Fixed bug with cancelling an sdk uninstall proceeds to …
cb1kenobi Aug 2, 2013
6c59cd7
[TIMOB-11869] Fixed bug where default platform option handling was in…
cb1kenobi Aug 2, 2013
d26179f
[TIMOB-11869] Fixed bug with sdk install command not working on Windo…
cb1kenobi Aug 2, 2013
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
._*
.DS_Store
npm-debug.log
node_modules
node_modules
lib-cov
coverage.html
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
node_modules
*.sublime-project
*.sublime-workspace
docs
tests
lib-cov
coverage.html
forge
forge-tools
149 changes: 126 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,54 @@
## Overview

[Titanium](https://github.com/appcelerator/titanium) is a [Command Line Tool (CLI)](http://en.wikipedia.org/wiki/Command-line_interface)
for managing and deploying Titanium Mobile applications and modules. It's open-source and easy to use. [We've](https://github.com/appcelerator)
designed Titanium to be suitable for command line beginners, but still be powerful and extensible enough for production usage.
[Titanium CLI](https://github.com/appcelerator/titanium) is a
[Command Line Tool](http://en.wikipedia.org/wiki/Command-line_interface)
for creating and building Titanium Mobile applications and modules. It's
open-source and easy to use. [We've](https://github.com/appcelerator)
designed Titanium to be suitable for command line beginners, but still be
powerful and extensible enough for production usage.

## Installation
## Prerequisites

[sudo] npm install titanium -g
The Titanium CLI requires [Node.js 0.8.x](http://nodejs.org/dist/). You can
download Node.js 0.10.x, but only Titanium SDK 3.1.0 and later will work.

After npm download and installs the Titanium CLI, then you need to download the latest unstable Titanium Mobile SDK:
## Installation

titanium sdk install --branch 3_0_X --default
[sudo] npm install -g titanium

## Bleeding Edge

You can download the latest and greatest *unstable* code by running the following:
You can download the latest and greatest *unstable* Titanium CLI code by
running the following:

[sudo] npm install -g git://github.com/appcelerator/titanium.git

## Obtaining a Titanium SDK

You will need to download a Titanium SDK 3.0 or newer:

# stable release (recommended)
titanium sdk install --default

There are times when the latest stable release has an issue or lacks a feature
in which case you may want to try an unstable Titanium SDK build. These builds
are not recommended for production use, but should work for development.

# unstable next release
titanium sdk install --branch 3_1_X --default

# bleeding edge
titanium sdk install --branch master --default

## Setting up the Titanium CLI

[sudo] npm install git://github.com/appcelerator/titanium.git -g
Before you begin using the Titanium CLI, you should configure it by running the
"setup" command:

titanium setup

It will prompt you with a number of questions such as your e-mail address (for
logging into the Appcelerator Network), the location of your Android SDK, and so on.

## Usage

Expand Down Expand Up @@ -125,40 +157,111 @@ Download and install the latest version for the specified branch if not already

titanium sdk update --branch master

### status
### setup

Checks authentication, SDK, and project status.
Reconfigures the Titanium CLI by asking you a series of questions.

**Implementation not complete**
titanium setup

### status

Indicates whether you are logged in or not.

titanium status

titanium status --dir /path/to/project
titanium status --output json

### version

Displays the current version of the CLI and exits.

titanium version
titanium -v

titanium --version

## Looking for the old CLI?
### info

Don't worry, it's still around. You can install it by running:
Displays information about your development environment including Xcode installs,
iOS SDKs, Android SDKs, and so on.

sudo npm install –g titanium@0.0.26
titanium info

## Contributing
titanium info -o json

Titanium is an open source project. Titanium wouldn't be where it is now without contributions by the community. Please consider forking this repo to improve, enhance or fix issues. If you feel like the community will benefit from your fork, please open a pull request.
## Hacking the Titanium CLI

To protect the interests of the Titanium contributors, Appcelerator, customers and end users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is simple and straightforward - it requires that the contributions you make to any Appcelerator open source project are properly licensed and that you have the legal authority to make those changes. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes only a few minutes, and only needs to be completed once.
In order to begin hacking on the Titanium CLI, you need to download and install
[git](http://git-scm.com/).

If you have already installed a previous version of the Titanium CLI, it's
recommended you uninstall the old one first:

[sudo] npm uninstall -g titanium

The Titanium CLI is essentially pure JavaScript, so there is no build process.
You just need to pull the code and resolve the dependendencies.

git clone git@github.com:appcelerator/titanium.git
cd titanium
npm install
sudo npm link

### Running Unit Tests

To run the unit tests, simply run:

node forge test

### Running Code Coverage

To generate the code coverage, you first must install
[node-jscoverage](https://github.com/visionmedia/node-jscoverage). The easist
way to do this is run:

git clone git@github.com:visionmedia/node-jscoverage.git
cd node-jscoverage
./configure
make
sudo make install

Then run:

node forge test-cov

It will generate a file called _coverage.html_ in the Titanium CLI directory.

## Looking for the really old CLI?

Don't worry, it's still around. You can install it by running:

[sudo] npm install –g titanium@0.0.26

## Contributing

[You can digitally sign the CLA](http://bit.ly/app_cla) online. Please indicate your email address in your first pull request so that we can make sure that will locate your CLA. Once you've submitted it, you no longer need to send one for subsequent submissions.
Titanium is an open source project. Titanium wouldn't be where it is now without
contributions by the community. Please consider forking this repo to improve,
enhance or fix issues. If you feel like the community will benefit from your
fork, please open a pull request.

To protect the interests of the Titanium contributors, Appcelerator, customers
and end users we require contributors to sign a Contributors License Agreement
(CLA) before we pull the changes into the main repository. Our CLA is simple and
straightforward - it requires that the contributions you make to any
Appcelerator open source project are properly licensed and that you have the
legal authority to make those changes. This helps us significantly reduce future
legal risk for everyone involved. It is easy, helps everyone, takes only a few
minutes, and only needs to be completed once.

[You can digitally sign the CLA](http://bit.ly/app_cla) online. Please indicate
your e-mail address in your first pull request so that we can make sure that
will locate your CLA. Once you've submitted it, you no longer need to send one
for subsequent submissions.

## License

This project is open source and provided under the Apache Public License (version 2). Please make sure you see the `LICENSE` file
included in this distribution for more details on the license. Also, please take notice of the privacy notice at the end of the file.
This project is open source and provided under the Apache Public License
(version 2). Please make sure you see the `LICENSE` file included in this
distribution for more details on the license. Also, please take notice of the
privacy notice at the end of the file.

#### (C) Copyright 2012-2013, [Appcelerator](http://www.appcelerator.com/) Inc. All Rights Reserved.
63 changes: 63 additions & 0 deletions forge
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env node

/**
* forge - make-like tool
*
* @copyright
* Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved.
*
* @license
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/

var toolsDir = './forge-tools',
spawn = require('child_process').spawn,
fs = require('fs'),
path = require('path'),
colors = require('colors');

global.which = function which(program, fn) {
if (process.platform == 'win32') {
fn(); // no 'which' on windows
} else {
spawn('which', [ program ]).on('exit', fn);
}
};

global.rootDir = __dirname;

var tools = {};
fs.readdirSync(toolsDir = path.resolve(toolsDir)).forEach(function (name) {
var m, file = path.join(toolsDir, name);
if (fs.statSync(file).isDirectory()) {
if (fs.existsSync(m = path.join(file, 'index.js'))) {
tools[name] = m;
}
} else if (m = name.match(/^(?!\.|_)(.+)\.js$/)) {
tools[m[1]] = file;
}
});

function help(err) {
console.log('Forge'.cyan.bold + ' - Copyright (c) 2012-' + (new Date).getFullYear() + ', Appcelerator, Inc. All Rights Reserved.\n');
console.log('Usage: ' + 'forge <tool> [options]'.cyan + '\n');
err && console.error(err.red + '\n');
console.error('Available tools:');
Object.keys(tools).sort().forEach(function (t) {
console.log(' ' + t.cyan);
});
console.log();
process.exit(err ? 1 : 0);
}

var args = process.argv.slice(2),
tool = args.shift();

if (tool && !tools[tool]) {
help('ERROR: Invalid tool "' + tool + '"');
} else if (!tool) {
help();
}

require(tools[tool]).apply(null, args);
84 changes: 84 additions & 0 deletions forge-tools/test-cov/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/**
* Generates lib-cov files, then runs all unit tests and an html-based
* coverage report.
*
* @copyright
* Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved.
*
* @license
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/

module.exports = function () {
var spawn = require('child_process').spawn,
fs = require('fs'),
path = require('path'),
colors = require('colors'),
wrench = require('wrench'),
args = Array.prototype.slice.call(arguments);

console.log('Code Coverage Tool'.cyan.bold + ' - Copyright (c) 2012-' + (new Date).getFullYear() + ', Appcelerator, Inc. All Rights Reserved.\n');

which('jscoverage', function (code) {
if (code) {
console.error('ERROR: Unable to find "jscoverage".\n\n'.red
+ 'You can download it by visiting "https://github.com/visionmedia/node-jscoverage" or by running:\n\n'
+ ' git clone https://github.com/visionmedia/node-jscoverage.git\n'
+ ' cd node-jscoverage\n'
+ ' configure\n'
+ ' make\n'
+ ' sudo make install\n');
process.exit(1);
} else {
var startTime = Date.now();
console.log('Generating lib-cov...');

wrench.rmdirSyncRecursive(path.join(rootDir, 'lib-cov'), true);
var child = spawn('jscoverage', ['lib', 'lib-cov'], { cwd: rootDir }),
err = '';

child.stderr.on('data', function (data) {
err += data.toString();
});

child.on('close', function (code) {
if (code) {
console.error('\nERROR: jscoverage failed (' + code + ')\n'.red);
err && console.error(err.trim() + '\n');
} else {
console.log('lib-cov generation completed successfully in ' + (Date.now() - startTime) + ' ms\n');

startTime = Date.now();
console.log('Generating coverage.html...');

var coverageFile = path.join(rootDir, 'coverage.html');
fs.existsSync(coverageFile) && fs.unlinkSync(coverageFile);

process.env.APPC_COV = path.join(__dirname, 'templates');

var test = spawn(process.execPath, [ path.join(rootDir, 'tests', 'run.js') ].concat(args), {
env: process.env,
cwd: rootDir
}),
output = '';

test.stdout.on('data', function (data) {
output += data.toString();
});

test.stderr.pipe(process.stderr);

test.on('exit', function (code) {
if (!code) {
fs.writeFileSync(coverageFile, output);
console.log('coverage.html generated successfully in ' + (Date.now() - startTime) + ' ms\n');
} else {
console.error(output);
}
});
}
});
}
});
};