naiveproxy/base/android/jni_generator/BUILD.gn

88 lines
1.9 KiB
Plaintext
Raw Normal View History

2018-02-02 13:49:39 +03:00
# 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")
action("jni_generator_py_tests") {
_stamp = "$target_gen_dir/jni_generator_py_tests.stamp"
inputs = [
"jni_generator.py",
"jni_generator_tests.py",
"java/src/org/chromium/example/jni_generator/SampleForTests.java",
"SampleForTests_jni.golden",
]
outputs = [
_stamp,
]
script = "jni_generator_tests.py"
args = [
"--stamp",
rebase_path(_stamp, root_build_dir),
]
}
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",
]
}
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 = "//build/android/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_generator_py_tests",
":sample_jni_apk",
]
}