aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorLiz Kammer <eakammer@google.com>2021-12-21 15:36:11 -0500
committerLiz Kammer <eakammer@google.com>2021-12-21 16:01:53 -0500
commit48c6ead90d25369300a12f2022d66fa52bfead6e (patch)
tree23478b342e16516f5881eb931c437868c645a9f4 /sh
parent68542bfcb5674a0e2661407c03563f6a90a9243c (diff)
downloadsoong-48c6ead90d25369300a12f2022d66fa52bfead6e.tar.gz
sh_binary: Use pointers for optional attributes
Empty strings for filename and sub_dir were unnecessicarily always being propagated to BUILD files. Test: build/bazel/ci/bp2build.sh Change-Id: I39d6af12b1decd1d3813b92daa862ebc025daa7d
Diffstat (limited to 'sh')
-rw-r--r--sh/sh_binary.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/sh/sh_binary.go b/sh/sh_binary.go
index e1df8ac59..b1d1bb21e 100644
--- a/sh/sh_binary.go
+++ b/sh/sh_binary.go
@@ -511,8 +511,8 @@ func ShTestHostFactory() android.Module {
type bazelShBinaryAttributes struct {
Srcs bazel.LabelListAttribute
- Filename string
- Sub_dir string
+ Filename *string
+ Sub_dir *string
// Bazel also supports the attributes below, but (so far) these are not required for Bionic
// deps
// data
@@ -538,14 +538,14 @@ func (m *ShBinary) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
srcs := bazel.MakeLabelListAttribute(
android.BazelLabelForModuleSrc(ctx, []string{*m.properties.Src}))
- var filename string
+ var filename *string
if m.properties.Filename != nil {
- filename = *m.properties.Filename
+ filename = m.properties.Filename
}
- var subDir string
+ var subDir *string
if m.properties.Sub_dir != nil {
- subDir = *m.properties.Sub_dir
+ subDir = m.properties.Sub_dir
}
attrs := &bazelShBinaryAttributes{