aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorLiz Kammer <eakammer@google.com>2021-01-26 09:18:53 -0500
committerLiz Kammer <eakammer@google.com>2021-02-04 13:45:56 -0500
commit356f7d45c19ff8b862ff4d5db7384e87c2b052f9 (patch)
tree57db9c0e7b1d346c85a40ffd72602dce13c12df9 /sh
parentaef038aac1f18259a941b05b028e5e9beb5b3bd7 (diff)
downloadsoong-356f7d45c19ff8b862ff4d5db7384e87c2b052f9.tar.gz
bp2build: convert paths/module refs to Bazel label
This currently expands all globs, still need to support converting glob syntax. Test: go build_conversion_test Test: GENERATE_BAZEL_FILES=true m nothing Test: m nothing Bug: 165114590 Change-Id: If7b26e8e663d17566fad9614ca87a8da1f095284
Diffstat (limited to 'sh')
-rw-r--r--sh/sh_binary.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/sh/sh_binary.go b/sh/sh_binary.go
index 18749b533..66e493bf1 100644
--- a/sh/sh_binary.go
+++ b/sh/sh_binary.go
@@ -154,9 +154,6 @@ func (s *ShBinary) HostToolPath() android.OptionalPath {
}
func (s *ShBinary) DepsMutator(ctx android.BottomUpMutatorContext) {
- if s.properties.Src == nil {
- ctx.PropertyErrorf("src", "missing prebuilt source file")
- }
}
func (s *ShBinary) OutputFile() android.OutputPath {
@@ -203,6 +200,10 @@ func (s *ShBinary) SetImageVariation(ctx android.BaseModuleContext, variation st
}
func (s *ShBinary) generateAndroidBuildActions(ctx android.ModuleContext) {
+ if s.properties.Src == nil {
+ ctx.PropertyErrorf("src", "missing prebuilt source file")
+ }
+
s.sourceFilePath = android.PathForModuleSrc(ctx, proptools.String(s.properties.Src))
filename := proptools.String(s.properties.Filename)
filenameFromSrc := proptools.Bool(s.properties.Filename_from_src)
@@ -275,7 +276,7 @@ func (s *ShTest) DepsMutator(ctx android.BottomUpMutatorContext) {
ctx.AddFarVariationDependencies(ctx.Target().Variations(), shTestDataBinsTag, s.testProperties.Data_bins...)
ctx.AddFarVariationDependencies(append(ctx.Target().Variations(), sharedLibVariations...),
shTestDataLibsTag, s.testProperties.Data_libs...)
- if ctx.Target().Os.Class == android.Host && len(ctx.Config().Targets[android.Android]) > 0 {
+ if (ctx.Target().Os.Class == android.Host || ctx.BazelConversionMode()) && len(ctx.Config().Targets[android.Android]) > 0 {
deviceVariations := ctx.Config().AndroidFirstDeviceTarget.Variations()
ctx.AddFarVariationDependencies(deviceVariations, shTestDataDeviceBinsTag, s.testProperties.Data_device_bins...)
ctx.AddFarVariationDependencies(append(deviceVariations, sharedLibVariations...),