diff options
| author | Aurélien Zanelli <aurelien.zanelli@actronika.com> | 2018-10-31 12:36:13 +0100 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-11-02 22:27:25 +0200 |
| commit | 5af84440bcfb3fd5ab8f2791b5e6a57fabfcbc19 (patch) | |
| tree | 98d1662bdbfac0676eeba2fa2fd5044e74754220 /test cases/java/8 codegen custom target/com | |
| parent | f0e1342fb263fff8b2ec514ebc2a5a178739cd28 (diff) | |
| download | meson-5af84440bcfb3fd5ab8f2791b5e6a57fabfcbc19.tar.gz | |
ninjabackend: add generated source files to jar compile target source list
Otherwise, passing result of custom_target() to jar() target is ignored
and won't be compiled resulting in build fail.
Diffstat (limited to 'test cases/java/8 codegen custom target/com')
4 files changed, 39 insertions, 0 deletions
diff --git a/test cases/java/8 codegen custom target/com/mesonbuild/Config.java.in b/test cases/java/8 codegen custom target/com/mesonbuild/Config.java.in new file mode 100644 index 000000000..8845985a9 --- /dev/null +++ b/test cases/java/8 codegen custom target/com/mesonbuild/Config.java.in @@ -0,0 +1,5 @@ +package com.mesonbuild; + +public class Config { + public static final boolean FOOBAR = true; +} diff --git a/test cases/java/8 codegen custom target/com/mesonbuild/Simple.java b/test cases/java/8 codegen custom target/com/mesonbuild/Simple.java new file mode 100644 index 000000000..df3c53df3 --- /dev/null +++ b/test cases/java/8 codegen custom target/com/mesonbuild/Simple.java @@ -0,0 +1,12 @@ +package com.mesonbuild; + +import com.mesonbuild.Config; + +class Simple { + public static void main(String [] args) { + if (Config.FOOBAR) { + TextPrinter t = new TextPrinter("Printing from Java."); + t.print(); + } + } +} diff --git a/test cases/java/8 codegen custom target/com/mesonbuild/TextPrinter.java b/test cases/java/8 codegen custom target/com/mesonbuild/TextPrinter.java new file mode 100644 index 000000000..dc2771c37 --- /dev/null +++ b/test cases/java/8 codegen custom target/com/mesonbuild/TextPrinter.java @@ -0,0 +1,14 @@ +package com.mesonbuild; + +class TextPrinter { + + private String msg; + + TextPrinter(String s) { + msg = s; + } + + public void print() { + System.out.println(msg); + } +} diff --git a/test cases/java/8 codegen custom target/com/mesonbuild/meson.build b/test cases/java/8 codegen custom target/com/mesonbuild/meson.build new file mode 100644 index 000000000..67b98a4cd --- /dev/null +++ b/test cases/java/8 codegen custom target/com/mesonbuild/meson.build @@ -0,0 +1,8 @@ +python = import('python').find_installation('python3') + +config_file = custom_target('confgen', + input : 'Config.java.in', + output : 'Config.java', + command : [python, '-c', + 'import shutil; import sys; shutil.copy(sys.argv[1], sys.argv[2])', + '@INPUT@', '@OUTPUT@']) |
