diff --git a/keeper-gradle-plugin/src/main/java/com/slack/keeper/ZipFlingerExt.kt b/keeper-gradle-plugin/src/main/java/com/slack/keeper/ZipFlingerExt.kt index 1b1c4a2..672b4ce 100644 --- a/keeper-gradle-plugin/src/main/java/com/slack/keeper/ZipFlingerExt.kt +++ b/keeper-gradle-plugin/src/main/java/com/slack/keeper/ZipFlingerExt.kt @@ -30,7 +30,18 @@ internal fun File.classesSequence(): Sequence> { .filter { it.extension == "class" } .filterNot { "META-INF" in it.name } .sortedBy { it.invariantSeparatorsPath } - .map { it.absolutePath.removePrefix(prefix).removePrefix("/") to it } + .map { + // zip specification "4.4.17.1 file name: (Variable)" items: + it.absolutePath + // "The name of the file, with optional relative path. + // The path stored MUST NOT contain a drive or + // device letter, or a leading slash" + .removePrefix(prefix) + .removePrefix(File.separator) + // "All slashes MUST be forward slashes '/' as opposed + // to backwards slashes '\' for compatibility" + .replace(File.separator, "/") to it + } } /** Extracts classes from the target [jar] into this archive. */