Skip to content

Commit

Permalink
flow; add flow compile step which runs hooks, haxe but doesn't run …
Browse files Browse the repository at this point in the history
…the build steps (i.e haxe compile only)
  • Loading branch information
ruby0x1 committed Nov 26, 2015
1 parent 799e32f commit fb71877
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/flow/cmd/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ var internal = {};
//if build + run was asked
if(flow.action == 'run') {
flow.execute(flow, cmds['launch']);
} else {
return flow.finished();
}

} else { //err
Expand Down
4 changes: 4 additions & 0 deletions src/flow/cmd/build/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ exports.run = function(flow, done) {

internal.post_haxe = function(flow, done) {

if(flow.action == 'compile') {
return internal.complete(flow, done);
}

//on native targets we run hxcpp against the now
//generated build files in the build output
if(flow.target_cpp) {
Expand Down
21 changes: 21 additions & 0 deletions src/flow/cmd/compile/compile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

var cmds = require('../')


exports.run = function run(flow, data) {

//this is so build can use this to check if
//it should execute launch as well
flow.action = 'compile';

flow.execute(flow, cmds['build']);

} //run

exports.verify = function verify(flow, done) {
done(null,null);
}

exports.error = function(flow, err) {
flow.log(1, 'run / error %s', err);
}
17 changes: 17 additions & 0 deletions src/flow/cmd/compile/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
`flow compile [target] --options`

[target] is implied as your current system if not specified.

`flow compile` will execute a `build` command but stop after compiling the haxe output.
`--options` includes all options from the listed commands.

for full info, `flow usage` and more specifically
`flow usage build`

examples

`flow compile`
build, and run the current system as the target

`flow compile --clean`
compile against a clean bin/ path
1 change: 1 addition & 0 deletions src/flow/cmd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
exports.run = require('./run/run');
exports.launch = require('./launch/launch');
exports.build = require('./build/build');
exports.compile = require('./compile/compile');
exports.hooks = require('./hooks/hooks');
exports.clean = require('./clean/clean');
exports.package = require('./package/package');
Expand Down
4 changes: 2 additions & 2 deletions src/flow/cmd/run/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

[target] is implied as your current system if not specified.

`flow run` will execute `build`, `files`, `launch` in that order.
`flow run` will execute `files`, `build`, `launch` in that order.
`--options` includes all options from the listed commands.

for full info, `flow usage` and more specifically
`flow usage build`
`flow usage files`
`flow usage build`
`flow usage launch`

examples
Expand Down
2 changes: 2 additions & 0 deletions src/flow/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ internal.save_user_config = function(flow) {

if(flow.flags._has('build')) {
state.push('build only');
} else if(flow.flags._has('compile')) {
state.push('compile only');
}

if(flow.flags.debug) {
Expand Down
2 changes: 1 addition & 1 deletion src/flow/project/prepare/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var internal = {};
//returns an array of { source:dest } for the files in project
exports.parse = function parse(flow, prepared, source, srcpath) {

flow.log(3, 'prepare - files');
flow.log(4, 'prepare - files');

var project_file_list = [];
var build_file_list = [];
Expand Down
1 change: 1 addition & 0 deletions src/flow/project/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ exports.init = function init(flow) {
//but needs to watch for command lines calling target
flow.target =
flow.flags._next('build') ||
flow.flags._next('compile') ||
flow.flags._next('launch') ||
flow.flags._next('run') ||
flow.flags._next('files') ||
Expand Down

0 comments on commit fb71877

Please sign in to comment.