diff options
author | Tristan Partin <tristan@partin.io> | 2022-01-26 00:33:58 -0600 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-03-02 16:23:09 -0500 |
commit | 96b2469544fba40e63d009db73b41c3b07b80684 (patch) | |
tree | 4d365b8e8c8a6a8784b55b37eefa2b8b33b2d09b /test cases | |
parent | f9bfeb2add70973113ab4a98454a5c5d7e3a26ae (diff) | |
download | meson-96b2469544fba40e63d009db73b41c3b07b80684.zip meson-96b2469544fba40e63d009db73b41c3b07b80684.tar.gz meson-96b2469544fba40e63d009db73b41c3b07b80684.tar.bz2 |
Rename JDK system dep to JNI
JNI is a more apt name because it currently only supports the JNI. I
also believe that CMake uses the terminology JNI here as well.
JNI is currently the only way to interact with the JVM through native
code, but there is a project called "Project Panama" which aims to be
another way for native code to interact with the JVM.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.c | 9 | ||||
-rw-r--r-- | test cases/java/9 jdk/lib/meson.build | 18 | ||||
-rw-r--r-- | test cases/java/9 jdk/src/meson.build | 17 | ||||
-rw-r--r-- | test cases/java/9 jni/lib/com_mesonbuild_JniTest.c | 9 | ||||
-rw-r--r-- | test cases/java/9 jni/lib/meson.build | 18 | ||||
-rw-r--r-- | test cases/java/9 jni/lib/native.c (renamed from test cases/java/9 jdk/lib/native.c) | 0 | ||||
-rw-r--r-- | test cases/java/9 jni/meson.build (renamed from test cases/java/9 jdk/meson.build) | 6 | ||||
-rw-r--r-- | test cases/java/9 jni/src/com/mesonbuild/JniTest.java (renamed from test cases/java/9 jdk/src/com/mesonbuild/JdkTest.java) | 8 | ||||
-rw-r--r-- | test cases/java/9 jni/src/com/mesonbuild/meson.build (renamed from test cases/java/9 jdk/src/com/mesonbuild/meson.build) | 2 | ||||
-rw-r--r-- | test cases/java/9 jni/src/meson.build | 17 |
10 files changed, 52 insertions, 52 deletions
diff --git a/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.c b/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.c deleted file mode 100644 index 075e37b..0000000 --- a/test cases/java/9 jdk/lib/com_mesonbuild_JdkTest.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <jni.h> - -#include "com_mesonbuild_JdkTest.h" - -JNIEXPORT jint JNICALL Java_com_mesonbuild_JdkTest_jdk_1test - (JNIEnv *env, jclass clazz) -{ - return (jint)0xdeadbeef; -} diff --git a/test cases/java/9 jdk/lib/meson.build b/test cases/java/9 jdk/lib/meson.build deleted file mode 100644 index 08407cf..0000000 --- a/test cases/java/9 jdk/lib/meson.build +++ /dev/null @@ -1,18 +0,0 @@ -sources = [ - files( - 'native.c', - 'com_mesonbuild_JdkTest.c', - ), - native_headers -] - -jdkjava = shared_module( - 'jdkjava', - sources, - dependencies : [jdk], - include_directories : [native_header_includes] -) - -jdkjava_dep = declare_dependency( - link_with : jdkjava, -) diff --git a/test cases/java/9 jdk/src/meson.build b/test cases/java/9 jdk/src/meson.build deleted file mode 100644 index d1b9ee3..0000000 --- a/test cases/java/9 jdk/src/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -jdkjar = jar( - 'jdkjar', - 'com' / 'mesonbuild' / 'JdkTest.java', - main_class : 'com.mesonbuild.JdkTest', -) - -test( - 'jdktest', - java, - args: [ - '-Djava.library.path=@0@'.format(fs.parent(jdkjava.full_path())), - '-jar', - jdkjar, - ], - protocol : 'exitcode', - depends : [jdkjava], -) diff --git a/test cases/java/9 jni/lib/com_mesonbuild_JniTest.c b/test cases/java/9 jni/lib/com_mesonbuild_JniTest.c new file mode 100644 index 0000000..5deca03 --- /dev/null +++ b/test cases/java/9 jni/lib/com_mesonbuild_JniTest.c @@ -0,0 +1,9 @@ +#include <jni.h> + +#include "com_mesonbuild_JniTest.h" + +JNIEXPORT jint JNICALL Java_com_mesonbuild_JniTest_jni_1test + (JNIEnv *env, jclass clazz) +{ + return (jint)0xdeadbeef; +} diff --git a/test cases/java/9 jni/lib/meson.build b/test cases/java/9 jni/lib/meson.build new file mode 100644 index 0000000..c2ddc7a --- /dev/null +++ b/test cases/java/9 jni/lib/meson.build @@ -0,0 +1,18 @@ +sources = [ + files( + 'native.c', + 'com_mesonbuild_JniTest.c', + ), + native_headers +] + +jnijava = shared_module( + 'jnijava', + sources, + dependencies : [jni_dep], + include_directories : [native_header_includes] +) + +jnijava_dep = declare_dependency( + link_with : jnijava +) diff --git a/test cases/java/9 jdk/lib/native.c b/test cases/java/9 jni/lib/native.c index 0b5e718..0b5e718 100644 --- a/test cases/java/9 jdk/lib/native.c +++ b/test cases/java/9 jni/lib/native.c diff --git a/test cases/java/9 jdk/meson.build b/test cases/java/9 jni/meson.build index e5c9728..65d7ff6 100644 --- a/test cases/java/9 jdk/meson.build +++ b/test cases/java/9 jni/meson.build @@ -1,11 +1,11 @@ -project('jdkjava', ['c', 'java']) +project('jnijava', ['c', 'java']) if build_machine.system() == 'cygwin' error('MESON_SKIP_TEST: cygwin test failures') endif if build_machine.system() == 'windows' and build_machine.cpu_family() == 'x86' - error('MESON_SKIP_TEST: failing builds on 32bit Windows because a 32bit JDK isn not available in the Azure Pipelines Windows images') + error('MESON_SKIP_TEST: failing builds on 32bit Windows because a 32bit JDK is not available in the Azure Pipelines Windows images') endif fs = import('fs') @@ -13,7 +13,7 @@ javamod = import('java') java = find_program('java') -jdk = dependency('jdk', version : '>=1.8') +jni_dep = dependency('jni', version : '>=1.8') # generate native headers subdir('src/com/mesonbuild') diff --git a/test cases/java/9 jdk/src/com/mesonbuild/JdkTest.java b/test cases/java/9 jni/src/com/mesonbuild/JniTest.java index 35c47ce..f80b326 100644 --- a/test cases/java/9 jdk/src/com/mesonbuild/JdkTest.java +++ b/test cases/java/9 jni/src/com/mesonbuild/JniTest.java @@ -1,15 +1,15 @@ package com.mesonbuild; -public final class JdkTest { - private static native int jdk_test(); +public final class JniTest { + private static native int jni_test(); public static void main(String[] args) { - if (jdk_test() != 0xdeadbeef) { + if (jni_test() != 0xdeadbeef) { throw new RuntimeException("jdk_test() did not return 0"); } } static { - System.loadLibrary("jdkjava"); + System.loadLibrary("jnijava"); } } diff --git a/test cases/java/9 jdk/src/com/mesonbuild/meson.build b/test cases/java/9 jni/src/com/mesonbuild/meson.build index 0cce7f0..3ee2083 100644 --- a/test cases/java/9 jdk/src/com/mesonbuild/meson.build +++ b/test cases/java/9 jni/src/com/mesonbuild/meson.build @@ -1,3 +1,3 @@ native_headers = javamod.generate_native_headers( - 'JdkTest.java', package: 'com.mesonbuild', classes: ['JdkTest']) + 'JniTest.java', package: 'com.mesonbuild', classes: ['JdkTest']) 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 new file mode 100644 index 0000000..07a0664 --- /dev/null +++ b/test cases/java/9 jni/src/meson.build @@ -0,0 +1,17 @@ +jnijar = jar( + 'jnijar', + 'com' / 'mesonbuild' / 'JniTest.java', + 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], +) |