Fix gn jni generation rules for Android
The GN rules for the JNI generator currently generate the --includes
argument (that is, the #include line which gets emitted in the
generated jni.h header) in the following way:
generate_jni: always relative to the src root (e.g., content/foo/bar.h)
this is achieved by rebasing the jni_generator_include against //.
generate_jar_jni: relative to on root_build_dir (typically out/Release,
hence ../../content/foo/bar.h). This is achieved by rebasing the
jni_generator_include against root_build_dir.
generate_jni is fine, but relies on the target having set the root
src/ dir in the include path. The latter, instead, happens to work
only by accident because the targets that currently use it (currently
just surface_jni_headers) happen to have an include path which is at
distance two from the root src/ (so the generated #include
"../../base" happens to work).
This CL fixes both cases and causes the generated include to be always
relative to the destination folder of the generated header
(jni_output_dir). Furthermore, this change removes the dependency on
the generated header path. Rationale: the file itself is not an input
for the generator, the --include string gets just copied and pasted
into the generated file. Hence, the generator should not be re-run if
the contents of the jni_generator_helper.h changes.
Review URL: https://codereview.chromium.org/
1093643002
Cr-Commit-Position: refs/heads/master@{#325604}