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

Commit 2a506cff authored by mrziwang's avatar mrziwang
Browse files

Use packagingPropsStruct for image bp generation

Test: CI
Bug: 368365286
Change-Id: I4d536c93d8cd7bb4f34ed66e0ad2152c63e5db99
parent 4b0ca97d
Loading
Loading
Loading
Loading
+38 −35
Original line number Diff line number Diff line
@@ -226,8 +226,16 @@ func setDepsMutator(mctx android.BottomUpMutatorContext) {
	soongGeneratedPartitionMap := getAllSoongGeneratedPartitionNames(mctx.Config(), fsGenState.soongGeneratedPartitions)
	m := mctx.Module()
	if partition, ok := soongGeneratedPartitionMap[m.Name()]; ok {
		depsStruct := generateDepStruct(*fsDeps[partition])
		if err := proptools.AppendMatchingProperties(m.GetProperties(), depsStruct, nil); err != nil {
			mctx.ModuleErrorf(err.Error())
		}
	}
}

func generateDepStruct(deps map[string]*depCandidateProps) *packagingPropsStruct {
	depsStruct := packagingPropsStruct{}
		for depName, depProps := range *fsDeps[partition] {
	for depName, depProps := range deps {
		bitness := getBitness(depProps.Arch)
		fullyQualifiedDepName := fullyQualifiedModuleName(depName, depProps.Namespace)
		if android.InList("32", bitness) && android.InList("64", bitness) {
@@ -257,10 +265,7 @@ func setDepsMutator(mctx android.BottomUpMutatorContext) {
			depsStruct.Multilib.Common.Deps = append(depsStruct.Multilib.Common.Deps, fullyQualifiedDepName)
		}
	}
		if err := proptools.AppendMatchingProperties(m.GetProperties(), &depsStruct, nil); err != nil {
			mctx.ModuleErrorf(err.Error())
		}
	}
	return &depsStruct
}

type filesystemCreatorProps struct {
@@ -522,10 +527,8 @@ func generateBpContent(ctx android.EarlyModuleContext, partitionType string) str
	}

	baseProps := generateBaseProps(proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), partitionType)))
	deps := ctx.Config().Get(fsGenStateOnceKey).(*FsGenState).fsDeps
	depProps := &android.PackagingProperties{
		Deps: android.NewSimpleConfigurable(fullyQualifiedModuleNames(deps[partitionType])),
	}
	deps := ctx.Config().Get(fsGenStateOnceKey).(*FsGenState).fsDeps[partitionType]
	depProps := generateDepStruct(*deps)

	result, err := proptools.RepackProperties([]interface{}{baseProps, fsProps, depProps})
	if err != nil {