diff options
author | Tristan Partin <tristan@partin.io> | 2022-03-07 13:20:59 -0600 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-07 15:42:07 -0800 |
commit | d072ebc9554e5661419d6d75285bfee24dca743f (patch) | |
tree | ad029e64fbfbfcdf3a607ffeb52fe2474fa44c7a /test cases/java | |
parent | d35f11fc08b9033b2ce012eb394028b19d7e25f4 (diff) | |
download | meson-d072ebc9554e5661419d6d75285bfee24dca743f.zip meson-d072ebc9554e5661419d6d75285bfee24dca743f.tar.gz meson-d072ebc9554e5661419d6d75285bfee24dca743f.tar.bz2 |
Fix @typed_pos_args on java.generate_native_headers
Diffstat (limited to 'test cases/java')
-rw-r--r-- | test cases/java/9 jni/meson.build | 15 | ||||
-rw-r--r-- | test cases/java/9 jni/src/com/mesonbuild/Configured.java.in | 5 | ||||
-rw-r--r-- | test cases/java/9 jni/src/com/mesonbuild/JniTest.java | 2 | ||||
-rw-r--r-- | test cases/java/9 jni/src/com/mesonbuild/meson.build | 10 | ||||
-rw-r--r-- | test cases/java/9 jni/src/meson.build | 18 |
5 files changed, 33 insertions, 17 deletions
diff --git a/test cases/java/9 jni/meson.build b/test cases/java/9 jni/meson.build index 1239e19..90a8485 100644 --- a/test cases/java/9 jni/meson.build +++ b/test cases/java/9 jni/meson.build @@ -16,6 +16,17 @@ java = find_program('java') jni_dep = dependency('jni', version : '>=1.8', modules: ['jvm', 'awt']) # generate native headers -subdir('src/com/mesonbuild') -subdir('lib') subdir('src') +subdir('lib') + +test( + 'jnitest', + java, + args: [ + '-Djava.library.path=@0@'.format(fs.parent(jnijava.full_path())), + '-jar', + jnijar, + ], + protocol : 'exitcode', + depends : [jnijava], +) diff --git a/test cases/java/9 jni/src/com/mesonbuild/Configured.java.in b/test cases/java/9 jni/src/com/mesonbuild/Configured.java.in new file mode 100644 index 0000000..fac6e05 --- /dev/null +++ b/test cases/java/9 jni/src/com/mesonbuild/Configured.java.in @@ -0,0 +1,5 @@ +package com.mesonbuild; + +public final class Configured { + public static final int FINGERPRINT = @fingerprint@; +} diff --git a/test cases/java/9 jni/src/com/mesonbuild/JniTest.java b/test cases/java/9 jni/src/com/mesonbuild/JniTest.java index f80b326..4bfffe9 100644 --- a/test cases/java/9 jni/src/com/mesonbuild/JniTest.java +++ b/test cases/java/9 jni/src/com/mesonbuild/JniTest.java @@ -4,7 +4,7 @@ public final class JniTest { private static native int jni_test(); public static void main(String[] args) { - if (jni_test() != 0xdeadbeef) { + if (jni_test() != Configured.FINGERPRINT) { throw new RuntimeException("jdk_test() did not return 0"); } } diff --git a/test cases/java/9 jni/src/com/mesonbuild/meson.build b/test cases/java/9 jni/src/com/mesonbuild/meson.build index 3ee2083..2d88c5e 100644 --- a/test cases/java/9 jni/src/com/mesonbuild/meson.build +++ b/test cases/java/9 jni/src/com/mesonbuild/meson.build @@ -1,3 +1,11 @@ +configured = configure_file( + input: files('Configured.java.in'), + output: 'Configured.java', + configuration: configuration_data({'fingerprint': '0xdeadbeef'}) +) + +sources += configured + native_headers = javamod.generate_native_headers( - 'JniTest.java', package: 'com.mesonbuild', classes: ['JdkTest']) + sources, package: 'com.mesonbuild', classes: ['JniTest']) native_header_includes = include_directories('.') diff --git a/test cases/java/9 jni/src/meson.build b/test cases/java/9 jni/src/meson.build index 07a0664..af443b5 100644 --- a/test cases/java/9 jni/src/meson.build +++ b/test cases/java/9 jni/src/meson.build @@ -1,17 +1,9 @@ +sources = [files('com/mesonbuild/JniTest.java')] + +subdir('com/mesonbuild') + jnijar = jar( 'jnijar', - 'com' / 'mesonbuild' / 'JniTest.java', + sources, main_class : 'com.mesonbuild.JniTest', ) - -test( - 'jnitest', - java, - args: [ - '-Djava.library.path=@0@'.format(fs.parent(jnijava.full_path())), - '-jar', - jnijar, - ], - protocol : 'exitcode', - depends : [jnijava], -) |