Change bool, and string properties to *bool, and *string for java,
python, and genrule.
Test: m -j checkbuild
Bug: b/68853585
Change-Id: Ic9a8083818e920dc399a4b00841e2aa496f70faa
diff --git a/genrule/genrule.go b/genrule/genrule.go
index b26b1a2..7602ee7 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -20,12 +20,11 @@
"github.com/google/blueprint"
"github.com/google/blueprint/bootstrap"
+ "github.com/google/blueprint/proptools"
"android/soong/android"
"android/soong/shared"
"path/filepath"
-
- "github.com/google/blueprint/proptools"
)
func init() {
@@ -72,10 +71,10 @@
//
// All files used must be declared as inputs (to ensure proper up-to-date checks).
// Use "$(in)" directly in Cmd to ensure that all inputs used are declared.
- Cmd string
+ Cmd *string
// Enable reading a file containing dependencies in gcc format after the command completes
- Depfile bool
+ Depfile *bool
// name of the modules (if any) that produces the host executable. Leave empty for
// prebuilts or scripts that do not need a module to build them.
@@ -214,7 +213,7 @@
referencedDepfile := false
srcFiles := ctx.ExpandSources(g.properties.Srcs, nil)
- task := g.taskGenerator(ctx, g.properties.Cmd, srcFiles)
+ task := g.taskGenerator(ctx, String(g.properties.Cmd), srcFiles)
rawCommand, err := android.Expand(task.cmd, func(name string) (string, error) {
switch name {
@@ -230,7 +229,7 @@
return "__SBOX_OUT_FILES__", nil
case "depfile":
referencedDepfile = true
- if !g.properties.Depfile {
+ if !Bool(g.properties.Depfile) {
return "", fmt.Errorf("$(depfile) used without depfile property")
}
return "__SBOX_DEPFILE__", nil
@@ -249,7 +248,7 @@
}
})
- if g.properties.Depfile && !referencedDepfile {
+ if Bool(g.properties.Depfile) && !referencedDepfile {
ctx.PropertyErrorf("cmd", "specified depfile=true but did not include a reference to '${depfile}' in cmd")
}
@@ -265,7 +264,7 @@
// recall that Sprintf replaces percent sign expressions, whereas dollar signs expressions remain as written,
// to be replaced later by ninja_strings.go
depfilePlaceholder := ""
- if g.properties.Depfile {
+ if Bool(g.properties.Depfile) {
depfilePlaceholder = "$depfileArgs"
}
@@ -277,7 +276,7 @@
CommandDeps: []string{"$sboxCmd"},
}
args := []string{"allouts"}
- if g.properties.Depfile {
+ if Bool(g.properties.Depfile) {
ruleParams.Deps = blueprint.DepsGCC
args = append(args, "depfileArgs")
}
@@ -298,7 +297,7 @@
}
var depFile android.ModuleGenPath
- if g.properties.Depfile {
+ if Bool(g.properties.Depfile) {
depFile = android.PathForModuleGen(ctx, task.out[0].Rel()+".d")
}
@@ -313,7 +312,7 @@
"allouts": strings.Join(task.out.Strings(), " "),
},
}
- if g.properties.Depfile {
+ if Bool(g.properties.Depfile) {
params.Depfile = android.PathForModuleGen(ctx, task.out[0].Rel()+".d")
params.Args["depfileArgs"] = "--depfile-out " + depFile.String()
}
@@ -422,3 +421,6 @@
// names of the output files that will be generated
Out []string
}
+
+var Bool = proptools.Bool
+var String = proptools.String