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

Commit 4873775c authored by Zi Wang's avatar Zi Wang Committed by Automerger Merge Worker
Browse files

Merge "Use OutputFilesProvider on syspropJavaGenRule" into main am: d156fee2

parents aac618bb d156fee2
Loading
Loading
Loading
Loading
+4 −13
Original line number Diff line number Diff line
@@ -49,8 +49,6 @@ type syspropJavaGenRule struct {
	android.ModuleBase

	properties syspropGenProperties

	genSrcjars android.Paths
}

type syspropRustGenRule struct {
@@ -59,7 +57,6 @@ type syspropRustGenRule struct {
	properties rustLibraryProperties
}

var _ android.OutputFileProducer = (*syspropJavaGenRule)(nil)
var _ rust.SourceProvider = (*syspropRustGenRule)(nil)

var (
@@ -100,6 +97,7 @@ func (g *syspropJavaGenRule) GenerateAndroidBuildActions(ctx android.ModuleConte
		}
	})

	var genSrcjars android.Paths
	for _, syspropFile := range android.PathsForModuleSrc(ctx, g.properties.Srcs) {
		srcJarFile := android.GenPathWithExt(ctx, "sysprop", syspropFile, "srcjar")

@@ -114,8 +112,10 @@ func (g *syspropJavaGenRule) GenerateAndroidBuildActions(ctx android.ModuleConte
			},
		})

		g.genSrcjars = append(g.genSrcjars, srcJarFile)
		genSrcjars = append(genSrcjars, srcJarFile)
	}

	ctx.SetOutputFiles(genSrcjars, "")
}

func (g *syspropJavaGenRule) DepsMutator(ctx android.BottomUpMutatorContext) {
@@ -124,15 +124,6 @@ func (g *syspropJavaGenRule) DepsMutator(ctx android.BottomUpMutatorContext) {
	ctx.AddFarVariationDependencies(nil, nil, proptools.String(g.properties.Check_api))
}

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

func syspropJavaGenFactory() android.Module {
	g := &syspropJavaGenRule{}
	g.AddProperties(&g.properties)