-l option soong_zip can accept a file having space separated list
-l option of soong_zip is used to specify the list of input files that should be zipped. However, it only accepted newline-separated list in the file. This prevented us from using a rspfile as paths in rspfile are space-separated in a single line. Fixing the problem by splitting the file content by any unicode whitespace character including newline and space. Test: zip_test Change-Id: Iba572109e30c01540eacf20bd2794ba60c870fa3
This commit is contained in:
@@ -145,7 +145,7 @@ func (b *FileArgsBuilder) List(name string) *FileArgsBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
arg := b.state
|
arg := b.state
|
||||||
arg.SourceFiles = strings.Split(string(list), "\n")
|
arg.SourceFiles = strings.Fields(string(list))
|
||||||
b.fileArgs = append(b.fileArgs, arg)
|
b.fileArgs = append(b.fileArgs, arg)
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,8 @@ var mockFs = pathtools.MockFs(map[string][]byte{
|
|||||||
"dangling -> missing": nil,
|
"dangling -> missing": nil,
|
||||||
"a/a/d -> b": nil,
|
"a/a/d -> b": nil,
|
||||||
"c": fileC,
|
"c": fileC,
|
||||||
"l": []byte("a/a/a\na/a/b\nc\n"),
|
"l_nl": []byte("a/a/a\na/a/b\nc\n"),
|
||||||
|
"l_sp": []byte("a/a/a a/a/b c"),
|
||||||
"l2": []byte("missing\n"),
|
"l2": []byte("missing\n"),
|
||||||
"manifest.txt": fileCustomManifest,
|
"manifest.txt": fileCustomManifest,
|
||||||
})
|
})
|
||||||
@@ -224,7 +225,19 @@ func TestZip(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "list",
|
name: "list",
|
||||||
args: fileArgsBuilder().
|
args: fileArgsBuilder().
|
||||||
List("l"),
|
List("l_nl"),
|
||||||
|
compressionLevel: 9,
|
||||||
|
|
||||||
|
files: []zip.FileHeader{
|
||||||
|
fh("a/a/a", fileA, zip.Deflate),
|
||||||
|
fh("a/a/b", fileB, zip.Deflate),
|
||||||
|
fh("c", fileC, zip.Deflate),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "list",
|
||||||
|
args: fileArgsBuilder().
|
||||||
|
List("l_sp"),
|
||||||
compressionLevel: 9,
|
compressionLevel: 9,
|
||||||
|
|
||||||
files: []zip.FileHeader{
|
files: []zip.FileHeader{
|
||||||
|
Reference in New Issue
Block a user