# Copyright 2023 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//third_party/jni_zero/jni_zero.gni") config("jni_include_dir") { include_dirs = [ jni_headers_dir ] } config("toolchain_define") { if (is_robolectric) { defines = [ "JNI_ZERO_IS_ROBOLECTRIC" ] } } # This is the public target that we intend others to use. component("jni_zero") { # This is the public API. sources = [ "jni_zero.h" ] # These are intended to only be used within jni_zero and the code it generates. sources += [ "jni_export.h", "jni_zero.cc", "jni_zero_internal.h", "logging.cc", "logging.h", ] if (is_android) { libs = [ "log" ] } else if (is_robolectric) { public_configs = [ "//third_party/jdk:jdk" ] } configs += [ ":toolchain_define" ] } if (enable_java_templates && is_android) { import("//build/config/android/rules.gni") java_library("jni_zero_java") { supports_android = true deps = [ "//build/android:build_java" ] sources = [ "java/src/org/jni_zero/AccessedByNative.java", "java/src/org/jni_zero/CalledByNative.java", "java/src/org/jni_zero/CalledByNativeForTesting.java", "java/src/org/jni_zero/CalledByNativeUnchecked.java", "java/src/org/jni_zero/CheckDiscard.java", "java/src/org/jni_zero/JNINamespace.java", "java/src/org/jni_zero/JniStaticTestMocker.java", "java/src/org/jni_zero/JniType.java", "java/src/org/jni_zero/NativeClassQualifiedName.java", "java/src/org/jni_zero/NativeLibraryLoadedStatus.java", "java/src/org/jni_zero/NativeMethods.java", ] proguard_configs = [ "proguard.flags" ] } group("jni_zero_tests") { testonly = true deps = [ "//third_party/jni_zero/sample:jni_zero_sample_apk_test", "//third_party/jni_zero/test:jni_zero_compile_check_apk", ] } }