Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36a49910 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Enable Soong's tradefed_binary to support multi-arch" into main am: 453afad7

parents 2553359f 453afad7
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ type TradefedBinaryProperties struct {
	Short_name                    string
	Full_name                     string
	Version                       string
	Suite_arch                    string
	Prepend_platform_version_name bool
}

@@ -67,6 +68,7 @@ func tradefedBinaryLoadHook(tfb *TradefedBinaryProperties) func(ctx android.Load
				Name:       &genName,
				Short_name: tfb.Short_name,
				Full_name:  tfb.Full_name,
				Suite_arch: tfb.Suite_arch,
				Version:    version,
			})

@@ -95,6 +97,7 @@ type TradefedBinaryGenProperties struct {
	Short_name string
	Full_name  string
	Version    string
	Suite_arch string
}

type tradefedBinaryGen struct {
@@ -127,13 +130,19 @@ var tradefedBinaryGenRule = pctx.StaticRule("tradefedBinaryGenRule", blueprint.R
func (tfg *tradefedBinaryGen) GenerateAndroidBuildActions(ctx android.ModuleContext) {
	buildNumberFile := ctx.Config().BuildNumberFile(ctx)
	outputFile := android.PathForModuleOut(ctx, "test-suite-info.properties")

	arch := strings.ReplaceAll(tfg.properties.Suite_arch, " ", "")
	if arch == "" {
		arch = ctx.Config().DevicePrimaryArchType().String()
	}

	ctx.Build(pctx, android.BuildParams{
		Rule:      tradefedBinaryGenRule,
		Output:    outputFile,
		OrderOnly: android.Paths{buildNumberFile},
		Args: map[string]string{
			"buildNumberFile": buildNumberFile.String(),
			"arch":            ctx.Config().DevicePrimaryArchType().String(),
			"arch":            arch,
			"name":            tfg.properties.Short_name,
			"fullname":        tfg.properties.Full_name,
			"version":         tfg.properties.Version,