Allow some duplicates in merged jars

Only take the first MANIFEST.MF or module-info.class file.

Test: m -j checkbuild
Change-Id: Ifbf9fe272437ef2c2bd51ab4849ac8d7ef37b6fc
This commit is contained in:
Colin Cross
2017-09-06 12:52:37 -07:00
parent 32f676a7b4
commit 34540315a0
3 changed files with 30 additions and 18 deletions

View File

@@ -19,6 +19,12 @@ import (
"strings"
)
const (
MetaDir = "META-INF/"
ManifestFile = MetaDir + "MANIFEST.MF"
ModuleInfoClass = "module-info.class"
)
// EntryNamesLess tells whether <filepathA> should precede <filepathB> in
// the order of files with a .jar
func EntryNamesLess(filepathA string, filepathB string) (less bool) {
@@ -39,9 +45,9 @@ func patternMatch(pattern, name string) bool {
}
var jarOrder = []string{
"META-INF/",
"META-INF/MANIFEST.MF",
"META-INF/*",
MetaDir,
ManifestFile,
MetaDir + "*",
"*",
}