Lines Matching refs:mod
91 func (mod *Module) OutputFiles(tag string) (android.Paths, error) {
94 if mod.sourceProvider != nil {
95 return mod.sourceProvider.Srcs(), nil
97 if mod.outputFile.Valid() {
98 return android.Paths{mod.outputFile.Path()}, nil
109 func (mod *Module) ImageMutatorBegin(ctx android.BaseModuleContext) {}
111 func (mod *Module) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
115 func (mod *Module) RamdiskVariantNeeded(android.BaseModuleContext) bool {
116 return mod.InRamdisk()
119 func (mod *Module) RecoveryVariantNeeded(android.BaseModuleContext) bool {
120 return mod.InRecovery()
123 func (mod *Module) ExtraImageVariations(android.BaseModuleContext) []string {
130 func (mod *Module) BuildStubs() bool {
134 func (mod *Module) HasStubsVariants() bool {
138 func (mod *Module) SelectedStl() string {
142 func (mod *Module) NonCcVariants() bool {
143 if mod.compiler != nil {
144 if _, ok := mod.compiler.(libraryInterface); ok {
148 panic(fmt.Errorf("NonCcVariants called on non-library module: %q", mod.BaseModuleName()))
151 func (mod *Module) ApiLevel() string {
152 …panic(fmt.Errorf("Called ApiLevel on Rust module %q; stubs libraries are not yet supported.", mod.…
155 func (mod *Module) Static() bool {
156 if mod.compiler != nil {
157 if library, ok := mod.compiler.(libraryInterface); ok {
164 func (mod *Module) Shared() bool {
165 if mod.compiler != nil {
166 if library, ok := mod.compiler.(libraryInterface); ok {
173 func (mod *Module) Toc() android.OptionalPath {
174 if mod.compiler != nil {
175 if _, ok := mod.compiler.(libraryInterface); ok {
179 panic(fmt.Errorf("Toc() called on non-library module: %q", mod.BaseModuleName()))
182 func (mod *Module) OnlyInRamdisk() bool {
186 func (mod *Module) OnlyInRecovery() bool {
190 func (mod *Module) UseSdk() bool {
194 func (mod *Module) UseVndk() bool {
198 func (mod *Module) MustUseVendorVariant() bool {
202 func (mod *Module) IsVndk() bool {
206 func (mod *Module) HasVendorVariant() bool {
210 func (mod *Module) SdkVersion() string {
214 func (mod *Module) AlwaysSdk() bool {
218 func (mod *Module) IsSdkVariant() bool {
222 func (mod *Module) ToolchainLibrary() bool {
226 func (mod *Module) NdkPrebuiltStl() bool {
230 func (mod *Module) StubDecorator() bool {
327 func (mod *Module) isCoverageVariant() bool {
328 return mod.coverage.Properties.IsCoverageVariant
333 func (mod *Module) IsNativeCoverageNeeded(ctx android.BaseModuleContext) bool {
334 return mod.coverage != nil && mod.coverage.Properties.NeedCoverageVariant
337 func (mod *Module) PreventInstall() {
338 mod.Properties.PreventInstall = true
341 func (mod *Module) HideFromMake() {
342 mod.Properties.HideFromMake = true
345 func (mod *Module) MarkAsCoverageVariant(coverage bool) {
346 mod.coverage.Properties.IsCoverageVariant = coverage
349 func (mod *Module) EnableCoverageIfNeeded() {
350 mod.coverage.Properties.CoverageEnabled = mod.coverage.Properties.NeedCoverageBuild
383 func (mod *Module) CrateName() string {
384 return mod.compiler.crateName()
387 func (mod *Module) CcLibrary() bool {
388 if mod.compiler != nil {
389 if _, ok := mod.compiler.(*libraryDecorator); ok {
396 func (mod *Module) CcLibraryInterface() bool {
397 if mod.compiler != nil {
400 if lib, ok := mod.compiler.(libraryInterface); ok && (lib.buildShared() || lib.buildStatic()) {
407 func (mod *Module) IncludeDirs() android.Paths {
408 if mod.compiler != nil {
409 if library, ok := mod.compiler.(*libraryDecorator); ok {
413 panic(fmt.Errorf("IncludeDirs called on non-library module: %q", mod.BaseModuleName()))
416 func (mod *Module) SetStatic() {
417 if mod.compiler != nil {
418 if library, ok := mod.compiler.(libraryInterface); ok {
423 panic(fmt.Errorf("SetStatic called on non-library module: %q", mod.BaseModuleName()))
426 func (mod *Module) SetShared() {
427 if mod.compiler != nil {
428 if library, ok := mod.compiler.(libraryInterface); ok {
433 panic(fmt.Errorf("SetShared called on non-library module: %q", mod.BaseModuleName()))
436 func (mod *Module) SetBuildStubs() {
440 func (mod *Module) SetStubsVersions(string) {
444 func (mod *Module) StubsVersion() string {
448 func (mod *Module) BuildStaticVariant() bool {
449 if mod.compiler != nil {
450 if library, ok := mod.compiler.(libraryInterface); ok {
454 panic(fmt.Errorf("BuildStaticVariant called on non-library module: %q", mod.BaseModuleName()))
457 func (mod *Module) BuildSharedVariant() bool {
458 if mod.compiler != nil {
459 if library, ok := mod.compiler.(libraryInterface); ok {
463 panic(fmt.Errorf("BuildSharedVariant called on non-library module: %q", mod.BaseModuleName()))
467 func (mod *Module) SetDepsInLinkOrder([]android.Path) {}
469 func (mod *Module) GetDepsInLinkOrder() []android.Path {
473 func (mod *Module) GetStaticVariant() cc.LinkableInterface {
477 func (mod *Module) Module() android.Module {
478 return mod
481 func (mod *Module) StubsVersions() []string {
483 if mod.compiler != nil {
484 if _, ok := mod.compiler.(libraryInterface); ok {
488 panic(fmt.Errorf("StubsVersions called on non-library module: %q", mod.BaseModuleName()))
491 func (mod *Module) OutputFile() android.OptionalPath {
492 return mod.outputFile
495 func (mod *Module) InRecovery() bool {
499 func (mod *Module) HasStaticVariant() bool {
500 if mod.GetStaticVariant() != nil {
506 func (mod *Module) CoverageFiles() android.Paths {
507 if mod.compiler != nil {
508 if !mod.compiler.nativeCoverage() {
511 if library, ok := mod.compiler.(*libraryDecorator); ok {
518 panic(fmt.Errorf("CoverageFiles called on non-library module: %q", mod.BaseModuleName()))
523 func (mod *Module) Init() android.Module {
524 mod.AddProperties(&mod.Properties)
526 if mod.compiler != nil {
527 mod.AddProperties(mod.compiler.compilerProps()...)
529 if mod.coverage != nil {
530 mod.AddProperties(mod.coverage.props()...)
532 if mod.clippy != nil {
533 mod.AddProperties(mod.clippy.props()...)
535 if mod.sourceProvider != nil {
536 mod.AddProperties(mod.sourceProvider.sourceProviderProps()...)
539 android.InitAndroidArchModule(mod, mod.hod, mod.multilib)
541 android.InitDefaultableModule(mod)
544 android.AddLoadHook(mod, func(ctx android.LoadHookContext) {
557 return mod
629 func (mod *Module) nativeCoverage() bool {
630 return mod.compiler != nil && mod.compiler.nativeCoverage()
633 func (mod *Module) toolchain(ctx android.BaseModuleContext) config.Toolchain {
634 if mod.cachedToolchain == nil {
635 mod.cachedToolchain = config.FindToolchain(ctx.Os(), ctx.Arch())
637 return mod.cachedToolchain
643 func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
648 toolchain := mod.toolchain(ctx)
655 deps := mod.depsToPaths(ctx)
660 if mod.compiler != nil {
661 flags = mod.compiler.compilerFlags(ctx, flags)
663 if mod.coverage != nil {
664 flags, deps = mod.coverage.flags(ctx, flags, deps)
666 if mod.clippy != nil {
667 flags, deps = mod.clippy.flags(ctx, flags, deps)
670 if mod.compiler != nil {
671 outputFile := mod.compiler.compile(ctx, flags, deps)
672 mod.outputFile = android.OptionalPathForPath(outputFile)
673 if !mod.Properties.PreventInstall {
674 mod.compiler.install(ctx, mod.outputFile.Path())
676 } else if mod.sourceProvider != nil {
677 outputFile := mod.sourceProvider.generateSource(ctx, deps)
678 mod.outputFile = android.OptionalPathForPath(outputFile)
679 mod.subName = ctx.ModuleSubDir()
683 func (mod *Module) deps(ctx DepsContext) Deps {
686 if mod.compiler != nil {
687 deps = mod.compiler.compilerDeps(ctx, deps)
688 } else if mod.sourceProvider != nil {
689 deps = mod.sourceProvider.sourceProviderDeps(ctx, deps)
692 if mod.coverage != nil {
693 deps = mod.coverage.deps(ctx, deps)
735 func (mod *Module) begin(ctx BaseModuleContext) {
736 if mod.coverage != nil {
737 mod.coverage.begin(ctx)
741 func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
771 mod.Properties.AndroidMkDylibs = append(mod.Properties.AndroidMkDylibs, depName)
780 mod.Properties.AndroidMkRlibs = append(mod.Properties.AndroidMkRlibs, depName)
783 mod.Properties.AndroidMkProcMacroLibs = append(mod.Properties.AndroidMkProcMacroLibs, depName)
812 if lib, ok := mod.compiler.(exportedFlagsProducer); ok {
846 if mod, ok := ccDep.(*cc.Module); ok {
847 …depPaths.depSystemIncludePaths = append(depPaths.depSystemIncludePaths, mod.ExportedSystemIncludeD…
848 depPaths.depClangFlags = append(depPaths.depClangFlags, mod.ExportedFlags()...)
852 mod.Properties.AndroidMkStaticLibs = append(mod.Properties.AndroidMkStaticLibs, depName)
858 if mod, ok := ccDep.(*cc.Module); ok {
859 …depPaths.depSystemIncludePaths = append(depPaths.depSystemIncludePaths, mod.ExportedSystemIncludeD…
860 depPaths.depClangFlags = append(depPaths.depClangFlags, mod.ExportedFlags()...)
863 mod.Properties.AndroidMkSharedLibs = append(mod.Properties.AndroidMkSharedLibs, depName)
872 if lib, ok := mod.compiler.(exportedFlagsProducer); ok && exportDep {
937 func (mod *Module) InstallInData() bool {
938 if mod.compiler == nil {
941 return mod.compiler.inData()
956 func (mod *Module) DepsMutator(actx android.BottomUpMutatorContext) {
961 deps := mod.deps(ctx)
963 if cc.VersionVariantAvailable(mod) {
967 if !mod.Host() {
981 autoDep := mod.compiler.(autoDeppable).autoDep()
1007 if mod, ok := ctx.Module().(*Module); ok && mod.Enabled() {
1008 mod.beginMutator(ctx)
1012 func (mod *Module) beginMutator(actx android.BottomUpMutatorContext) {
1017 mod.begin(ctx)
1020 func (mod *Module) Name() string {
1021 name := mod.ModuleBase.Name()
1022 if p, ok := mod.compiler.(interface {
1032 func (mod *Module) HostToolPath() android.OptionalPath {
1033 if !mod.Host() {
1036 if _, ok := mod.compiler.(*binaryDecorator); ok {
1037 return mod.outputFile