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:
@@ -29,6 +29,7 @@ blueprint_go_binary {
|
|||||||
deps: [
|
deps: [
|
||||||
"androidmk-parser",
|
"androidmk-parser",
|
||||||
"blueprint-parser",
|
"blueprint-parser",
|
||||||
|
"bpfix-lib",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,6 +8,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"text/scanner"
|
"text/scanner"
|
||||||
|
|
||||||
|
"android/soong/bpfix/bpfix"
|
||||||
|
|
||||||
mkparser "android/soong/androidmk/parser"
|
mkparser "android/soong/androidmk/parser"
|
||||||
|
|
||||||
bpparser "github.com/google/blueprint/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,
|
Defs: file.defs,
|
||||||
Comments: file.comments,
|
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 {
|
if err != nil {
|
||||||
return "", []error{err}
|
return "", []error{err}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user