Commit ea4a0109 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Add use_java_goma GN arg for moving javac to goma

Bug: 726475
Change-Id: I6cc99d0d721c1f94203d2b9461e72ce2239b6a80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029261
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarSimon Que <sque@chromium.org>
Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736837}
parent 9d43bcbd
......@@ -513,6 +513,8 @@ def _ParseOptions(argv):
type='int',
help='Whether code being compiled should be built with stricter '
'warnings for chromium code.')
parser.add_option(
'--gomacc-path', help='When set, prefix javac command with gomacc')
parser.add_option(
'--errorprone-path', help='Use the Errorprone compiler at this path.')
parser.add_option(
......@@ -566,7 +568,11 @@ def main(argv):
options, java_files = _ParseOptions(argv)
javac_path = build_utils.JAVAC_PATH
javac_cmd = [
javac_cmd = []
if options.gomacc_path:
javac_cmd.append(options.gomacc_path)
javac_cmd += [
javac_path,
'-g',
# Chromium only allows UTF8 source files. Being explicit avoids
......
......@@ -10,6 +10,7 @@ import("//build/config/coverage/coverage.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/python.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/toolchain/goma.gni")
import("//build/util/generate_wrapper.gni")
import("//build_overrides/build.gni")
assert(is_android)
......@@ -2729,6 +2730,9 @@ if (enable_java_templates) {
"--processorpath=@FileArg($_rebased_build_config:javac:processor_classpath)",
"--processors=@FileArg($_rebased_build_config:javac:processor_classes)",
]
if (use_java_goma) {
args += [ "--gomacc-path=$goma_dir/gomacc" ]
}
if (defined(invoker.srcjar_filearg)) {
args += [ "--java-srcjars=${invoker.srcjar_filearg}" ]
}
......
......@@ -29,6 +29,9 @@ declare_args() {
}
declare_args() {
# TODO(crbug.com/726475): true if use_goma = true in the future.
use_java_goma = false
# Auto-configure for Goma RBE backend.
# TODO(crbug.com/1015730): true if use_goma = true in the future.
ios_use_goma_rbe = false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment