Skip to content

Commit fb71877

Browse files
committed
flow; add flow compile step which runs hooks, haxe but doesn't run the build steps (i.e haxe compile only)
1 parent 799e32f commit fb71877

File tree

9 files changed

+51
-3
lines changed

9 files changed

+51
-3
lines changed

src/flow/cmd/build/build.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ var internal = {};
104104
//if build + run was asked
105105
if(flow.action == 'run') {
106106
flow.execute(flow, cmds['launch']);
107+
} else {
108+
return flow.finished();
107109
}
108110

109111
} else { //err

src/flow/cmd/build/builder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ exports.run = function(flow, done) {
9494

9595
internal.post_haxe = function(flow, done) {
9696

97+
if(flow.action == 'compile') {
98+
return internal.complete(flow, done);
99+
}
100+
97101
//on native targets we run hxcpp against the now
98102
//generated build files in the build output
99103
if(flow.target_cpp) {

src/flow/cmd/compile/compile.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
var cmds = require('../')
3+
4+
5+
exports.run = function run(flow, data) {
6+
7+
//this is so build can use this to check if
8+
//it should execute launch as well
9+
flow.action = 'compile';
10+
11+
flow.execute(flow, cmds['build']);
12+
13+
} //run
14+
15+
exports.verify = function verify(flow, done) {
16+
done(null,null);
17+
}
18+
19+
exports.error = function(flow, err) {
20+
flow.log(1, 'run / error %s', err);
21+
}

src/flow/cmd/compile/usage.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
`flow compile [target] --options`
2+
3+
[target] is implied as your current system if not specified.
4+
5+
`flow compile` will execute a `build` command but stop after compiling the haxe output.
6+
`--options` includes all options from the listed commands.
7+
8+
for full info, `flow usage` and more specifically
9+
`flow usage build`
10+
11+
examples
12+
13+
`flow compile`
14+
build, and run the current system as the target
15+
16+
`flow compile --clean`
17+
compile against a clean bin/ path

src/flow/cmd/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
exports.run = require('./run/run');
55
exports.launch = require('./launch/launch');
66
exports.build = require('./build/build');
7+
exports.compile = require('./compile/compile');
78
exports.hooks = require('./hooks/hooks');
89
exports.clean = require('./clean/clean');
910
exports.package = require('./package/package');

src/flow/cmd/run/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

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

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

88
for full info, `flow usage` and more specifically
9-
`flow usage build`
109
`flow usage files`
10+
`flow usage build`
1111
`flow usage launch`
1212

1313
examples

src/flow/flow.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ internal.save_user_config = function(flow) {
194194

195195
if(flow.flags._has('build')) {
196196
state.push('build only');
197+
} else if(flow.flags._has('compile')) {
198+
state.push('compile only');
197199
}
198200

199201
if(flow.flags.debug) {

src/flow/project/prepare/files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var internal = {};
88
//returns an array of { source:dest } for the files in project
99
exports.parse = function parse(flow, prepared, source, srcpath) {
1010

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

1313
var project_file_list = [];
1414
var build_file_list = [];

src/flow/project/project.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ exports.init = function init(flow) {
2323
//but needs to watch for command lines calling target
2424
flow.target =
2525
flow.flags._next('build') ||
26+
flow.flags._next('compile') ||
2627
flow.flags._next('launch') ||
2728
flow.flags._next('run') ||
2829
flow.flags._next('files') ||

0 commit comments

Comments
 (0)