diff --git a/src/compiler/compiler.ml b/src/compiler/compiler.ml index 2dcd61acfca..e9a682c8387 100644 --- a/src/compiler/compiler.ml +++ b/src/compiler/compiler.ml @@ -129,6 +129,7 @@ module Setup = struct | Java -> Java.before_generate com; if defined com Define.Jvm then begin + if not actx.jvm_flag then com.warning WDeprecated com.warning_options ("--java out.jar -D jvm is deprecated; use --jvm out.jar directly") null_pos; add_std "jvm"; com.package_rules <- PMap.remove "jvm" com.package_rules; end; diff --git a/src/compiler/generate.ml b/src/compiler/generate.ml index 0474ff95639..76e9f256dd5 100644 --- a/src/compiler/generate.ml +++ b/src/compiler/generate.ml @@ -81,10 +81,9 @@ let generate ctx tctx ext actx = | Cs -> Gencs.generate,"cs" | Java -> - if Common.defined com Jvm then begin - com.warning WDeprecated com.warning_options ("--java out.jar -D jvm is deprecated; use --jvm out.jar directly") null_pos; + if Common.defined com Jvm then Genjvm.generate actx.jvm_flag,"java" - end else + else Genjava.generate,"java" | Python -> Genpy.generate,"python" diff --git a/tests/misc/projects/Issue11737/Main.hx b/tests/misc/projects/Issue11737/Main.hx new file mode 100644 index 00000000000..a71cf3b3e00 --- /dev/null +++ b/tests/misc/projects/Issue11737/Main.hx @@ -0,0 +1 @@ +function main() {} diff --git a/tests/misc/projects/Issue11737/_setup.hxml b/tests/misc/projects/Issue11737/_setup.hxml new file mode 100644 index 00000000000..07f836f0c9a --- /dev/null +++ b/tests/misc/projects/Issue11737/_setup.hxml @@ -0,0 +1 @@ +--cmd haxelib install --quiet hxjava diff --git a/tests/misc/projects/Issue11737/compile.hxml b/tests/misc/projects/Issue11737/compile.hxml new file mode 100644 index 00000000000..e19b1a71b09 --- /dev/null +++ b/tests/misc/projects/Issue11737/compile.hxml @@ -0,0 +1,3 @@ +--main Main +--java bin +-D jvm diff --git a/tests/misc/projects/Issue11737/compile.hxml.stderr b/tests/misc/projects/Issue11737/compile.hxml.stderr new file mode 100644 index 00000000000..1443766f776 --- /dev/null +++ b/tests/misc/projects/Issue11737/compile.hxml.stderr @@ -0,0 +1 @@ +Warning : (WDeprecated) --java out.jar -D jvm is deprecated; use --jvm out.jar directly diff --git a/tests/misc/projects/Issue11737/compile1.hxml b/tests/misc/projects/Issue11737/compile1.hxml new file mode 100644 index 00000000000..2f5182c6cf9 --- /dev/null +++ b/tests/misc/projects/Issue11737/compile1.hxml @@ -0,0 +1,2 @@ +--main Main +--jvm bin/jvm.jar diff --git a/tests/misc/projects/Issue11737/compile1.hxml.stderr b/tests/misc/projects/Issue11737/compile1.hxml.stderr new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/misc/projects/Issue11737/compile2.hxml b/tests/misc/projects/Issue11737/compile2.hxml new file mode 100644 index 00000000000..9e99a0fd81f --- /dev/null +++ b/tests/misc/projects/Issue11737/compile2.hxml @@ -0,0 +1,2 @@ +--main Main +--java bin diff --git a/tests/misc/projects/Issue11737/compile2.hxml.stderr b/tests/misc/projects/Issue11737/compile2.hxml.stderr new file mode 100644 index 00000000000..e69de29bb2d