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-12169] Create build log with compilation #6297

Merged
merged 8 commits into from
Nov 18, 2014
3 changes: 3 additions & 0 deletions cli/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ exports.validate = function (logger, config, cli) {
// since we need validate() to be async, we return a function in which the cli
// will immediately call
return function (finished) {
// meaningful state for file logging begins now
// triggers code in node_modules/titanium-sdk/lib/builder.js
cli.emit('cli:beginlogging');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logger needs to be monkey patched in config() and "turned on" in the --project-dir callback.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the cli.beginLogging event anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yes, I forgot to remove that.

function next(result) {
if (result !== false) {
// no error, load the tiapp.xml plugins
Expand Down
22 changes: 11 additions & 11 deletions cli/commands/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ exports.run = function (logger, config, cli) {
cli.fireHook('clean.pre', function () {
async.series(fs.readdirSync(buildDir).map(function (dir) {
return function (next) {
var fulldir = path.join(buildDir, dir);
if (fs.lstatSync(fulldir).isDirectory()) {
cli.fireHook('clean.' + dir + '.pre', function () {
logger.debug(__('Deleting %s', fulldir.cyan));
wrench.rmdirSyncRecursive(fulldir);
cli.fireHook('clean.' + dir + '.post', function () {
next();
});
var file = path.join(buildDir, dir);
cli.fireHook('clean.' + dir + '.pre', function () {
logger.debug(__('Deleting %s', file.cyan));
if (fs.lstatSync(file).isDirectory()) {
wrench.rmdirSyncRecursive(file);
} else {
fs.unlinkSync(file);
}
cli.fireHook('clean.' + dir + '.post', function () {
next();
});
} else {
next();
}
});
};
}), function () {
cli.fireHook('clean.post', function () {
Expand Down
85 changes: 83 additions & 2 deletions node_modules/titanium-sdk/lib/builder.js

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