Index: build/android/gyp/javac.py |
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py |
index 7b346cfffac800051b387758a420bc894d75655f..926f275f2bf7e02d47d4b07d8a42ff606745f7dd 100755 |
--- a/build/android/gyp/javac.py |
+++ b/build/android/gyp/javac.py |
@@ -4,6 +4,7 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import distutils.spawn |
import optparse |
import os |
import shutil |
@@ -319,6 +320,13 @@ def _ParseOptions(argv): |
for arg in options.bootclasspath: |
bootclasspath += build_utils.ParseGnList(arg) |
options.bootclasspath = bootclasspath |
+ if options.java_version == '1.8' and options.bootclasspath: |
+ # Android's boot jar doesn't contain all java 8 classes. |
+ # See: https://github.com/evant/gradle-retrolambda/issues/23. |
+ javac_path = os.path.realpath(distutils.spawn.find_executable('javac')) |
+ jdk_dir = os.path.dirname(os.path.dirname(javac_path)) |
+ rt_jar = os.path.join(jdk_dir, 'jre', 'lib', 'rt.jar') |
+ options.bootclasspath.append(rt_jar) |
classpath = [] |
for arg in options.classpath: |