Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add something #8269

Merged
merged 1 commit into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ matrix:

- os: linux
env:
- TEST=macro,hl,js,php,flash9,as3,java,cs,python,lua
- TEST=macro,hl,js,php,flash9,as3,java,jvm,cs,python,lua
- SAUCE=1
addons:
sauce_connect: true
Expand Down Expand Up @@ -202,7 +202,7 @@ matrix:
- os: osx
osx_image: xcode9.4 # to compile faster
env:
- TEST=macro,hl,java,cs,lua,js,php,flash9,python
- TEST=macro,hl,java,jvm,cs,lua,js,php,flash9,python
install: *install_osx

- os: osx
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ STATICLINK?=0
# Configuration

# Modules in these directories should only depend on modules that are in directories to the left
HAXE_DIRECTORIES=core core/json core/display syntax context context/display codegen codegen/gencommon generators optimization filters macro macro/eval typing compiler
HAXE_DIRECTORIES=core core/json core/display syntax context context/display codegen codegen/gencommon generators generators/jvm optimization filters macro macro/eval typing compiler
EXTLIB_LIBS=extlib-leftovers extc neko javalib swflib ttflib ilib objsize pcre ziplib
OCAML_LIBS=unix str threads dynlink
OPAM_LIBS=sedlex xml-light extlib ptmap sha
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ environment:
secure: ewwkKcjnSKl/Vtrz1SXmI6XKk1ENmJDyzm5YaR2wi03foRhTke29TvymB21rDTSl
matrix:
- ARCH: 64
TEST: "neko,hl,python,cs,java,php"
TEST: "neko,hl,python,cs,java,jvm,php"
- ARCH: 64
TEST: "cpp"
- ARCH: 64
Expand Down
2 changes: 2 additions & 0 deletions extra/ImportAll.hx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class ImportAll {
if ( !Context.defined("target.threaded") ) return;
case "java":
if( !Context.defined("java") ) return;
case "jvm":
if( !Context.defined("jvm") ) return;
case "cs":
if( !Context.defined("cs") ) return;
case "python":
Expand Down
6 changes: 6 additions & 0 deletions extra/all.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
-xml java.xml
-D xmldoc

--next
-java all_jvm
-D jvm
-xml jvm.xml
-D xmldoc

--next
-cs all_cs
-D unsafe
Expand Down
9 changes: 7 additions & 2 deletions src/compiler/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ module Initialize = struct
old_flush()
);
Java.before_generate com;
add_std "java"; "java"
if defined com Define.Jvm then add_std "jvm";
add_std "java";
"java"
| Python ->
add_std "python";
if not (Common.defined com Define.PythonVersion) then
Expand Down Expand Up @@ -318,7 +320,10 @@ let generate tctx ext xml_out interp swf_header =
| Cs ->
Gencs.generate,"cs"
| Java ->
Genjava.generate,"java"
if Common.defined com Jvm then
Genjvm.generate,"java"
else
Genjava.generate,"java"
| Python ->
Genpy.generate,"python"
| Hl ->
Expand Down
1 change: 1 addition & 0 deletions src/context/common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ let get_config com =
pf_pad_nulls = true;
pf_overload = true;
pf_supports_threads = true;
pf_this_before_super = false;
}
| Python ->
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/define.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type strict_defined =
| JsUnflatten
| JsSourceMap
| JsEnumsAsArrays
| Jvm
| SourceMap
| KeepOldOutput
| LoopUnrollMaxCost
Expand Down Expand Up @@ -168,6 +169,7 @@ let infos = function
| JsEnumsAsArrays -> "js_enums_as_arrays",("Generate enum representation as array instead of as object",[Platform Js])
| JsUnflatten -> "js_unflatten",("Generate nested objects for packages and types",[Platform Js])
| JsSourceMap -> "js_source_map",("Generate JavaScript source map even in non-debug mode",[Platform Js])
| Jvm -> "jvm",("Generate jvm directly",[Platform Java])
| SourceMap -> "source_map",("Generate source map for compiled files (Currently supported for php only)",[Platform Php])
| KeepOldOutput -> "keep_old_output",("Keep old source files in the output directory (for C#/Java)",[Platforms [Cs;Java]])
| LoopUnrollMaxCost -> "loop_unroll_max_cost",("Maximum cost (number of expressions * iterations) before loop unrolling is canceled (default 250)",[])
Expand Down
6 changes: 3 additions & 3 deletions src/filters/capturedVars.ml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ let captured_vars com e =
let rec browse = function
| Block f | Loop f | Function f -> f browse
| Use ({ v_extra = Some( _ :: _, _) })
| Assign ({ v_extra = Some( _ :: _, _) }) when com.platform = Cs || com.platform = Java ->
| Assign ({ v_extra = Some( _ :: _, _) }) when com.platform = Cs || (com.platform = Java && not (Common.defined com Define.Jvm)) ->
(* Java and C# deal with functions with type parameters in a different way *)
(* so they do should not be wrapped *)
()
Expand Down Expand Up @@ -220,7 +220,7 @@ let captured_vars com e =
f (collect_vars false);
decr depth;
| Use ({ v_extra = Some( _ :: _, _) })
| Assign ({ v_extra = Some( _ :: _, _) }) when com.platform = Cs || com.platform = Java ->
| Assign ({ v_extra = Some( _ :: _, _) }) when com.platform = Cs || (com.platform = Java && not (Common.defined com Define.Jvm)) ->
(* Java/C# use a special handling for functions with type parmaters *)
()
| Declare v ->
Expand Down Expand Up @@ -257,7 +257,7 @@ let captured_vars com e =
| Declare v ->
vars := PMap.add v.v_id !depth !vars;
| Use ({ v_extra = Some( _ :: _, _) })
| Assign ({ v_extra = Some( _ :: _, _) }) when com.platform = Cs || com.platform = Java ->
| Assign ({ v_extra = Some( _ :: _, _) }) when com.platform = Cs || (com.platform = Java && not (Common.defined com Define.Jvm)) ->
()
| Use v ->
(try
Expand Down
2 changes: 1 addition & 1 deletion src/filters/filters.ml
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ let run com tctx main =
filters @ [
TryCatchWrapper.configure_cs com
]
| Java ->
| Java when not (Common.defined com Jvm)->
SetHXGen.run_filter com new_types;
filters @ [
TryCatchWrapper.configure_java com
Expand Down
Loading