Greatly improve (non-android) java support
This change fixes java_library and java_prebuilt to actually construct a
classpath based on their dependents. It adds java_binary that is similar
to java_library but also creates a script in $root_build_dir/bin/ to
actually run a java jar (it builds in the classpath and main class so
that it can just be run like a normal executable).
Adds the flags "android" and "has_android_platform" to the java_library
template. An android_library can depend on a java_library only if the
java_libary has "android == true". A java_library can depend on an
android_library only if the java_libary has
"has_android_platform == true".
This merges several of the paths for compiling java between android and
non-android implementations into a single one that just takes a flag
controlling it's behavior (enabling/disabling dex, for example).
Adds a very simple java_binary target. This can be run to ensure it works,
output is printed, and exit code is propagated.
TBR=brettw
BUG=359249,383646,417843
Review URL: https://codereview.chromium.org/
687633003
Cr-Commit-Position: refs/heads/master@{#304555}