blob: c4ba619b9c3c3c5dee8cf150352d903a48171520 [file]
// Copyright (c) 2026, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8;
import com.android.tools.r8.desugar.desugaredlibrary.test.LibraryDesugaringSpecification.CustomConversionVersion;
import com.android.tools.r8.utils.AndroidApiLevel;
import com.android.tools.r8.utils.internal.exceptions.Unreachable;
import com.google.common.collect.ImmutableMap;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
import org.junit.Assume;
/**
* All reading of external files in tests should be managed by this class, which encloses the
* untyped interface with the Gradle setup and system properties.
*
* <p>All paths configured for and returned by {@link TestDeps} must be and are absolute.
*
* <p>Even though this code lies in testbase, all dependencies should not be declared in testbase.
* It is the callers of these accessors that have responsibility to add the respective dependency.
* E.g. if module A calls {@link #getJunitJar}, module A should declare the runtimeOnlyData
* dependency on Junit.
*
* <p>Never call {@link TestDeps} accessors during class initialization (e.g., in {@code static}
* fields) or {@code @Parameters} evaluation, as unavailable dependencies (such as internal
* dependencies with {@code --no-internal}) skip tests via {@link Assume#assumeTrue} and must only
* be evaluated during test execution.
*/
public class TestDeps {
private static Path getTestDependency(String name) {
String prop = "TEST_DEP_" + name;
String value = System.getProperty(prop);
if (value == null) {
throw new RuntimeException("Required test dependency system property not set: " + prop);
}
if (value.startsWith("None:")) {
Assume.assumeTrue(
"Test property missing with reason: "
+ value.substring("None:".length())
+ " ("
+ prop
+ ")",
false);
}
Path path = Paths.get(value);
if (!Files.exists(path)) {
throw new RuntimeException("Required test dependency does not exit: " + prop + "=" + path);
}
return path;
}
private static final Map<String, Path> dependencies;
static {
// This list serves as a list of required properties to match in Gradle.
dependencies = new HashMap<>();
dependencies.put("AAPT2", null);
dependencies.put("AGSA", null);
dependencies.put("ANDROID_JAR_14", null);
dependencies.put("ANDROID_JAR_15", null);
dependencies.put("ANDROID_JAR_19", null);
dependencies.put("ANDROID_JAR_21", null);
dependencies.put("ANDROID_JAR_22", null);
dependencies.put("ANDROID_JAR_23", null);
dependencies.put("ANDROID_JAR_24", null);
dependencies.put("ANDROID_JAR_25", null);
dependencies.put("ANDROID_JAR_26", null);
dependencies.put("ANDROID_JAR_27", null);
dependencies.put("ANDROID_JAR_28", null);
dependencies.put("ANDROID_JAR_29", null);
dependencies.put("ANDROID_JAR_30", null);
dependencies.put("ANDROID_JAR_31", null);
dependencies.put("ANDROID_JAR_32", null);
dependencies.put("ANDROID_JAR_33", null);
dependencies.put("ANDROID_JAR_34", null);
dependencies.put("ANDROID_JAR_35", null);
dependencies.put("ANDROID_JAR_36", null);
dependencies.put("ANDROID_JAR_36_1", null);
dependencies.put("ANDROID_JAR_37", null);
dependencies.put("ANDROID_JAR_37_1", null);
dependencies.put("ANDROID_JAR_37_2", null);
dependencies.put("ANDROID_JAR_LIBCORE_LATEST", null);
dependencies.put("ANDROID_JAR_MAIN", null);
dependencies.put("API_DATABASE", null);
dependencies.put("ART_DEFAULT", null);
dependencies.put("ART_5_1_1", null);
dependencies.put("ART_6_0_1", null);
dependencies.put("ART_7_0_0", null);
dependencies.put("ART_8_1_0", null);
dependencies.put("ART_9_0_0", null);
dependencies.put("ART_10_0_0", null);
dependencies.put("ART_12_0_0", null);
dependencies.put("ART_13_0_0", null);
dependencies.put("ART_14_0_0", null);
dependencies.put("ART_15_0_0", null);
dependencies.put("ART_16_0_0", null);
dependencies.put("ART_16_1_0", null);
dependencies.put("ART_17_0_0", null);
dependencies.put("ART_17_1_0", null);
dependencies.put("ART_17_2_0", null);
dependencies.put("ART_MAIN", null);
dependencies.put("ART_TESTS", null);
dependencies.put("ART_TESTS_LEGACY", null);
dependencies.put("BOOKSTORY", null);
dependencies.put("BUNDLETOOL", null);
dependencies.put("CHROME", null);
dependencies.put("CHROME_BENCHMARK", null);
dependencies.put("CHROME_HEADLESS", null);
dependencies.put("CLANK", null);
dependencies.put("COMPILER_API", null);
dependencies.put("COMPOSE_EXAMPLES_CHANGED_BITWISE_VALUE_PROPAGATION", null);
dependencies.put("COMPOSE_SAMPLES_CRANE", null);
dependencies.put("COMPOSE_SAMPLES_JETCASTER", null);
dependencies.put("COMPOSE_SAMPLES_JETCHAT", null);
dependencies.put("COMPOSE_SAMPLES_JETLAGGED", null);
dependencies.put("COMPOSE_SAMPLES_JETNEWS", null);
dependencies.put("COMPOSE_SAMPLES_JETSNACK", null);
dependencies.put("COMPOSE_SAMPLES_OWL", null);
dependencies.put("COMPOSE_SAMPLES_REPLY", null);
dependencies.put("CORE_LAMBDA_STUBS", null);
dependencies.put("DAGGER", null);
dependencies.put("DALVIK_4_0_4", null);
dependencies.put("DALVIK_4_4_4", null);
dependencies.put("DEPENDENCIES", null);
dependencies.put("DESUGAR_JDK_LIBS_11", null);
dependencies.put("DESUGAR_JDK_LIBS_8", null);
dependencies.put("DESUGAR_LIBRARY_CONVERSIONS", null);
dependencies.put("DESUGAR_LIBRARY_RELEASE_1_0_9", null);
dependencies.put("DESUGAR_LIBRARY_RELEASE_1_0_10", null);
dependencies.put("DESUGAR_LIBRARY_RELEASE_1_1_0", null);
dependencies.put("DESUGAR_LIBRARY_RELEASE_1_1_1", null);
dependencies.put("DESUGAR_LIBRARY_RELEASE_1_1_5", null);
dependencies.put("DESUGAR_LIBRARY_RELEASE_2_0_3", null);
dependencies.put("DEX2OAT_33_10", null);
dependencies.put("DEX2OAT_35_14", null);
dependencies.put("DEX2OAT_36_0", null);
dependencies.put("DEX2OAT_HEAD", null);
dependencies.put("EXAMPLES", null);
dependencies.put("EXAMPLES_ANDROID_N", null);
dependencies.put("EXAMPLES_ANDROID_O", null);
dependencies.put("EXAMPLES_ANDROID_O_GENERATED", null);
dependencies.put("EXAMPLES_ANDROID_O_LEGACY", null);
dependencies.put("EXAMPLES_ANDROID_P", null);
dependencies.put("FEEDER", null);
dependencies.put("FOSSIFY_FILE_MANAGER", null);
dependencies.put("FRAMEWORK", null);
dependencies.put("GMSCORE_LATEST", null);
dependencies.put("GMSCORE_V10", null);
dependencies.put("GOOGLE_JAVA_FORMAT", null);
dependencies.put("GOOGLE_KOTLIN_FORMAT", null);
dependencies.put("GSON", null);
dependencies.put("GUAVA_JRE", null);
dependencies.put("INTERNAL_ISSUE_127524985", null);
dependencies.put("JACOCO", null);
dependencies.put("JAVA_8_RUNTIME", null);
dependencies.put("JAVA_BASE_EXTENSION", null);
dependencies.put("JDK_8", null);
dependencies.put("JDK_9", null);
dependencies.put("JDK_11", null);
dependencies.put("JDK11_TEST", null);
dependencies.put("JDK_17", null);
dependencies.put("JDK_21", null);
dependencies.put("JDK21_FLOAT16_TEST", null);
dependencies.put("JDK_25", null);
dependencies.put("JDK_27", null);
dependencies.put("JDWP_TESTS", null);
dependencies.put("JSR223", null);
dependencies.put("KEEPASSDX", null);
dependencies.put("KOTLIN_COMPILER_1_3_72", null);
dependencies.put("KOTLIN_COMPILER_1_4_20", null);
dependencies.put("KOTLIN_COMPILER_1_5_0", null);
dependencies.put("KOTLIN_COMPILER_1_6_0", null);
dependencies.put("KOTLIN_COMPILER_1_7_0", null);
dependencies.put("KOTLIN_COMPILER_1_8_0", null);
dependencies.put("KOTLIN_COMPILER_1_9_21", null);
dependencies.put("KOTLIN_COMPILER_2_0_20", null);
dependencies.put("KOTLIN_COMPILER_2_1_10", null);
dependencies.put("KOTLIN_COMPILER_2_2_0", null);
dependencies.put("KOTLIN_COMPILER_2_3_10", null);
dependencies.put("KOTLIN_COMPILER_2_4_20", null);
dependencies.put("KOTLIN_COMPILER_DEV", null);
dependencies.put("KOTLIN_R8_TEST_RESOURCES", null);
dependencies.put("KOTLINX_COROUTINES", null);
dependencies.put("MULTIDEX", null);
dependencies.put("NEST", null);
dependencies.put("NEWPIPE", null);
dependencies.put("NOWINANDROID", null);
dependencies.put("OMNINOTES", null);
dependencies.put("OPENTRACKS", null);
dependencies.put("PROCESS_KEEP_RULES_BINARY_COMPATIBILITY", null);
dependencies.put("PROGUARD_7_0_0", null);
dependencies.put("PROGUARD_7_7_0", null);
dependencies.put("PROGUARD_SETTINGS", null);
dependencies.put("PROTO_RUNTIME_EDITION2023", null);
dependencies.put("PROTO_RUNTIME_LEGACY", null);
dependencies.put("PROTO_TEST_EDITION2023", null);
dependencies.put("PROTO_TEST_PROTO2", null);
dependencies.put("PROTO_TEST_PROTO3", null);
dependencies.put("R8", null);
dependencies.put("R8_MAPPINGS", null);
dependencies.put("R8_V2_0_74", null);
dependencies.put("R8_V3_2_54", null);
dependencies.put("R8_V8_0_46", null);
dependencies.put("READYOU", null);
dependencies.put("RETRACE_BENCHMARK", null);
dependencies.put("RETRACE_BINARY_COMPATIBILITY", null);
dependencies.put("RETRACE_INTERNAL", null);
dependencies.put("RETRACE_PARTITION_FORMATS", null);
dependencies.put("RHINO", null);
dependencies.put("RHINO_ANDROID", null);
dependencies.put("SMALI", null);
dependencies.put("SYSTEM_UI", null);
dependencies.put("TIVI", null);
dependencies.put("TUSKY", null);
dependencies.put("YOUTUBE_21_40", null);
dependencies.put("YOUTUBE_21_40_D8_MERGE", null);
}
private static Path getDependency(String key) {
return dependencies.computeIfAbsent(key, TestDeps::getTestDependency);
}
public static Path getAapt2() {
return getDependencyPath("AAPT2", "aapt2");
}
public static Path getAgsaDir() {
return getDependency("AGSA");
}
public static Path getAndroidJar14Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(14));
return getDependency("ANDROID_JAR_14");
}
public static Path getAndroidJar15Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(15));
return getDependency("ANDROID_JAR_15");
}
public static Path getAndroidJar19Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(19));
return getDependency("ANDROID_JAR_19");
}
public static Path getAndroidJar21Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(21));
return getDependency("ANDROID_JAR_21");
}
public static Path getAndroidJar22Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(22));
return getDependency("ANDROID_JAR_22");
}
public static Path getAndroidJar23Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(23));
return getDependency("ANDROID_JAR_23");
}
public static Path getAndroidJar24Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(24));
return getDependency("ANDROID_JAR_24");
}
public static Path getAndroidJar25Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(25));
return getDependency("ANDROID_JAR_25");
}
public static Path getAndroidJar26Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(26));
return getDependency("ANDROID_JAR_26");
}
public static Path getAndroidJar27Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(27));
return getDependency("ANDROID_JAR_27");
}
public static Path getAndroidJar28Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(28));
return getDependency("ANDROID_JAR_28");
}
public static Path getAndroidJar29Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(29));
return getDependency("ANDROID_JAR_29");
}
public static Path getAndroidJar30Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(30));
return getDependency("ANDROID_JAR_30");
}
public static Path getAndroidJar31Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(31));
return getDependency("ANDROID_JAR_31");
}
public static Path getAndroidJar32Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(32));
return getDependency("ANDROID_JAR_32");
}
public static Path getAndroidJar33Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(33));
return getDependency("ANDROID_JAR_33");
}
public static Path getAndroidJar34Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(34));
return getDependency("ANDROID_JAR_34");
}
public static Path getAndroidJar35Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(35));
return getDependency("ANDROID_JAR_35");
}
public static Path getAndroidJar36Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(36));
return getDependency("ANDROID_JAR_36");
}
public static Path getAndroidJar36_1Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(36, 1));
return getDependency("ANDROID_JAR_36_1");
}
public static Path getAndroidJar37Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(37));
return getDependency("ANDROID_JAR_37");
}
public static Path getAndroidJar37_1Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(37, 1));
return getDependency("ANDROID_JAR_37_1");
}
public static Path getAndroidJar37_2Dir() {
assert canHaveAndroidJar(AndroidApiLevel.getAndroidApiLevel(37, 2));
return getDependency("ANDROID_JAR_37_2");
}
public static Path getAndroidJarLibcoreLatestDir() {
return getDependency("ANDROID_JAR_LIBCORE_LATEST");
}
public static Path getAndroidJarLibcoreLatestPath(String... path) {
return getDependencyPath("ANDROID_JAR_LIBCORE_LATEST", path);
}
public static Path getAndroidJarMainDir() {
assert canHaveAndroidJar(AndroidApiLevel.MAIN);
return getDependency("ANDROID_JAR_MAIN");
}
private static final Map<AndroidApiLevel, Supplier<Path>> ANDROID_JAR_DIRS =
ImmutableMap.<AndroidApiLevel, Supplier<Path>>builder()
.put(AndroidApiLevel.I, TestDeps::getAndroidJar14Dir)
.put(AndroidApiLevel.I_MR1, TestDeps::getAndroidJar15Dir)
.put(AndroidApiLevel.K, TestDeps::getAndroidJar19Dir)
.put(AndroidApiLevel.L, TestDeps::getAndroidJar21Dir)
.put(AndroidApiLevel.L_MR1, TestDeps::getAndroidJar22Dir)
.put(AndroidApiLevel.M, TestDeps::getAndroidJar23Dir)
.put(AndroidApiLevel.N, TestDeps::getAndroidJar24Dir)
.put(AndroidApiLevel.N_MR1, TestDeps::getAndroidJar25Dir)
.put(AndroidApiLevel.O, TestDeps::getAndroidJar26Dir)
.put(AndroidApiLevel.O_MR1, TestDeps::getAndroidJar27Dir)
.put(AndroidApiLevel.P, TestDeps::getAndroidJar28Dir)
.put(AndroidApiLevel.Q, TestDeps::getAndroidJar29Dir)
.put(AndroidApiLevel.R, TestDeps::getAndroidJar30Dir)
.put(AndroidApiLevel.S, TestDeps::getAndroidJar31Dir)
.put(AndroidApiLevel.Sv2, TestDeps::getAndroidJar32Dir)
.put(AndroidApiLevel.T, TestDeps::getAndroidJar33Dir)
.put(AndroidApiLevel.U, TestDeps::getAndroidJar34Dir)
.put(AndroidApiLevel.V, TestDeps::getAndroidJar35Dir)
.put(AndroidApiLevel.BAKLAVA, TestDeps::getAndroidJar36Dir)
.put(AndroidApiLevel.BAKLAVA_1, TestDeps::getAndroidJar36_1Dir)
.put(AndroidApiLevel.CINNAMON_BUN, TestDeps::getAndroidJar37Dir)
.put(AndroidApiLevel.CINNAMON_BUN_1, TestDeps::getAndroidJar37_1Dir)
.put(AndroidApiLevel.CINNAMON_BUN_2, TestDeps::getAndroidJar37_2Dir)
.put(AndroidApiLevel.MAIN, TestDeps::getAndroidJarMainDir)
.build();
/**
* Returns {@code true} if this API level is known to have an {@code android.jar}. Note that
* returning {@code false} is certain, while returning {@code true} means that its presence is
* dependent on the build configuration.
*/
public static boolean canHaveAndroidJar(AndroidApiLevel apiLevel) {
return ANDROID_JAR_DIRS.containsKey(apiLevel);
}
public static Path getAndroidJarDir(AndroidApiLevel apiLevel) {
Supplier<Path> supplier = ANDROID_JAR_DIRS.get(apiLevel);
if (supplier == null) {
throw new Unreachable("No android.jar for API level " + apiLevel);
}
return supplier.get();
}
public static Path getAndroidJarPath(AndroidApiLevel apiLevel) {
return getAndroidJarDir(apiLevel).resolve("android.jar");
}
public static Path getApiVersionsXmlPath(AndroidApiLevel apiLevel) {
Path dir = getAndroidJarDir(apiLevel);
if (apiLevel == AndroidApiLevel.MAIN) {
return dir.resolve("data").resolve("api-versions.xml");
}
return dir.resolve("api-versions.xml");
}
public static Path getApiDatabasePath() {
return getDependencyPath("API_DATABASE", "resources", "api_database.ser");
}
public static Path getArtDefaultDir() {
return getDependency("ART_DEFAULT");
}
public static Path getArt5_1_1Dir() {
return getDependency("ART_5_1_1");
}
public static Path getArt6_0_1Dir() {
return getDependency("ART_6_0_1");
}
public static Path getArt7_0_0Dir() {
return getDependency("ART_7_0_0");
}
public static Path getArt8_1_0Dir() {
return getDependency("ART_8_1_0");
}
public static Path getArt9_0_0Dir() {
return getDependency("ART_9_0_0");
}
public static Path getArt10_0_0Dir() {
return getDependency("ART_10_0_0");
}
public static Path getArt12_0_0Dir() {
return getDependency("ART_12_0_0");
}
public static Path getArt13_0_0Dir() {
return getDependency("ART_13_0_0");
}
public static Path getArt14_0_0Dir() {
return getDependency("ART_14_0_0");
}
public static Path getArt15_0_0Dir() {
return getDependency("ART_15_0_0");
}
public static Path getArt16_0_0Dir() {
return getDependency("ART_16_0_0");
}
public static Path getArt16_1_0Dir() {
return getDependency("ART_16_1_0");
}
public static Path getArt17_0_0Dir() {
return getDependency("ART_17_0_0");
}
public static Path getArt17_1_0Dir() {
return getDependency("ART_17_1_0");
}
public static Path getArt17_2_0Dir() {
return getDependency("ART_17_2_0");
}
public static Path getArtMainDir() {
return getDependency("ART_MAIN");
}
public static Path getArtTestsDir() {
return getDependency("ART_TESTS");
}
public static Path getArtTestsPath(String... path) {
return getDependencyPath("ART_TESTS", path);
}
public static Path getArtTestsLegacyDir() {
return getDependency("ART_TESTS_LEGACY");
}
public static Path getArtTestsLegacyPath(String... path) {
return getDependencyPath("ART_TESTS_LEGACY", path);
}
public static Path getBookStoryDir() {
return getDependency("BOOKSTORY");
}
public static Path getBundleToolJar() {
return getDependencyPath("BUNDLETOOL", "bundletool-all-1.11.0.jar");
}
public static Path getChrome200430Dir() {
return getDependency("CHROME");
}
public static Path getChromeBenchmarkDir() {
return getDependency("CHROME_BENCHMARK");
}
public static Path getChromeHeadlessDir() {
return getDependency("CHROME_HEADLESS");
}
public static Path getClankDir() {
return getDependency("CLANK");
}
public static Path getCompilerApiBinaryCompatibilityJar() {
return getDependencyPath("COMPILER_API", "tests.jar");
}
public static Path getComposeExamplesChangedBitwiseValuePropagationDumpZip() {
return getDependencyPath("COMPOSE_EXAMPLES_CHANGED_BITWISE_VALUE_PROPAGATION", "dump.zip");
}
public static Path getComposeSamplesCraneDir() {
return getDependency("COMPOSE_SAMPLES_CRANE");
}
public static Path getComposeSamplesJetCasterDir() {
return getDependency("COMPOSE_SAMPLES_JETCASTER");
}
public static Path getComposeSamplesJetChatDir() {
return getDependency("COMPOSE_SAMPLES_JETCHAT");
}
public static Path getComposeSamplesJetLaggedDir() {
return getDependency("COMPOSE_SAMPLES_JETLAGGED");
}
public static Path getComposeSamplesJetNewsDir() {
return getDependency("COMPOSE_SAMPLES_JETNEWS");
}
public static Path getComposeSamplesJetSnackDir() {
return getDependency("COMPOSE_SAMPLES_JETSNACK");
}
public static Path getComposeSamplesOwlDir() {
return getDependency("COMPOSE_SAMPLES_OWL");
}
public static Path getComposeSamplesReplyDir() {
return getDependency("COMPOSE_SAMPLES_REPLY");
}
public static Path getCoreLambdaStubsJar() {
return getDependencyPath("CORE_LAMBDA_STUBS", "core-lambda-stubs.jar");
}
public static Path getDaggerPath(String... path) {
return getDependencyPath("DAGGER", path);
}
public static Path getDalvik4_0_4Dir() {
return getDependency("DALVIK_4_0_4");
}
public static Path getDalvik4_4_4Dir() {
return getDependency("DALVIK_4_4_4");
}
public static Path getDesugarJdkLibs11Jar() {
return getDependencyPath("DESUGAR_JDK_LIBS_11", "desugar_jdk_libs.jar");
}
public static Path getDesugarJdkLibs8Jar() {
return getDependencyPath("DESUGAR_JDK_LIBS_8", "desugar_jdk_libs.jar");
}
public static Path getDesugarLibraryConversionsDir() {
return getDependency("DESUGAR_LIBRARY_CONVERSIONS");
}
public static Path getDesugarLibraryConversions(CustomConversionVersion version) {
return getDependencyPath("DESUGAR_LIBRARY_CONVERSIONS", version.getFileName());
}
public static Path getDesugarLibraryRelease1_0_9Dir() {
return getDependency("DESUGAR_LIBRARY_RELEASE_1_0_9");
}
public static Path getDesugarLibraryRelease1_0_10Dir() {
return getDependency("DESUGAR_LIBRARY_RELEASE_1_0_10");
}
public static Path getDesugarLibraryRelease1_1_0Dir() {
return getDependency("DESUGAR_LIBRARY_RELEASE_1_1_0");
}
public static Path getDesugarLibraryRelease1_1_1Dir() {
return getDependency("DESUGAR_LIBRARY_RELEASE_1_1_1");
}
public static Path getDesugarLibraryRelease1_1_5Dir() {
return getDependency("DESUGAR_LIBRARY_RELEASE_1_1_5");
}
public static Path getDesugarLibraryRelease2_0_3Dir() {
return getDependency("DESUGAR_LIBRARY_RELEASE_2_0_3");
}
public static Path getDex2Oat33_10Dir() {
return getDependency("DEX2OAT_33_10");
}
public static Path getDex2Oat35_14Dir() {
return getDependency("DEX2OAT_35_14");
}
public static Path getDex2Oat36_0Dir() {
return getDependency("DEX2OAT_36_0");
}
public static Path getDex2OatHeadDir() {
return getDependency("DEX2OAT_HEAD");
}
public static Path getExamplesDir() {
return getDependency("EXAMPLES");
}
public static Path getExamplesPath(String... path) {
return getDependencyPath("EXAMPLES", path);
}
public static Path getExamplesAndroidNDir() {
return getDependency("EXAMPLES_ANDROID_N");
}
public static Path getExamplesAndroidNPath(String... path) {
return getDependencyPath("EXAMPLES_ANDROID_N", path);
}
public static Path getExamplesAndroidOPath(String... path) {
return getDependencyPath("EXAMPLES_ANDROID_O", path);
}
public static Path getExamplesAndroidOGeneratedPath(String... path) {
return getDependencyPath("EXAMPLES_ANDROID_O_GENERATED", path);
}
public static Path getExamplesAndroidOLegacyDir() {
return getDependency("EXAMPLES_ANDROID_O_LEGACY");
}
public static Path getExamplesAndroidOLegacyPath(String... path) {
return getDependencyPath("EXAMPLES_ANDROID_O_LEGACY", path);
}
public static Path getExamplesAndroidPPath(String... path) {
return getDependencyPath("EXAMPLES_ANDROID_P", path);
}
public static Path getFeederDir() {
return getDependency("FEEDER");
}
public static Path getFossifyFileManagerDir() {
return getDependency("FOSSIFY_FILE_MANAGER");
}
public static Path getFrameworkPath(String... path) {
return getDependencyPath("FRAMEWORK", path);
}
public static Path getGmscoreLatestDir() {
return getDependency("GMSCORE_LATEST");
}
public static Path getGmscoreV10Dir() {
return getDependency("GMSCORE_V10");
}
public static Path getGoogleJavaFormatJar() {
return getDependencyPath("GOOGLE_JAVA_FORMAT", "google-java-format-1.24.0-all-deps.jar");
}
public static Path getGoogleKotlinFormatJar() {
return getDependencyPath("GOOGLE_KOTLIN_FORMAT", "ktfmt-0.54-jar-with-dependencies.jar");
}
public static Path getGsonJar() {
return getDependencyPath("GSON", "gson-2.10.1.jar");
}
public static Path getGsonKeepRules() {
return getDependencyPath("GSON", "gson.pro");
}
public static Path getGuavaJreJar() {
return getDependencyPath("GUAVA_JRE", "guava-32.1.2-jre.jar");
}
public static Path getInternalIssue127524985Jar() {
return getDependencyPath("INTERNAL_ISSUE_127524985", "issue-127524985.jar");
}
public static Path getJacocoAgentJar() {
return getDependencyPath("JACOCO", "lib", "jacocoagent.jar");
}
public static Path getJacocoCliJar() {
return getDependencyPath("JACOCO", "lib", "jacococli.jar");
}
public static Path getJava8RuntimeDir() {
return getDependency("JAVA_8_RUNTIME");
}
public static Path getJava8RuntimeJar() {
return getDependencyPath("JAVA_8_RUNTIME", "rt.jar");
}
public static Path getJavaBaseExtensionJar() {
return getDependency("JAVA_BASE_EXTENSION");
}
public static Path getJdk8Dir() {
return getDependency("JDK_8");
}
public static Path getJdk9Dir() {
return getDependency("JDK_9");
}
public static Path getJdk11Dir() {
return getDependency("JDK_11");
}
public static Path getJdk11TestPath(String... path) {
return getDependencyPath("JDK11_TEST", path);
}
public static Path getJdk17Dir() {
return getDependency("JDK_17");
}
public static Path getJdk21Dir() {
return getDependency("JDK_21");
}
public static Path getJdk21Float16TestPath(String... path) {
return getDependencyPath("JDK21_FLOAT16_TEST", path);
}
public static Path getJdk25Dir() {
return getDependency("JDK_25");
}
public static Path getJdk27Dir() {
return getDependency("JDK_27");
}
public static Path getJsr223RiJar() {
return getDependencyPath("JSR223", "jsr223-api-1.0.jar");
}
public static Path getKeePassDXDir() {
return getDependency("KEEPASSDX");
}
public static Path getKotlinCompiler1_3_72Dir() {
return getDependency("KOTLIN_COMPILER_1_3_72");
}
public static Path getKotlinCompiler1_4_20Dir() {
return getDependency("KOTLIN_COMPILER_1_4_20");
}
public static Path getKotlinCompiler1_5_0Dir() {
return getDependency("KOTLIN_COMPILER_1_5_0");
}
public static Path getKotlinCompiler1_6_0Dir() {
return getDependency("KOTLIN_COMPILER_1_6_0");
}
public static Path getKotlinCompiler1_7_0Dir() {
return getDependency("KOTLIN_COMPILER_1_7_0");
}
public static Path getKotlinCompiler1_8_0Dir() {
return getDependency("KOTLIN_COMPILER_1_8_0");
}
public static Path getKotlinCompiler1_9_21Dir() {
return getDependency("KOTLIN_COMPILER_1_9_21");
}
public static Path getKotlinCompiler2_0_20Dir() {
return getDependency("KOTLIN_COMPILER_2_0_20");
}
public static Path getKotlinCompiler2_1_10Dir() {
return getDependency("KOTLIN_COMPILER_2_1_10");
}
public static Path getKotlinCompiler2_2_0Dir() {
return getDependency("KOTLIN_COMPILER_2_2_0");
}
public static Path getKotlinCompiler2_3_10Dir() {
return getDependency("KOTLIN_COMPILER_2_3_10");
}
public static Path getKotlinCompiler2_4_20Dir() {
return getDependency("KOTLIN_COMPILER_2_4_20");
}
public static Path getKotlinCompilerDevDir() {
return getDependency("KOTLIN_COMPILER_DEV");
}
public static Path getKotlinR8TestResourcesPath(String... path) {
return getDependencyPath("KOTLIN_R8_TEST_RESOURCES", path);
}
public static Path getKotlinxCoroutinesPath(String... path) {
return getDependencyPath("KOTLINX_COROUTINES", path);
}
public static Path getMultidex1_0_3Jar() {
return getDependencyPath("MULTIDEX", "multidex-1.0.3.jar");
}
public static Path getMultidexInstrumentation1_0_3Jar() {
return getDependencyPath("MULTIDEX", "multidex-instrumentation-1.0.3.jar");
}
public static Path getMultidex2_0_1Jar() {
return getDependencyPath("MULTIDEX", "multidex-2.0.1.jar");
}
public static Path getMultidexInstrumentation2_0_0Jar() {
return getDependencyPath("MULTIDEX", "multidex-instrumentation-2.0.0.jar");
}
public static Path getNestDir() {
return getDependency("NEST");
}
public static Path getNewPipeDir() {
return getDependency("NEWPIPE");
}
public static Path getNowInAndroidDir() {
return getDependency("NOWINANDROID");
}
public static Path getNowInAndroidDumpAppZip() {
return getDependencyPath("NOWINANDROID", "dump_app.zip");
}
public static Path getOmniNotesDir() {
return getDependency("OMNINOTES");
}
public static Path getOpenTracksDir() {
return getDependency("OPENTRACKS");
}
public static Path getProcessKeepRulesBinaryCompatibilityJar() {
return getDependencyPath("PROCESS_KEEP_RULES_BINARY_COMPATIBILITY", "tests.jar");
}
public static Path getProguard7_0_0Dir() {
return getDependency("PROGUARD_7_0_0");
}
public static Path getProguard7_7_0Dir() {
return getDependency("PROGUARD_7_7_0");
}
public static Path getProtoRuntimeEdition2023Dir() {
return getDependency("PROTO_RUNTIME_EDITION2023");
}
public static Path getProtoRuntimeLegacyDir() {
return getDependency("PROTO_RUNTIME_LEGACY");
}
public static Path getProtoTestEdition2023Dir() {
return getDependency("PROTO_TEST_EDITION2023");
}
public static Path getProtoTestProto2Dir() {
return getDependency("PROTO_TEST_PROTO2");
}
public static Path getProtoTestProto3Dir() {
return getDependency("PROTO_TEST_PROTO3");
}
public static Path getR8Jar() {
return getDependencyPath("R8", "r8.jar");
}
public static Path getR8Path(String... path) {
return getDependencyPath("R8", path);
}
public static Path getR8WithDeps17Jar() {
return getDependencyPath("R8", "r8_with_deps_17.jar");
}
public static Path getR8MappingsPath(String... path) {
return getDependencyPath("R8_MAPPINGS", path);
}
public static Path getR8V2_0_74LibJar() {
return getDependencyPath("R8_V2_0_74", "r8lib.jar");
}
public static Path getR8V3_2_54Jar() {
return getDependencyPath("R8_V3_2_54", "r8.jar");
}
public static Path getR8V8_0_46LibJar() {
return getDependencyPath("R8_V8_0_46", "r8lib.jar");
}
public static Path getReadYouDir() {
return getDependency("READYOU");
}
public static Path getRetraceBenchmarkDir() {
return getDependency("RETRACE_BENCHMARK");
}
public static Path getRetraceBinaryCompatibilityJar() {
return getDependencyPath("RETRACE_BINARY_COMPATIBILITY", "tests.jar");
}
public static Path getRetraceInternalDir() {
return getDependency("RETRACE_INTERNAL");
}
public static Path getRetracePartitionFormatsDir() {
return getDependency("RETRACE_PARTITION_FORMATS");
}
public static Path getRhinoJar() {
return getDependencyPath("RHINO", "rhino-1.7.10.jar");
}
public static Path getRhinoAndroidJar() {
return getDependencyPath("RHINO_ANDROID", "rhino-android-1.1.1.jar");
}
public static Path getSmaliPath(String... path) {
return getDependencyPath("SMALI", path);
}
public static Path getSystemUIDir() {
return getDependency("SYSTEM_UI");
}
public static Path getTiviDir() {
return getDependency("TIVI");
}
public static Path getTiviDumpAppZip() {
return getDependencyPath("TIVI", "dump_app.zip");
}
public static Path getTuskyDir() {
return getDependency("TUSKY");
}
public static Path getYouTube2140Dir() {
return getDependency("YOUTUBE_21_40");
}
public static Path getYouTube2140D8MergeDir() {
return getDependency("YOUTUBE_21_40_D8_MERGE");
}
public static Path getJunitJar() {
return getDependencyPath("DEPENDENCIES", "junit", "junit", "4.13.2", "junit-4.13.2.jar");
}
public static Path getHamcrestJar() {
return getDependencyPath(
"DEPENDENCIES", "org", "hamcrest", "hamcrest-core", "1.3", "hamcrest-core-1.3.jar");
}
public static Path getTestNgJar() {
return getDependencyPath("DEPENDENCIES", "org", "testng", "testng", "6.10", "testng-6.10.jar");
}
public static Path getJCommanderJar() {
return getDependencyPath(
"DEPENDENCIES", "com", "beust", "jcommander", "1.48", "jcommander-1.48.jar");
}
public static Path getJdwpTestsDexJar() {
return getDependencyPath("JDWP_TESTS", "apache-harmony-jdwp-tests-hostdex.jar");
}
public static Path getJdwpTestsJar(AndroidApiLevel apiLevel) {
Path base = getDependency("JDWP_TESTS");
if (apiLevel.isLessThan(AndroidApiLevel.N)) {
return base.resolve("apache-harmony-jdwp-tests-host-preN.jar");
} else {
return base.resolve("apache-harmony-jdwp-tests-host.jar");
}
}
private static Path getDependencyPath(String dependency, String... path) {
return resolveMany(getDependency(dependency), path);
}
private static Path resolveMany(Path base, String... extensions) {
Path result = base;
for (String extension : extensions) {
result = result.resolve(extension);
}
return result;
}
}