Add skeleton for resource shrinker integration
This adds a new interface for tracing through the resource model.
In the old gradle setup this is implemented just as a no-op, with copy through.
For the new gradle setup this is implemnted with a single call to the resource shrinker to ensure access, and then just copy through.
Bug: b/287398085
Change-Id: I9e103f1149c9e209ab7dbad607a5047aac83cfbd
diff --git a/d8_r8/test_modules/tests_java_8/build.gradle.kts b/d8_r8/test_modules/tests_java_8/build.gradle.kts
index e8284c4..15a76f9 100644
--- a/d8_r8/test_modules/tests_java_8/build.gradle.kts
+++ b/d8_r8/test_modules/tests_java_8/build.gradle.kts
@@ -28,6 +28,7 @@
// incompatible java class file version. By depending on the jar we circumvent that.
implementation(projectTask("keepanno", "jar").outputs.files)
implementation(projectTask("main", "jar").outputs.files)
+ implementation(projectTask("resourceshrinker", "jar").outputs.files)
implementation(Deps.asm)
implementation(Deps.asmCommons)
implementation(Deps.asmUtil)
@@ -119,6 +120,7 @@
.get()
.compileClasspath
.filter({"$it".contains("keepanno") ||
+ "$it".contains("resoourceshrinker") ||
("$it".contains("third_party")
&& !"$it".contains("errorprone")
&& !"$it".contains("gradle"))})
@@ -130,6 +132,7 @@
}
withType<JavaCompile> {
dependsOn(gradle.includedBuild("keepanno").task(":jar"))
+ dependsOn(gradle.includedBuild("resourceshrinker").task(":jar"))
dependsOn(gradle.includedBuild("main").task(":jar"))
dependsOn(thirdPartyCompileDependenciesTask)
options.setFork(true)
diff --git a/d8_r8/test_modules/tests_java_8/settings.gradle.kts b/d8_r8/test_modules/tests_java_8/settings.gradle.kts
index 4935653..00c70f1 100644
--- a/d8_r8/test_modules/tests_java_8/settings.gradle.kts
+++ b/d8_r8/test_modules/tests_java_8/settings.gradle.kts
@@ -6,6 +6,7 @@
val root = rootProject.projectDir.parentFile.parentFile
includeBuild(root.resolve("keepanno"))
+includeBuild(root.resolve("resourceshrinker"))
// We need to include src/main as a composite-build otherwise our test-modules
// will compete with the test to compile the source files.