This document provides an overview of the build architecture.
The build setup follows these core principles:
third_party/).tools/gradle.py, tools/test.py, etc.) ensure pre-builts (JDKs, Gradle binaries, local Maven caches) from Google Cloud Storage (GCS) before invoking Gradle.d8_r8/) coordinates the actual build.r8lib.jar release artifact rather than a debug build.+---------------------------------------------------------------------------------------+
| R8 COMPILER SUITE |
+---------------------------------------------------------------------------------------+
[main] ───────────────────────────> threading-module-blocking.jar ───────┐
[main] ───────────────────────────> threading-module-single-threaded.jar ┼──> deps.jar
[third_party], [resourceshrinker] ───────────────────────────────────────┘ │
│
[keepradius], [libanalyzer] ────────────────────────────────────────> proto.jar │
│ │
[main], [keepanno], [resourceshrinker], │ │
[keepradius], [libanalyzer], [assistant] ──┬──> r8-src.jar │ │
│ │ │
└──> r8-full-exclude-deps.jar │ │
r8lib-exclude-deps.jar <──────┘ │ │ │
▲ ▼ │ │
│ r8.jar <─────────────┴───────┘
│ / \
│ ▼ ▼
[tests] ───────────────> test-references ─--> r8lib.jar processkeepruleslib.jar
│
▼
r8lib.zip
+---------------------------------------------------------------------------------------+
| KEEP ANNOTATIONS TOOLS |
+---------------------------------------------------------------------------------------+
[keepanno] ──┬──> keepanno-annotations.jar
├──> keepanno-annotations-legacy.jar
├──> keepanno-annotations-androidx.jar
└──> keepanno-tools.jar ──> keepanno-toolslib.jar
+---------------------------------------------------------------------------------------+
| DESUGAR CONFIGURATION |
+---------------------------------------------------------------------------------------+
[library_desugar] ──> desugar_jdk_libs_configuration.zip
r8lib.zip:r8lib.jar with POM and checksum files in a Maven repository layout.r8lib.jar:r8.jar is compiled and optimized with R8 with respect to declared keep rules and dynamic keep rules from test-references.r8.jar:r8-full-exclude-deps.jar and proto.jar are bundled together, along with dependencies in deps.jar relocated under com.android.tools.r8.*.r8lib-exclude-deps.jar:deps.jar) that are not generic dependencies).r8-full-exclude-deps.jar is compiled and optimized with R8 with respect to declared keep rules and dynamic keep rules from test-references, using deps.jar and proto.jar as classpath.test-references:r8-full-exclude-deps.jar:main, keepanno, resourceshrinker, keepradius, libanalyzer, and assistant.r8-src.jar:main, keepanno, resourceshrinker, keepradius, libanalyzer, and assistant.deps.jar:third_party/, resource shrinker dependencies from resourceshrinker, threading-module-blocking.jar, threading-module-single-threaded.jar, and the consolidated LICENSE file are merged together.proto.jar:.proto schemas directly using their own toolchains.keepradius and libanalyzer are bundled together.threading-module-blocking.jar:main.threading-module-single-threaded.jar:threading-module-blocking.jar)main.processkeepruleslib.jar:r8.jar is compiled and optimized with R8 using src/main/keep_processkeeprules.txt.keepanno-toolslib.jar:keepanno-tools.jar is compiled and optimized with R8 with respect to keep rules, using unrelocated ASM on the classpath.keepanno-tools.jar:com.android.tools.r8.keepanno.*. ASM is kept external as it is used as the public API interface.keepanno and its non-ASM dependencies are bundled together, with dependencies relocated under com.android.tools.r8.keepanno.* (leaving ASM external for public API integration).keepanno-annotations.jar:com.android.tools.r8.keepanno.annotations.*.com.android.tools.r8.keepanno.annotations.*).keepanno.keepanno-annotations-legacy.jar:keepanno.keepanno-annotations-androidx.jar:androidx.annotation.keep.* package namespace.androidx.annotation.keep.*) of the keep-annotations library.keepanno.desugar_jdk_libs_configuration.zip:library_desugar with POM and checksum files in a Maven repository layout.