From 179c94aca6a24fbd5e466eae32bc790016e60624 Mon Sep 17 00:00:00 2001 From: Dan Korostelev Date: Wed, 4 Jun 2014 22:55:20 +0400 Subject: [PATCH] [java] always copy resources, even if haxe.Resources is not used --- genjava.ml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/genjava.ml b/genjava.ml index f6045087bd4..0ccce4e87b4 100644 --- a/genjava.ml +++ b/genjava.ml @@ -2135,20 +2135,20 @@ let configure gen = mkdir (gen.gcon.file ^ "/src"); (* add resources array *) + let res = ref [] in + Hashtbl.iter (fun name v -> + res := { eexpr = TConst(TString name); etype = gen.gcon.basic.tstring; epos = Ast.null_pos } :: !res; + + let full_path = gen.gcon.file ^ "/src/" ^ name in + mkdir_from_path full_path; + + let f = open_out_bin full_path in + output_string f v; + close_out f + ) gen.gcon.resources; (try - let res = get_cl (Hashtbl.find gen.gtypes (["haxe"], "Resource")) in - let cf = PMap.find "content" res.cl_statics in - let res = ref [] in - Hashtbl.iter (fun name v -> - res := { eexpr = TConst(TString name); etype = gen.gcon.basic.tstring; epos = Ast.null_pos } :: !res; - - let full_path = gen.gcon.file ^ "/src/" ^ name in - mkdir_from_path full_path; - - let f = open_out_bin full_path in - output_string f v; - close_out f - ) gen.gcon.resources; + let c = get_cl (Hashtbl.find gen.gtypes (["haxe"], "Resource")) in + let cf = PMap.find "content" c.cl_statics in cf.cf_expr <- Some ({ eexpr = TArrayDecl(!res); etype = gen.gcon.basic.tarray gen.gcon.basic.tstring; epos = Ast.null_pos }) with | Not_found -> ());