Greatly improve (non-android) java support
commit3d85c6dd6a6540699d3baf583780577327a0cd13
authorcjhopman <cjhopman@chromium.org>
Tue, 18 Nov 2014 03:39:38 +0000 (17 19:39 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 18 Nov 2014 03:40:00 +0000 (18 03:40 +0000)
treee8cad397fdf00209ec10b3d87b041350e70621d5
parent81d0f757450f8b652bd2f8844ec0970ab9dbb5b4
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}
BUILD.gn
build/android/gyp/create_java_binary_script.py [new file with mode: 0755]
build/android/gyp/test/BUILD.gn [new file with mode: 0644]
build/android/gyp/test/java/org/chromium/helloworld/HelloWorldMain.java [new file with mode: 0644]
build/android/gyp/test/java/org/chromium/helloworld/HelloWorldPrinter.java [new file with mode: 0644]
build/android/gyp/write_build_config.py
build/config/android/internal_rules.gni
build/config/android/rules.gni
testing/android/junit/BUILD.gn
third_party/junit/BUILD.gn