Don't use reflective lookup for calling command builder code
This will compile a set of java files against TOT, allowing us to
directly use the api instead of reflective lookup.
We put this on classpath for the compiledump invocation, and catch any
missing class or method errors.
New files in this directory are automatically compiled, but one should
ensure that functionality that are added in different versions of R8
are added to different files (to avoid issues loading the class for
old functionality)
This only enables this for resource shrinker, I will change the rest
if we agree on this approach.
Bug: b/377606434
Change-Id: I6db890440de6c188f5da15c55723fc1579523c17
diff --git a/tools/utils.py b/tools/utils.py
index 86d7e8d..66f8e36 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -32,7 +32,8 @@
DEPENDENCIES_DIR = os.path.join(THIRD_PARTY, 'dependencies')
BUILD = os.path.join(REPO_ROOT, 'build')
-BUILD_JAVA_MAIN_DIR = os.path.join(BUILD, 'classes', 'java', 'main')
+BUILD_JAVA_MAIN_DIR = os.path.join(REPO_ROOT, 'd8_r8', 'main', 'build',
+ 'classes', 'java', 'main')
LIBS = os.path.join(BUILD, 'libs')
CUSTOM_CONVERSION_DIR = os.path.join(THIRD_PARTY, 'openjdk',
'custom_conversion')
@@ -44,6 +45,7 @@
GRADLE_TASK_CONSOLIDATED_LICENSE = ':main:consolidatedLicense'
GRADLE_TASK_KEEP_ANNO_JAR = ':keepanno:keepAnnoAnnotationsJar'
GRADLE_TASK_KEEP_ANNO_DOC = ':keepanno:keepAnnoAnnotationsDoc'
+GRADLE_TASK_MAIN_COMPILE = ':main:compileJava'
GRADLE_TASK_R8 = ':main:r8WithRelocatedDeps'
GRADLE_TASK_R8LIB = ':test:assembleR8LibWithRelocatedDeps'
GRADLE_TASK_R8LIB_NO_DEPS = ':test:assembleR8LibNoDeps'