Move dexpreopt.Script to android.RuleBuilder

Move dexpreopt.Script to android.RuleBuilder so that the builder
style can be used in more places.  Also add tests for it.

Test: rule_builder_test.go
Change-Id: I92a963bd112bf033b08899e930094b908acfcdfd
This commit is contained in:
Colin Cross
2019-01-30 17:32:39 -08:00
parent a55b12bec2
commit feec25b084
10 changed files with 413 additions and 251 deletions

View File

@@ -22,6 +22,7 @@ import (
"path/filepath"
"runtime"
"android/soong/android"
"android/soong/dexpreopt"
"github.com/google/blueprint/pathtools"
@@ -121,7 +122,7 @@ func writeScripts(global dexpreopt.GlobalConfig, module dexpreopt.ModuleConfig,
panic(err)
}
write := func(rule *dexpreopt.Rule, file string) {
write := func(rule *android.RuleBuilder, file string) {
script := &bytes.Buffer{}
script.WriteString(scriptHeader)
for _, c := range rule.Commands() {