Merge "Copy abidiffs into /abidiffs on abi breakages." am: 3e6584556d

am: eb11ca9596

Change-Id: If63adfeb06b0c60a79ae6ce04d89cac7a6349aff
This commit is contained in:
Jayant Chowdhary 2017-11-28 22:53:32 +00:00 committed by android-build-merger
commit c86d1850c7
2 changed files with 14 additions and 5 deletions

View file

@ -189,6 +189,7 @@ type productVariables struct {
Override_rs_driver *string `json:",omitempty"`
DeviceKernelHeaders []string `json:",omitempty"`
DistDir *string `json:",omitempty"`
}
func boolPtr(v bool) *bool {

View file

@ -196,11 +196,19 @@ var (
_ = pctx.SourcePathVariable("sAbiDiffer", "prebuilts/build-tools/${config.HostPrebuiltTag}/bin/header-abi-diff")
// Abidiff check turned on in advice-only mode. Builds will not fail on abi incompatibilties / extensions.
sAbiDiff = pctx.AndroidStaticRule("sAbiDiff",
blueprint.RuleParams{
Command: "$sAbiDiffer $allowFlags -lib $libName -arch $arch -check-all-apis -o ${out} -new $in -old $referenceDump",
CommandDeps: []string{"$sAbiDiffer"},
sAbiDiff = pctx.AndroidRuleFunc("sAbiDiff",
func(config android.Config) (blueprint.RuleParams, error) {
commandStr := "($sAbiDiffer $allowFlags -lib $libName -arch $arch -check-all-apis -o ${out} -new $in -old $referenceDump)"
distDir := config.ProductVariables.DistDir
if distDir != nil && *distDir != "" {
distAbiDiffDir := *distDir + "/abidiffs/"
commandStr += " || (mkdir -p " + distAbiDiffDir + " && cp ${out} " + distAbiDiffDir + " && exit 1)"
}
return blueprint.RuleParams{
Command: commandStr,
CommandDeps: []string{"$sAbiDiffer"},
}, nil
},
"allowFlags", "referenceDump", "libName", "arch")