diff options
Diffstat (limited to 'apex/apex.go')
| -rw-r--r-- | apex/apex.go | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/apex/apex.go b/apex/apex.go index 587f63fe1..a1879f5f5 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -63,14 +63,11 @@ func RegisterPreDepsMutators(ctx android.RegisterMutatorsContext) { func RegisterPostDepsMutators(ctx android.RegisterMutatorsContext) { ctx.TopDown("apex_info", apexInfoMutator) ctx.BottomUp("apex_unique", apexUniqueVariationsMutator) - ctx.BottomUp("apex_test_for_deps", apexTestForDepsMutator) - ctx.BottomUp("apex_test_for", apexTestForMutator) // Run mark_platform_availability before the apexMutator as the apexMutator needs to know whether // it should create a platform variant. ctx.BottomUp("mark_platform_availability", markPlatformAvailability) ctx.Transition("apex", &apexTransitionMutator{}) ctx.BottomUp("apex_directly_in_any", apexDirectlyInAnyMutator).MutatesDependencies() - ctx.BottomUp("apex_dcla_deps", apexDCLADepsMutator) } type apexBundleProperties struct { @@ -734,7 +731,6 @@ var ( androidAppTag = &dependencyTag{name: "androidApp", payload: true} bpfTag = &dependencyTag{name: "bpf", payload: true} certificateTag = &dependencyTag{name: "certificate"} - dclaTag = &dependencyTag{name: "dcla"} executableTag = &dependencyTag{name: "executable", payload: true} fsTag = &dependencyTag{name: "filesystem", payload: true} bcpfTag = &dependencyTag{name: "bootclasspathFragment", payload: true, sourceOnly: true, memberType: java.BootclasspathFragmentSdkMemberType} @@ -747,7 +743,6 @@ var ( prebuiltTag = &dependencyTag{name: "prebuilt", payload: true} rroTag = &dependencyTag{name: "rro", payload: true} sharedLibTag = &dependencyTag{name: "sharedLib", payload: true} - testForTag = &dependencyTag{name: "test for"} testTag = &dependencyTag{name: "test", payload: true} shBinaryTag = &dependencyTag{name: "shBinary", payload: true} ) @@ -952,33 +947,6 @@ func (a *apexBundle) OverridablePropertiesDepsMutator(ctx android.BottomUpMutato } } -func apexDCLADepsMutator(mctx android.BottomUpMutatorContext) { - if !mctx.Config().ApexTrimEnabled() { - return - } - if a, ok := mctx.Module().(*apexBundle); ok && a.overridableProperties.Trim_against != nil { - commonVariation := mctx.Config().AndroidCommonTarget.Variations() - mctx.AddFarVariationDependencies(commonVariation, dclaTag, String(a.overridableProperties.Trim_against)) - } else if o, ok := mctx.Module().(*OverrideApex); ok { - for _, p := range o.GetProperties() { - properties, ok := p.(*overridableProperties) - if !ok { - continue - } - if properties.Trim_against != nil { - commonVariation := mctx.Config().AndroidCommonTarget.Variations() - mctx.AddFarVariationDependencies(commonVariation, dclaTag, String(properties.Trim_against)) - } - } - } -} - -type DCLAInfo struct { - ProvidedLibs []string -} - -var DCLAInfoProvider = blueprint.NewMutatorProvider[DCLAInfo]("apex_info") - var _ ApexInfoMutator = (*apexBundle)(nil) func (a *apexBundle) ApexVariationName() string { @@ -1087,12 +1055,6 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) { child.(android.ApexModule).BuildForApex(apexInfo) // leave a mark! return true }) - - if a.dynamic_common_lib_apex() { - android.SetProvider(mctx, DCLAInfoProvider, DCLAInfo{ - ProvidedLibs: a.properties.Native_shared_libs.GetOrDefault(mctx, nil), - }) - } } type ApexInfoMutator interface { @@ -1185,40 +1147,6 @@ func apexUniqueVariationsMutator(mctx android.BottomUpMutatorContext) { } } -// apexTestForDepsMutator checks if this module is a test for an apex. If so, add a dependency on -// the apex in order to retrieve its contents later. -// TODO(jiyong): move this to android/apex.go? -func apexTestForDepsMutator(mctx android.BottomUpMutatorContext) { - if !mctx.Module().Enabled(mctx) { - return - } - if am, ok := mctx.Module().(android.ApexModule); ok { - if testFor := am.TestFor(); len(testFor) > 0 { - mctx.AddFarVariationDependencies([]blueprint.Variation{ - {Mutator: "os", Variation: am.Target().OsVariation()}, - {"arch", "common"}, - }, testForTag, testFor...) - } - } -} - -// TODO(jiyong): move this to android/apex.go? -func apexTestForMutator(mctx android.BottomUpMutatorContext) { - if !mctx.Module().Enabled(mctx) { - return - } - if _, ok := mctx.Module().(android.ApexModule); ok { - var contents []*android.ApexContents - for _, testFor := range mctx.GetDirectDepsWithTag(testForTag) { - abInfo, _ := android.OtherModuleProvider(mctx, testFor, android.ApexBundleInfoProvider) - contents = append(contents, abInfo.Contents) - } - android.SetProvider(mctx, android.ApexTestForInfoProvider, android.ApexTestForInfo{ - ApexContents: contents, - }) - } -} - // markPlatformAvailability marks whether or not a module can be available to platform. A module // cannot be available to platform if 1) it is explicitly marked as not available (i.e. // "//apex_available:platform" is absent) or 2) it depends on another module that isn't (or can't @@ -1442,19 +1370,6 @@ func (a *apexBundle) dynamic_common_lib_apex() bool { return proptools.BoolDefault(a.properties.Dynamic_common_lib_apex, false) } -// See the list of libs to trim -func (a *apexBundle) libs_to_trim(ctx android.ModuleContext) []string { - dclaModules := ctx.GetDirectDepsWithTag(dclaTag) - if len(dclaModules) > 1 { - panic(fmt.Errorf("expected exactly at most one dcla dependency, got %d", len(dclaModules))) - } - if len(dclaModules) > 0 { - DCLAInfo, _ := android.OtherModuleProvider(ctx, dclaModules[0], DCLAInfoProvider) - return DCLAInfo.ProvidedLibs - } - return []string{} -} - // These functions are interfacing with cc/sanitizer.go. The entire APEX (along with all of its // members) can be sanitized, either forcibly, or by the global configuration. For some of the // sanitizers, extra dependencies can be forcibly added as well. @@ -2941,10 +2856,6 @@ func rBcpPackages() map[string][]string { } } -func (a *apexBundle) IsTestApex() bool { - return a.testApex -} - // verifyNativeImplementationLibs compares the list of transitive implementation libraries used to link native // libraries in the apex against the list of implementation libraries in the apex, ensuring that none of the // libraries in the apex have references to private APIs from outside the apex. |