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/filegroup.go b/genrule/filegroup.go
index ed206b0..8f28638 100644
--- a/genrule/filegroup.go
+++ b/genrule/filegroup.go
@@ -35,11 +35,11 @@
 	// of the path to use.  For example, when a filegroup is used as data in a cc_test rule,
 	// the base path is stripped off the path and the remaining path is used as the
 	// installation directory.
-	Path string
+	Path *string
 
 	// Create a make variable with the specified name that contains the list of files in the
 	// filegroup, relative to the root of the source tree.
-	Export_to_make_var string
+	Export_to_make_var *string
 }
 
 type fileGroup struct {
@@ -65,7 +65,7 @@
 }
 
 func (fg *fileGroup) GenerateAndroidBuildActions(ctx android.ModuleContext) {
-	fg.srcs = ctx.ExpandSourcesSubDir(fg.properties.Srcs, fg.properties.Exclude_srcs, fg.properties.Path)
+	fg.srcs = ctx.ExpandSourcesSubDir(fg.properties.Srcs, fg.properties.Exclude_srcs, String(fg.properties.Path))
 }
 
 func (fg *fileGroup) Srcs() android.Paths {
@@ -83,7 +83,7 @@
 func (fg *fileGroup) AndroidMk() android.AndroidMkData {
 	return android.AndroidMkData{
 		Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
-			if makeVar := fg.properties.Export_to_make_var; makeVar != "" {
+			if makeVar := String(fg.properties.Export_to_make_var); makeVar != "" {
 				androidMkTemplate.Execute(w, map[string]string{
 					"makeVar": makeVar,
 					"value":   strings.Join(fg.srcs.Strings(), " "),
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