Support long commands in RuleBuilder
If a command exceeds the linux max command line length, it will be put
into a script instead.
Fixes: 380945706
Test: Presubmits
Change-Id: I9bc4b293d6d638b38e7fb11e6c2bc35196306d9f
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index 746e4de..72a5211 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -16,6 +16,7 @@
import (
"os"
+ "strings"
"testing"
"android/soong/android"
@@ -182,10 +183,14 @@
module := result.ModuleForTests("myfilesystem", "android_common")
output := module.Output("out/soong/.intermediates/myfilesystem/android_common/root/system/etc/linker.config.pb")
+ fullCommand := output.RuleParams.Command
+ startIndex := strings.Index(fullCommand, "conv_linker_config")
+ linkerConfigCommand := fullCommand[startIndex:]
+
android.AssertStringDoesContain(t, "linker.config.pb should have libfoo",
- output.RuleParams.Command, "libfoo.so")
+ linkerConfigCommand, "libfoo.so")
android.AssertStringDoesNotContain(t, "linker.config.pb should not have libbar",
- output.RuleParams.Command, "libbar.so")
+ linkerConfigCommand, "libbar.so")
}
func registerComponent(ctx android.RegistrationContext) {