aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/xcode-common
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2015-04-02 15:06:46 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-04-03 20:36:27 +0000
commit61a8f1d87b4439599c89e5dcdd83b4efcc6a8b97 (patch)
tree6d4d44acda4df05bdd3678ec3de654194ecb0b21 /src/tools/xcode-common
parentd10e352331b4ca95e5fb86856b60deae9af29b3d (diff)
Description redacted.
-- MOS_MIGRATED_REVID=90162183
Diffstat (limited to 'src/tools/xcode-common')
-rw-r--r--src/tools/xcode-common/java/com/google/devtools/build/xcode/zip/ZipInputEntry.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/tools/xcode-common/java/com/google/devtools/build/xcode/zip/ZipInputEntry.java b/src/tools/xcode-common/java/com/google/devtools/build/xcode/zip/ZipInputEntry.java
index 01aaad0373..6bd6fdb893 100644
--- a/src/tools/xcode-common/java/com/google/devtools/build/xcode/zip/ZipInputEntry.java
+++ b/src/tools/xcode-common/java/com/google/devtools/build/xcode/zip/ZipInputEntry.java
@@ -17,6 +17,7 @@ package com.google.devtools.build.xcode.zip;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.singlejar.ZipCombiner;
import com.google.devtools.build.xcode.util.Value;
+import com.google.devtools.build.zip.ZipFileEntry;
import java.io.IOException;
import java.io.InputStream;
@@ -43,17 +44,12 @@ public class ZipInputEntry extends Value<ZipInputEntry> {
public static final int EXECUTABLE_EXTERNAL_FILE_ATTRIBUTE = (0100755 << 16);
/**
- * The central directory record information that is used when adding a plain, non-executable file.
+ * Made by version of .ipa files built by Xcode. Upper byte indicates Unix host. Lower byte
+ * indicates version of encoding software (note that 0x1e = 30 = (3.0 * 10), so 0x1e translates
+ * to 3.0). The Unix host value in the upper byte is what causes the external file attribute to
+ * be interpreted as POSIX permission and file type bits.
*/
- public static final ZipCombiner.DirectoryEntryInfo DEFAULT_DIRECTORY_ENTRY_INFO =
- ZipCombiner.DEFAULT_DIRECTORY_ENTRY_INFO
- // This is what .ipa files built by Xcode are set to. Upper byte indicates Unix host.
- // Lower byte indicates version of encoding software
- // (note that 0x1e = 30 = (3.0 * 10), so 0x1e translates to 3.0).
- // The Unix host value in the upper byte is what causes the external file attribute to be
- // interpreted as POSIX permission and file type bits.
- .withMadeByVersion((short) 0x031e)
- .withExternalFileAttribute(DEFAULT_EXTERNAL_FILE_ATTRIBUTE);
+ public static final short MADE_BY_VERSION = (short) 0x031e;
private final Path source;
private final String zipPath;
@@ -98,8 +94,11 @@ public class ZipInputEntry extends Value<ZipInputEntry> {
*/
public void add(ZipCombiner combiner) throws IOException {
try (InputStream inputStream = Files.newInputStream(source)) {
- combiner.addFile(zipPath, ZipCombiner.DOS_EPOCH, inputStream,
- DEFAULT_DIRECTORY_ENTRY_INFO.withExternalFileAttribute(externalFileAttribute));
+ ZipFileEntry entry = new ZipFileEntry(zipPath);
+ entry.setTime(ZipCombiner.DOS_EPOCH.getTime());
+ entry.setVersion(MADE_BY_VERSION);
+ entry.setExternalAttributes(externalFileAttribute);
+ combiner.addFile(entry, inputStream);
}
}