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

Commit a0436a39 authored by Jooyung Han's avatar Jooyung Han
Browse files

make linker_config OutputFileProducer

so that they can be used in `srcs` of genrule.

Bug: 181093750
Test: m
Change-Id: Ia54554f1e81d766a970c9c4e02906ef9c0d85934
parent c6a91ec6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package linkerconfig
import (
	"android/soong/android"
	"android/soong/etc"
	"fmt"

	"github.com/google/blueprint/proptools"
)
@@ -68,6 +69,17 @@ func (l *linkerConfig) OutputFile() android.OutputPath {
	return l.outputFilePath
}

var _ android.OutputFileProducer = (*linkerConfig)(nil)

func (l *linkerConfig) OutputFiles(tag string) (android.Paths, error) {
	switch tag {
	case "":
		return android.Paths{l.outputFilePath}, nil
	default:
		return nil, fmt.Errorf("unsupported module reference tag %q", tag)
	}
}

func (l *linkerConfig) GenerateAndroidBuildActions(ctx android.ModuleContext) {
	inputFile := android.PathForModuleSrc(ctx, android.String(l.properties.Src))
	l.outputFilePath = android.PathForModuleOut(ctx, "linker.config.pb").OutputPath