Add DistPath to reference the dist folder

Instead of open-coding the logic of whether there is one, or where to
find it.

Test: diff out/soong/build.ninja without dist
Test: diff out/soong/build.ninja with dist specified
Change-Id: Ia3f1ef335e2d6e2175343338d04867d778a50300
This commit is contained in:
Dan Willemsen
2018-03-10 16:25:53 -08:00
parent 54daaf0371
commit bc0c509267
2 changed files with 43 additions and 4 deletions

View File

@@ -200,10 +200,9 @@ var (
func(ctx android.PackageRuleContext) blueprint.RuleParams {
commandStr := "($sAbiDiffer $allowFlags -lib $libName -arch $arch -check-all-apis -o ${out} -new $in -old $referenceDump)"
distDir := ctx.Config().ProductVariables.DistDir
if distDir != nil && *distDir != "" {
distAbiDiffDir := *distDir + "/abidiffs/"
commandStr += " || (mkdir -p " + distAbiDiffDir + " && cp ${out} " + distAbiDiffDir + " && exit 1)"
distAbiDiffDir := android.PathForDist(ctx, "abidiffs")
if distAbiDiffDir.Valid() {
commandStr += " || (mkdir -p " + distAbiDiffDir.String() + " && cp ${out} " + distAbiDiffDir.String() + " && exit 1)"
}
return blueprint.RuleParams{
Command: commandStr,