diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-02-04 02:07:31 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-02-04 02:07:31 +0000 |
commit | 30977d507dd15b7df366b467f4012a3c75a25775 (patch) | |
tree | 0ff3043948e709a20f30e856413bb0a1aab72d7d /cc/builder.go | |
parent | 93567935fd147a7a0086fd94594ccf113953bfd8 (diff) | |
parent | 8d8639d5f506d2058949a517c170d277203da566 (diff) | |
download | android_build_soong-30977d507dd15b7df366b467f4012a3c75a25775.tar.gz android_build_soong-30977d507dd15b7df366b467f4012a3c75a25775.tar.bz2 android_build_soong-30977d507dd15b7df366b467f4012a3c75a25775.zip |
Snap for 6179254 from 8d8639d5f506d2058949a517c170d277203da566 to qt-qpr3-release
Change-Id: Id9cdbaf3ab69ff34fa860bb9e6ae660571a27820
Diffstat (limited to 'cc/builder.go')
-rw-r--r-- | cc/builder.go | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/cc/builder.go b/cc/builder.go index fc5400c7..a9ee4e92 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -227,6 +227,14 @@ var ( blueprint.RuleParams{ Command: "gunzip -c $in > $out", }) + + zip = pctx.AndroidStaticRule("zip", + blueprint.RuleParams{ + Command: "cat $out.rsp | tr ' ' '\\n' | tr -d \\' | sort -u > ${out}.tmp && ${SoongZipCmd} -o ${out} -C $$OUT_DIR -l ${out}.tmp", + CommandDeps: []string{"${SoongZipCmd}"}, + Rspfile: "$out.rsp", + RspfileContent: "$in", + }) ) func init() { @@ -239,6 +247,8 @@ func init() { // Darwin doesn't have /proc pctx.StaticVariable("relPwd", "") } + + pctx.HostBinToolVariable("SoongZipCmd", "soong_zip") } type builderFlags struct { @@ -867,13 +877,18 @@ func TransformDarwinStrip(ctx android.ModuleContext, inputFile android.Path, }) } -func TransformCoverageFilesToLib(ctx android.ModuleContext, - inputs Objects, flags builderFlags, baseName string) android.OptionalPath { +func TransformCoverageFilesToZip(ctx android.ModuleContext, + inputs Objects, baseName string) android.OptionalPath { if len(inputs.coverageFiles) > 0 { - outputFile := android.PathForModuleOut(ctx, baseName+".gcnodir") + outputFile := android.PathForModuleOut(ctx, baseName+".zip") - TransformObjToStaticLib(ctx, inputs.coverageFiles, flags, outputFile, nil) + ctx.Build(pctx, android.BuildParams{ + Rule: zip, + Description: "zip " + outputFile.Base(), + Inputs: inputs.coverageFiles, + Output: outputFile, + }) return android.OptionalPathForPath(outputFile) } |