Skip to content

Commit

Permalink
Merge branch 'snow-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ruby0x1 committed Feb 15, 2016
2 parents fb71877 + 93cf5bd commit 6136448
Show file tree
Hide file tree
Showing 34 changed files with 146 additions and 576 deletions.
21 changes: 12 additions & 9 deletions src/flow/cmd/build/build.cpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ exports.ios_combine_archs = function(flow, done) {
'-create'];

var input_list = archs.map(function(a){
return flow.project.get_path_binary_dest_full(flow, flow.project.prepared, a);
var binary_source = flow.project.get_path_binary_name_source(flow, flow.project.prepared, a);
var source_path = util.normalize(path.join(flow.project.paths.build, 'cpp/' + binary_source));
return source_path;
});

args = args.concat(input_list);
Expand Down Expand Up @@ -82,12 +84,14 @@ internal.post_build_mobile = function(flow, done) {

//runs ant, and such
internal.build_android = function(flow, done) {
done();
}


flow.log(2, 'android specifics', flow.project.prepared.source.project.app.mobile.android);
internal.build_androidold = function(flow, done) {

//handle ability to compile store build, vs debug test build
var build_type = flow.project.prepared.source.project.app.mobile.android.build_type;
// var build_type = flow.project.prepared.source.project.app.mobile.android.build_type;
var build_type = flow.flags['android-build-type'] || 'debug';

//where to build from
var project_root = path.join(flow.project.paths.build, flow.config.build.android.project);
Expand Down Expand Up @@ -192,11 +196,13 @@ internal.post_build_desktop = function(flow, done) {

internal.move_binary = function(flow, target_arch) {

if(flow.target == 'ios') return;

target_arch = target_arch || flow.target_arch;

var binary_source = flow.project.get_path_binary_name_source(flow, flow.project.prepared, target_arch);
var binary_dest_full = flow.project.get_path_binary_dest_full(flow, flow.project.prepared, target_arch);
var source_path = util.normalize(path.join(flow.project.paths.build, 'cpp/' + binary_source));
var binary_dest_full = flow.project.get_path_binary_dest_full(flow, flow.project.prepared, target_arch);

flow.log(3,'build - moving binary for %s from %s to %s', target_arch, source_path, binary_dest_full);

Expand Down Expand Up @@ -377,6 +383,7 @@ exports.build_hxcpp = function(flow, target_arch, run_path, hxcpp_file, done) {
}

args.push('-D' + flow.target);
args.push('-DHAXE_OUTPUT_PART=' + flow.project.prepared.source.project.app.name);

switch(target_arch) {
case '32':
Expand Down Expand Up @@ -419,10 +426,6 @@ exports.build_hxcpp = function(flow, target_arch, run_path, hxcpp_file, done) {
args.push('-DHXCPP_CLANG');
}

if(flow.target == 'android') {
args.push('-Dandroid-' + flow.project.parsed.project.app.mobile.android.sdk_target);
}

//append command line + project based flags
args = util.array_union(args, flow.project.prepared.hxcpp.flags);

Expand Down
30 changes: 27 additions & 3 deletions src/flow/cmd/files/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ internal.copy_files = function(flow, files, output, no_copy) {

} //copy_project_files

exports.template_path = function(flow, template, source, dest) {

if(fs.statSync(source).isDirectory()) {
var _node = {source:source, template:template, source_name:'ext'};
return internal.template_folder_recursively(flow, _node, dest);
} else {
internal.template_file(flow, template, source, dest);
return [ dest ];
}

} //template_path

internal.template_path = function(flow, node, dest) {

if(fs.statSync(node.source).isDirectory()) {
Expand Down Expand Up @@ -251,6 +263,9 @@ internal.template_folder_recursively = function(flow, node, _dest, _overwrite) {
if(allow) {
_source_file_list.push(_source_list[i]);
}
} else {
var _dest_dir = path.join( _dest, _source_list[i] );
wrench.mkdirSyncRecursive(_dest_dir, 0755);
}
}

Expand Down Expand Up @@ -310,10 +325,19 @@ internal.template_file = function(flow, _template, _source, _dest) {
flow.log(6, 'context for file node : ', _source, file_context);

var template = bars.compile(raw_file);
var templated = template( file_context );
var templated = false;

fse.ensureFileSync(_dest);
fs.writeFileSync(_dest, templated, 'utf8');
try {
templated = template( file_context );
} catch(err) {
flow.log(3, ' - NOTE cannot template file (binary?), copying as is', _source);
util.copy_path(flow, _source, _dest);
}

if(templated !== false) {
fse.ensureFileSync(_dest);
fs.writeFileSync(_dest, templated, 'utf8');
}

} //template_file

Expand Down
35 changes: 29 additions & 6 deletions src/flow/cmd/hooks/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

var cmd = require('../../util/process')
, util = require('../../util/util')
, files = require('../files/files')

var internal = {};

Expand Down Expand Up @@ -127,8 +128,18 @@ internal.get_hook_flow = function(flow, stage, _name, hook) {
target_js : Boolean(flow.target_js),
target_desktop : Boolean(flow.target_desktop),
target_mobile : Boolean(flow.target_mobile),
project : util.deep_copy(flow.project.prepared.source),
log_level : Number(flow.log_level),
util : util,
files : {
template_path: function(template, source, dest){
files.template_path(flow, template, source, dest)
}
},
project : {
source: util.deep_copy(flow.project.prepared.source),
paths: util.deep_copy(flow.project.paths),
root: String(flow.project.root)
},
log : function(){
var args = Array.prototype.slice.call(arguments,0);
flow.log.apply(flow,args);
Expand All @@ -141,11 +152,12 @@ internal.run_hook = function(flow, stage, _name, hook, done) {

var hook_file = path.join(hook.__path, hook.script);

flow.log(2, 'hooks - running hook from %s in %s', _name, hook.__path);
flow.log(2, 'hooks - running %s hook named `%s` from %s', stage, hook.name, hook.script);
flow.log(3, 'hooks - running hook from %s in %s', _name, hook.__path);
flow.log(3, 'hooks - running %s hook `%s` from %s', stage, hook.name, hook.script);
flow.log(3, 'hooks - desc : %s', hook.desc || 'no description');

var fail = function(e) {

if(hook.require_success) {
flow.project.failed = true;
}
Expand All @@ -155,6 +167,7 @@ internal.run_hook = function(flow, stage, _name, hook, done) {
if(done) {
done(e);
}

} //fail

var hook_script;
Expand All @@ -170,18 +183,28 @@ internal.run_hook = function(flow, stage, _name, hook, done) {
var hook_flow = internal.get_hook_flow(flow, stage, _name, hook);

var s = hook_script.hook.toString();
if(s.indexOf('done()') == -1) {
if(s.indexOf('done(') == -1) {
return fail('hook script is missing a done(); call. This will stall! fix this before trying again.');
}

try {

hook_script.hook(hook_flow, function(err){
hook_script.hook(hook_flow, function(err,skip_build) {
if(err) return fail(err);
if(skip_build) {
flow.log(3, 'hooks - build skip requested');
flow.project.skip_build = true;
}
done(err);
});

} catch(e) {
return fail(e);

var _stack = e.stack.split('\n');
_stack.splice(_stack.length-9,_stack.length);

return fail('hook exception:\n\n' + _stack.join('\n'));

} //try

} else { //hook_script
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/flow/cmd/icons/default/ios/icon/29.png
Binary file not shown.
Binary file not shown.
Binary file removed src/flow/cmd/icons/default/ios/icon/40.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/flow/cmd/icons/default/ios/icon/76.png
Binary file not shown.
Binary file not shown.
65 changes: 0 additions & 65 deletions src/flow/cmd/icons/default/ios/icon/Contents.json

This file was deleted.

Binary file removed src/flow/cmd/icons/default/ios/launch/1024x768.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed src/flow/cmd/icons/default/ios/launch/640x1136.png
Binary file not shown.
Binary file removed src/flow/cmd/icons/default/ios/launch/768x1024.png
Binary file not shown.
Binary file not shown.
57 changes: 0 additions & 57 deletions src/flow/cmd/icons/default/ios/launch/Contents.json

This file was deleted.

41 changes: 0 additions & 41 deletions src/flow/cmd/icons/icons.android.js

This file was deleted.

Loading

0 comments on commit 6136448

Please sign in to comment.