blob: e67e763968063ed335b1e9278d1b315a62468ce2 [file] [log] [blame]
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//base/android/jni_generator/jni_exception_list.gni")
import("//build/config/android/rules.gni")
import("//testing/test.gni")
generate_jni("jni_sample_header") {
sources = [
"java/src/org/chromium/example/jni_generator/SampleForTests.java",
]
jni_package = "example"
}
android_library("jni_sample_java") {
java_files =
[ "java/src/org/chromium/example/jni_generator/SampleForTests.java" ]
deps = [
"//base:base_java",
]
}
android_library("jni_annotation_sample_java") {
java_files = [ "java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java" ]
deps = [
"//base:jni_processor_annotations_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
source_set("jni_sample_native_side") {
deps = [
":jni_sample_header",
"//base",
]
sources = [
"sample_for_tests.cc",
"sample_for_tests.h",
]
}
shared_library("jni_sample_lib") {
sources = [
"sample_entry_point.cc",
]
deps = [
":jni_sample_native_side",
":sample_jni_registration",
"//base",
]
}
android_apk("sample_jni_apk") {
apk_name = "SampleJni"
android_manifest = "AndroidManifest.xml"
deps = [
":jni_sample_java",
"//base:base_java",
]
shared_libraries = [ ":jni_sample_lib" ]
}
generate_jni_registration("sample_jni_registration") {
target = ":sample_jni_apk"
output = "$target_gen_dir/${target_name}.h"
exception_files = jni_exception_files
}
# Serves to test that generated bindings compile properly.
group("jni_generator_tests") {
deps = [
":jni_annotation_sample_java",
":sample_jni_apk",
]
}
java_annotation_processor("jni_processor") {
java_files = [ "java/src/org/chromium/jni_generator/JniProcessor.java" ]
main_class = "org.chromium.jni_generator.JniProcessor"
annotation_processor_deps = [ "//third_party/auto:auto_service_processor" ]
deps = [
"//base:jni_processor_annotations_java",
"//third_party/android_deps:com_squareup_javapoet_java",
"//third_party/auto:auto_service_java",
"//third_party/guava:guava_java",
]
}