diff options
author | Jeff Gaston <jeffrygaston@google.com> | 2017-06-19 15:40:12 -0700 |
---|---|---|
committer | Jeff Gaston <jeffrygaston@google.com> | 2017-06-19 15:52:25 -0700 |
commit | c381fd0282ffd9afe0ddd972c194b984c32108dc (patch) | |
tree | 0e44fe46ef5173cb0a6e84034e43f349f7fd64d8 /androidmk | |
parent | aff66e55a9c114a2b6cc8b1116484db0b887e642 (diff) | |
download | build_soong-c381fd0282ffd9afe0ddd972c194b984c32108dc.tar.gz build_soong-c381fd0282ffd9afe0ddd972c194b984c32108dc.tar.bz2 build_soong-c381fd0282ffd9afe0ddd972c194b984c32108dc.zip |
Revert "Revert "Run bpfix at the end of androidmk""
Bug: 38351765
Test: androidmk Android.mk > Android.bp
This reverts commit eb3186abbe1c353c77d38be1f16720940f6925d5.
Change-Id: I0b67e89f5096aae60c97eb6af4fd205509aac5c9
Diffstat (limited to 'androidmk')
-rw-r--r-- | androidmk/Android.bp | 1 | ||||
-rw-r--r-- | androidmk/cmd/androidmk/androidmk.go | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/androidmk/Android.bp b/androidmk/Android.bp index 67baf0ae..442452f8 100644 --- a/androidmk/Android.bp +++ b/androidmk/Android.bp @@ -29,6 +29,7 @@ blueprint_go_binary { deps: [ "androidmk-parser", "blueprint-parser", + "bpfix-lib", ], } diff --git a/androidmk/cmd/androidmk/androidmk.go b/androidmk/cmd/androidmk/androidmk.go index 1d94b65e..d26643ae 100644 --- a/androidmk/cmd/androidmk/androidmk.go +++ b/androidmk/cmd/androidmk/androidmk.go @@ -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} } |