Skip to content

Commit

Permalink
[Android] Make android templates in build/ usable without java.
Browse files Browse the repository at this point in the history
BUG=pdfium:38

Review-Url: https://codereview.chromium.org/2048133003
Cr-Commit-Position: refs/heads/master@{#398912}
  • Loading branch information
jbudorick authored and Commit bot committed Jun 9, 2016
1 parent 438dab8 commit ced2a25
Show file tree
Hide file tree
Showing 6 changed files with 4,136 additions and 4,092 deletions.
63 changes: 33 additions & 30 deletions build/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,44 @@
# found in the LICENSE file.

import("//build/config/android/rules.gni")
import("//third_party/ijar/ijar.gni")

sun_tools_jar_path = "$root_gen_dir/sun_tools_jar/tools.jar"
if (enable_java_templates) {
import("//third_party/ijar/ijar.gni")

# Create or update the API versions cache if necessary by running a
# functionally empty lint task. This prevents racy creation of the
# cache while linting java targets in android_lint.
android_lint("prepare_android_lint_cache") {
android_manifest = "//build/android/AndroidManifest.xml"
create_cache = true
}
sun_tools_jar_path = "$root_gen_dir/sun_tools_jar/tools.jar"

action("find_sun_tools_jar") {
script = "//build/android/gyp/find_sun_tools_jar.py"
depfile = "$target_gen_dir/$target_name.d"
outputs = [
depfile,
sun_tools_jar_path,
]
args = [
"--depfile",
rebase_path(depfile, root_build_dir),
"--output",
rebase_path(sun_tools_jar_path, root_build_dir),
]
}
# Create or update the API versions cache if necessary by running a
# functionally empty lint task. This prevents racy creation of the
# cache while linting java targets in android_lint.
android_lint("prepare_android_lint_cache") {
android_manifest = "//build/android/AndroidManifest.xml"
create_cache = true
}

java_prebuilt("sun_tools_java") {
jar_path = sun_tools_jar_path
jar_dep = ":find_sun_tools_jar"
}
action("find_sun_tools_jar") {
script = "//build/android/gyp/find_sun_tools_jar.py"
depfile = "$target_gen_dir/$target_name.d"
outputs = [
depfile,
sun_tools_jar_path,
]
args = [
"--depfile",
rebase_path(depfile, root_build_dir),
"--output",
rebase_path(sun_tools_jar_path, root_build_dir),
]
}

generate_interface_jar("android_ijar") {
input_jar = android_sdk_jar
output_jar = "$root_out_dir/lib.java/android.interface.jar"
java_prebuilt("sun_tools_java") {
jar_path = sun_tools_jar_path
jar_dep = ":find_sun_tools_jar"
}

generate_interface_jar("android_ijar") {
input_jar = android_sdk_jar
output_jar = "$root_out_dir/lib.java/android.interface.jar"
}
}

# Copy to the lib.unstripped directory so that gdb can easily find it.
Expand Down
5 changes: 5 additions & 0 deletions build/config/android/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ if (is_android) {
assert(rebase_path("//", root_build_dir) == "../../",
"Android output directory must be nested 2 levels within src/ (" +
"e.g.: out-gn/Debug). http://crbug.com/412935")

import("//build_overrides/build.gni")

has_chrome_android_internal =
exec_script("//build/dir_exists.py",
[ rebase_path("//clank", root_build_dir) ],
Expand All @@ -24,6 +27,8 @@ if (is_android) {
if (!defined(default_android_ndk_root)) {
default_android_ndk_root = "//third_party/android_tools/ndk"
default_android_ndk_version = "r10e"
} else {
assert(defined(default_android_ndk_version))
}

if (!defined(default_android_sdk_root)) {
Expand Down
Loading

0 comments on commit ced2a25

Please sign in to comment.