Skip to content

Commit

Permalink
Place synthetic-contexts.map under META-INF/metadata/
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 683244809
Change-Id: I69a3ca5451fe5bd2b60b272de0cf47b8050193a1
  • Loading branch information
timpeut authored and copybara-github committed Oct 7, 2024
1 parent e90b26d commit 07115c7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static void splitIntoShards(Options options) throws IOException {
ZipFile zip = closer.register(new ZipFile(inputArchive.toFile()));

// synthetic-contexts.map is generated by CompatDexBuilder.
ZipEntry syntheticContextsZipEntry = zip.getEntry("META-INF/synthetic-contexts.map");
ZipEntry syntheticContextsZipEntry = zip.getEntry("META-INF/metadata/synthetic-contexts.map");
if (syntheticContextsZipEntry != null) {
parseSyntheticContextsMap(
zip.getInputStream(syntheticContextsZipEntry), contextClassesToSyntheticClasses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private void dexEntries(
String contextMapping = contextMappingBuilder.toString();
if (!contextMapping.isEmpty()) {
ZipUtils.addEntry(
"META-INF/synthetic-contexts.map",
"META-INF/metadata/synthetic-contexts.map",
contextMapping.getBytes(UTF_8),
ZipEntry.STORED,
out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ private void split() throws IOException {
CentralDirectory cdir = centralDirectories.get(in.getFilename());

for (DirectoryEntry entry : cdir.list()) {
if (entry.getFilename().equals("META-INF/synthetic-contexts.map")) {
if (entry.getFilename().equals("META-INF/metadata/synthetic-contexts.map")) {
parseSyntheticContextsMap(in.entryFor(entry).getContent(), syntheticClassContexts);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void compileWithSyntheticLambdas() throws Exception {

try (ZipFile zipFile = new ZipFile(outputZip.toFile(), UTF_8)) {
assertThat(zipFile.getEntry(contextName + ".class.dex")).isNotNull();
ZipEntry entry = zipFile.getEntry("META-INF/synthetic-contexts.map");
ZipEntry entry = zipFile.getEntry("META-INF/metadata/synthetic-contexts.map");
assertThat(entry).isNotNull();
try (BufferedReader reader =
new BufferedReader(new InputStreamReader(zipFile.getInputStream(entry), UTF_8))) {
Expand Down

0 comments on commit 07115c7

Please sign in to comment.