blob: 1b9fba1ece28e3b8dcdabfd4c657a3d1d49328a1 [file] [log] [blame]
# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/rules.gni")
import("//testing/test.gni")
generate_jni("jni_sample_header") {
sources = [
"java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java",
"java/src/org/chromium/example/jni_generator/SampleForTests.java",
]
}
android_library("jni_sample_java") {
sources = [
"java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java",
"java/src/org/chromium/example/jni_generator/SampleForTests.java",
]
deps = [
"//base:jni_java",
"//build/android:build_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
android_library("jni_annotation_sample_java") {
sources = [ "java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java" ]
deps = [
"//base:jni_java",
"//build/android:build_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_apk__final_jni", # For registration_header
"//base",
]
}
android_apk("sample_jni_apk") {
apk_name = "SampleJni"
android_manifest = "AndroidManifest.xml"
deps = [ ":jni_sample_java" ]
shared_libraries = [ ":jni_sample_lib" ]
manual_jni_registration = true
}
# 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") {
sources = [
"java/src/org/chromium/jni_generator/JniProcessor.java",
# Avoids a circular dependency with base:base_java. This is okay because
# no target should ever expect to package an annotation processor.
"//build/android/java/src/org/chromium/build/annotations/CheckDiscard.java",
"//build/android/java/src/org/chromium/build/annotations/MainDex.java",
]
main_class = "org.chromium.jni_generator.JniProcessor"
annotation_processor_deps =
[ "//third_party/android_deps:auto_service_processor" ]
deps = [
"//base:jni_java",
"//third_party/android_deps:com_google_auto_service_auto_service_annotations_java",
"//third_party/android_deps:com_google_guava_guava_java",
"//third_party/android_deps:com_squareup_javapoet_java",
]
}