Add symlinks to sh_binary in soong

This allows us to change `logpersist.start` to `sh_binary` and unblocks
breakpad symbol uploading

Test: convert logpersist.start to sh_binary and verify symlinks are correct
Change-Id: I1b86c512df73a336205ca35216445a08e43bb879
This commit is contained in:
Rashed Abdel-Tawab
2019-10-04 20:38:01 -07:00
parent 5ffade1efb
commit 6a34131da4
2 changed files with 11 additions and 1 deletions

View File

@@ -48,6 +48,9 @@ type shBinaryProperties struct {
// Whether this module is directly installable to one of the partitions. Default: true.
Installable *bool
// install symlinks to the binary
Symlinks []string `android:"arch_variant"`
}
type TestProperties struct {
@@ -103,6 +106,10 @@ func (s *ShBinary) Installable() bool {
return s.properties.Installable == nil || Bool(s.properties.Installable)
}
func (s *ShBinary) Symlinks() []string {
return s.properties.Symlinks
}
func (s *ShBinary) GenerateAndroidBuildActions(ctx ModuleContext) {
s.sourceFilePath = PathForModuleSrc(ctx, String(s.properties.Src))
filename := String(s.properties.Filename)
@@ -145,6 +152,9 @@ func (s *ShBinary) customAndroidMkEntries(entries *AndroidMkEntries) {
entries.SetString("LOCAL_MODULE_RELATIVE_PATH", String(s.properties.Sub_dir))
entries.SetString("LOCAL_MODULE_SUFFIX", "")
entries.SetString("LOCAL_MODULE_STEM", s.outputFilePath.Rel())
if len(s.properties.Symlinks) > 0 {
entries.SetString("LOCAL_MODULE_SYMLINKS", strings.Join(s.properties.Symlinks, " "))
}
}
func (s *ShTest) GenerateAndroidBuildActions(ctx ModuleContext) {