Revert "Revert "Run bpfix at the end of androidmk""
Bug: 38351765
Test: androidmk Android.mk > Android.bp
This reverts commit eb3186abbe
.
Change-Id: I0b67e89f5096aae60c97eb6af4fd205509aac5c9
This commit is contained in:
parent
aff66e55a9
commit
c381fd0282
2 changed files with 13 additions and 2 deletions
|
@ -29,6 +29,7 @@ blueprint_go_binary {
|
|||
deps: [
|
||||
"androidmk-parser",
|
||||
"blueprint-parser",
|
||||
"bpfix-lib",
|
||||
],
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"strings"
|
||||
"text/scanner"
|
||||
|
||||
"android/soong/bpfix/bpfix"
|
||||
|
||||
mkparser "android/soong/androidmk/parser"
|
||||
|
||||
bpparser "github.com/google/blueprint/parser"
|
||||
|
@ -176,10 +178,18 @@ func convertFile(filename string, buffer *bytes.Buffer) (string, []error) {
|
|||
}
|
||||
}
|
||||
|
||||
out, err := bpparser.Print(&bpparser.File{
|
||||
tree := &bpparser.File{
|
||||
Defs: file.defs,
|
||||
Comments: file.comments,
|
||||
})
|
||||
}
|
||||
|
||||
// check for common supported but undesirable structures and clean them up
|
||||
fixed, err := bpfix.FixTree(tree, bpfix.NewFixRequest().AddAll())
|
||||
if err != nil {
|
||||
return "", []error{err}
|
||||
}
|
||||
|
||||
out, err := bpparser.Print(fixed)
|
||||
if err != nil {
|
||||
return "", []error{err}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue