Skip to content

Commit

Permalink
build; add missing neko pieces
Browse files Browse the repository at this point in the history
originally this was hardcoded, but the new flow doesn't have this issue
of hardcoded targets so I had opted to not finishing adding these, but
since they're consistent here we go.
  • Loading branch information
ruby0x1 committed Apr 30, 2017
1 parent 5d1f491 commit 850ed51
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/flow/cmd/build/build.neko.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ exports.post_build = function(flow, done) {
var abs_outpath = path.resolve(flow.project.root, flow.project.paths.output);

cmd.exec(flow, 'nekotools', ['boot',abs_binary+'.n'], { cwd: abs_outpath }, function(out,err){

//convert

done();
});

Expand Down
13 changes: 13 additions & 0 deletions src/flow/cmd/build/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

, buildcpp = require('./build.cpp')
, buildweb = require('./build.web')
, buildneko = require('./build.neko')


var internal = {};
Expand Down Expand Up @@ -112,6 +113,12 @@ internal.post_haxe = function(flow, done) {
internal.post_build(flow, done);
});

} else if(flow.target_neko) {

buildneko.post_haxe(flow, function(err){
internal.post_build(flow, done);
});

} else { //native targets

internal.post_build(flow, done);
Expand Down Expand Up @@ -145,6 +152,12 @@ internal.post_build = function(flow, done) {
internal.complete(flow, done);
});

} else if(flow.target_neko) {

buildneko.post_build(flow, function(err){
internal.complete(flow, done);
});

} else { //native targets

internal.complete(flow, done);
Expand Down
1 change: 1 addition & 0 deletions src/flow/cmd/hooks/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ internal.get_hook_flow = function(flow, stage, _name, hook) {
target : String(flow.target),
target_arch : String(flow.target_arch),
target_cpp : Boolean(flow.target_cpp),
target_neko : Boolean(flow.target_neko),
target_js : Boolean(flow.target_js),
target_desktop : Boolean(flow.target_desktop),
target_mobile : Boolean(flow.target_mobile),
Expand Down
4 changes: 4 additions & 0 deletions src/flow/cmd/launch/launch.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ internal.launch = function(flow) {
native.launch(flow);
} else if(flow.target_js) {
web.launch(flow);
} else if(flow.target_neko) {
native.launch(flow);
} else {
flow.log(2, 'launch / nothing to do')
}

}
2 changes: 1 addition & 1 deletion src/flow/cmd/launch/launch.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports.launch = function(flow) {

internal.launch = function(flow) {

if(flow.target_desktop) {
if(flow.target_desktop || flow.target_neko) {

var abs_binary = path.resolve(flow.project.root, flow.project.paths.binary.full);
var abs_outpath = path.resolve(flow.project.root, flow.project.paths.output);
Expand Down
3 changes: 2 additions & 1 deletion src/flow/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"linux" : "cpp",
"android" : "cpp",
"ios" : "cpp",
"tvos" : "cpp"
"tvos" : "cpp",
"neko" : "neko"
},

"arch": {
Expand Down
12 changes: 10 additions & 2 deletions src/flow/project/bake.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,23 @@ exports.target = function(flow, project, split) {

values += '-cpp ' + cpp_files_path;

} else if(flow.target_js) {
} else if(flow.target_js) { //web

//js the file can go straight out to the dest path
var out_file = path.join(flow.project.paths.output, project.source.project.app.name+'.js');
out_file = path.relative(flow.project.root, out_file);

values += '-js ' + out_file;

} //web
} else if(flow.target_neko) {

//neko too can go straight out to the dest path
var out_file = path.join(flow.project.paths.output, project.source.project.app.name+'.n');
out_file = path.relative(flow.project.root, out_file);

values += '-neko ' + out_file;

} //

return values;

Expand Down
7 changes: 5 additions & 2 deletions src/flow/project/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,11 @@ internal.prepare_defines = function(flow, prepared) {

internal.log(flow, 3, 'prepare - defines ...');

//the build target is set as a define
prepared.defines_all[flow.target] = { name:flow.target, met:true };
//the build target is set as a define, unless it's a restricted define (?..........)
var undefineable = ['neko']
if(undefineable.indexOf(flow.target) == -1) {
prepared.defines_all[flow.target] = { name:flow.target, met:true };
}

//then we store a target-<cpp, js, lua, etc>
var target_type = flow.config.build.target[flow.target];
Expand Down
2 changes: 2 additions & 0 deletions src/flow/project/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ exports.init = function init(flow) {
//make sure these exist even if unset
flow.target_cpp = false;
flow.target_js = false;
flow.target_neko = false;
flow.target_desktop = false;
flow.target_mobile = false;

Expand All @@ -57,6 +58,7 @@ exports.init = function init(flow) {

if(type == "cpp") flow.target_cpp = true;
if(type == "js") flow.target_js = true;
if(type == "neko") flow.target_neko = true;

return success;

Expand Down

0 comments on commit 850ed51

Please sign in to comment.