Lines Matching refs:i

145 	for i, name := range notFrozen {
146 reason := requireFrozenReason[i]
462 func (i *aidlInterface) shouldGenerateJavaBackend() bool {
464 return proptools.BoolDefault(i.properties.Backend.Java.Enabled, true)
467 func (i *aidlInterface) shouldGenerateCppBackend() bool {
469 return proptools.BoolDefault(i.properties.Backend.Cpp.Enabled, true)
472 func (i *aidlInterface) shouldGenerateNdkBackend() bool {
474 return proptools.BoolDefault(i.properties.Backend.Ndk.Enabled, true)
482 func (i *aidlInterface) shouldGenerateAppNdkBackend() bool {
483 return i.shouldGenerateNdkBackend() &&
484 proptools.BoolDefault(i.properties.Backend.Ndk.Apps_enabled, true) &&
485 !i.SocSpecific()
488 func (i *aidlInterface) shouldGenerateRustBackend() bool {
490 return proptools.BoolDefault(i.properties.Backend.Rust.Enabled, true)
493 func (i *aidlInterface) useUnfrozen(ctx android.EarlyModuleContext) bool {
511 if proptools.Bool(i.properties.Always_use_unfrozen) {
518 func (i *aidlInterface) minSdkVersion(lang string) *string {
522 ver = i.properties.Backend.Cpp.Min_sdk_version
524 ver = i.properties.Backend.Java.Min_sdk_version
526 ver = i.properties.Backend.Ndk.Min_sdk_version
528 ver = i.properties.Backend.Rust.Min_sdk_version
533 return i.properties.Min_sdk_version
538 func (i *aidlInterface) genTrace(lang string) bool {
542 ver = i.properties.Backend.Cpp.Gen_trace
548 ver = i.properties.Backend.Java.Gen_trace
549 if ver == nil && proptools.Bool(i.properties.Backend.Java.Platform_apis) {
556 ver = i.properties.Backend.Ndk.Gen_trace
558 ver = i.properties.Backend.Rust.Gen_trace
565 ver = i.properties.Gen_trace
617 switch i := mctx.Module().(type) {
621 for _, anImportWithVersion := range i.properties.Imports {
632 addImportedInterfaceDeps(mctx, i.properties.Imports)
634 for _, header := range i.properties.Headers {
635 mctx.AddDependency(i, interfaceHeadersDep, header)
638 mctx.AddDependency(i, interfaceDep, i.properties.AidlInterfaceName+aidlInterfaceSuffix)
639 addImportedInterfaceDeps(mctx, i.properties.Imports)
641 for _, props := range i.GetProperties() {
643 mctx.AddDependency(i, interfaceDep, sp.AidlInterfaceName+aidlInterfaceSuffix)
649 mctx.AddDependency(i, interfaceDep, i.properties.BaseName+aidlInterfaceSuffix)
650 addImportedInterfaceDeps(mctx, i.properties.Imports)
651 for _, anImport := range i.properties.Imports {
653 mctx.AddDependency(i, importApiDep, name+aidlApiSuffix)
655 for _, header := range i.properties.Headers {
656 mctx.AddDependency(i, interfaceHeadersDep, header)
659 mctx.AddDependency(i, interfaceDep, i.properties.BaseName+aidlInterfaceSuffix)
660 addImportedInterfaceDeps(mctx, i.properties.Imports)
661 if !proptools.Bool(i.properties.Unstable) {
663 mctx.AddDependency(i, apiDep, i.properties.BaseName+aidlApiSuffix)
665 for _, header := range i.properties.Headers {
666 mctx.AddDependency(i, interfaceHeadersDep, header)
678 if i, ok := mctx.Module().(*aidlInterface); ok {
696 …ts", "%q depends on %q but does not specify a version (must be one of %q)", i.ModuleBase.Name(), a…
700 … on %q version %q(%q), which doesn't exist. The version must be one of %q", i.ModuleBase.Name(), a…
703 if i.shouldGenerateJavaBackend() && !other.shouldGenerateJavaBackend() {
708 if i.shouldGenerateCppBackend() && !other.shouldGenerateCppBackend() {
713 if i.shouldGenerateNdkBackend() && !other.shouldGenerateNdkBackend() {
718 if i.shouldGenerateRustBackend() && !other.shouldGenerateRustBackend() {
723 if i.isFrozen() && other.isExplicitlyUnFrozen() && version == "" {
726 i.ModuleBase.Name(), anImport, i.ModuleBase.Name(), anImport+"-V*", candidateVersions)
728 if i.Owner() == "" && other.Owner() != "" {
731 i.ModuleBase.Name(), anImport, other.Owner())
737 func (i *aidlInterface) checkGenTrace(mctx android.DefaultableHookContext) {
738 if !proptools.Bool(i.properties.Gen_trace) {
741 if i.shouldGenerateJavaBackend() && !proptools.Bool(i.properties.Backend.Java.Platform_apis) {
746 func (i *aidlInterface) checkStability(mctx android.DefaultableHookContext) {
747 if i.properties.Stability == nil {
751 if proptools.Bool(i.properties.Unstable) {
757 isVintf := "vintf" == proptools.String(i.properties.Stability)
762 func (i *aidlInterface) checkVersions(mctx android.DefaultableHookContext) {
763 if len(i.properties.Versions) > 0 && len(i.properties.Versions_with_info) > 0 {
764 …at the same time. Use versions_with_info instead of versions.", i.properties.Versions, i.propertie…
767 if len(i.properties.Versions) > 0 {
768 i.properties.VersionsInternal = make([]string, len(i.properties.Versions))
769 copy(i.properties.VersionsInternal, i.properties.Versions)
770 } else if len(i.properties.Versions_with_info) > 0 {
771 i.properties.VersionsInternal = make([]string, len(i.properties.Versions_with_info))
772 for idx, value := range i.properties.Versions_with_info {
773 i.properties.VersionsInternal[idx] = value.Version
784 intVersions := make([]int, 0, len(i.getVersions()))
785 for _, ver := range i.getVersions() {
804 mctx.PropertyErrorf("versions", "should be sorted, but is %v", i.getVersions())
808 func (i *aidlInterface) checkFlags(mctx android.DefaultableHookContext) {
809 for _, flag := range i.properties.Flags {
816 func (i *aidlInterface) nextVersion() string {
817 if proptools.Bool(i.properties.Unstable) {
820 return nextVersion(i.getVersions())
828 i, err := strconv.Atoi(ver)
832 return strconv.Itoa(i + 1)
835 func (i *aidlInterface) latestVersion() string {
836 if !i.hasVersion() {
839 return i.getVersions()[len(i.getVersions())-1]
842 func (i *aidlInterface) hasVersion() bool {
843 return len(i.getVersions()) > 0
846 func (i *aidlInterface) getVersions() []string {
847 return i.properties.VersionsInternal
850 func (i *aidlInterface) isFrozen() bool {
851 return proptools.Bool(i.properties.Frozen)
856 func (i *aidlInterface) isExplicitlyUnFrozen() bool {
857 return i.properties.Frozen != nil && !proptools.Bool(i.properties.Frozen)
883 func (i *aidlInterface) checkRequireFrozenAndReason(mctx android.EarlyModuleContext) (bool, string)…
884 if proptools.Bool(i.properties.Unstable) {
888 if proptools.Bool(i.properties.Frozen) {
892 if i.Owner() == "" {
900 if android.InList(i.Owner(), strings.Fields(mctx.Config().Getenv("AIDL_FROZEN_OWNERS"))) {
908 func aidlInterfaceHook(mctx android.DefaultableHookContext, i *aidlInterface) {
909 if hasVersionSuffix(i.ModuleBase.Name()) {
912 if !isRelativePath(i.properties.Local_include_dir) {
913 mctx.PropertyErrorf("local_include_dir", "must be relative path: "+i.properties.Local_include_dir)
916 i.checkStability(mctx)
917 i.checkVersions(mctx)
918 i.checkGenTrace(mctx)
919 i.checkFlags(mctx)
927 unstable := proptools.Bool(i.properties.Unstable)
930 if i.hasVersion() {
934 if i.properties.Stability != nil {
935 …mctx.ModuleErrorf("unstable:true and stability:%q cannot happen at the same time", i.properties.St…
940 if i.isFrozen() {
941 if !i.hasVersion() {
947 if !unstable && mctx.Namespace().Path != "." && i.Owner() == "" {
951 requireFrozenVersion, requireFrozenReason := i.checkRequireFrozenAndReason(mctx)
954 if requireFrozenVersion && !i.hasVersion() {
958 versions := i.getVersions()
959 nextVersion := i.nextVersion()
961 langCpp: i.shouldGenerateCppBackend(),
962 langNdk: i.shouldGenerateNdkBackend(),
963 langJava: i.shouldGenerateJavaBackend(),
964 langRust: i.shouldGenerateRustBackend()}
969 shouldGenerateLangBackendMap[langNdkPlatform] = i.shouldGenerateNdkBackend()
976 …libs = append(libs, addLibrary(mctx, i, nextVersion, lang, requireFrozenVersion, requireFrozenReas…
978 libs = append(libs, addLibrary(mctx, i, version, lang, false, "this is a known frozen version"))
984 if i.shouldGenerateCppBackend() && len(i.properties.Imports) == 0 {
985 …libs = append(libs, addLibrary(mctx, i, nextVersion, langCppAnalyzer, false, "analysis always uses…
989 apiDirRoot := filepath.Join(aidlApiDir, i.ModuleBase.Name())
996 addApiModule(mctx, i)
1002 origin: i,
1008 Name: proptools.StringPtr(i.ModuleBase.Name()),
1011 i.internalModuleNames = libs
1023 func (i *aidlInterface) commonBackendProperties(lang string) CommonBackendProperties {
1026 return i.properties.Backend.Cpp.CommonBackendProperties
1028 return i.properties.Backend.Java.CommonBackendProperties
1030 return i.properties.Backend.Ndk.CommonBackendProperties
1032 return i.properties.Backend.Rust.CommonBackendProperties
1038 func (i *aidlInterface) Name() string {
1039 return i.ModuleBase.Name() + aidlInterfaceSuffix
1042 func (i *aidlInterface) GenerateAndroidBuildActions(ctx android.ModuleContext) {
1043 srcs, _ := getPaths(ctx, i.properties.Srcs, i.properties.Local_include_dir)
1046 i.computedTypes = append(i.computedTypes, computedType)
1049 i.preprocessed = make(map[string]android.WritablePath)
1051 for _, version := range concat(i.getVersions(), []string{i.nextVersion()}) {
1052 i.preprocessed[version] = i.buildPreprocessed(ctx, version)
1055 if !proptools.Bool(i.properties.Unstable) {
1056 if i.hasVersion() {
1057 i.preprocessed["latest"] = i.preprocessed[i.latestVersion()]
1060 i.preprocessed["latest"] = i.preprocessed[i.nextVersion()]
1062 i.preprocessed[""] = i.preprocessed[i.nextVersion()]
1066 func (i *aidlInterface) getImportsForVersion(version string) []string {
1068 importsSrc := i.properties.Imports
1069 for _, v := range i.properties.Versions_with_info {
1081 func (i *aidlInterface) getImports(version string) map[string]string {
1083 imports_src := i.getImportsForVersion(version)
1085 …useLatestStable := !proptools.Bool(i.properties.Unstable) && version != "" && version != i.nextVer…
1099 func (i *aidlInterface) buildPreprocessed(ctx android.ModuleContext, version string) android.Writab…
1100 deps := getDeps(ctx, i.getImports(version))
1104 srcs, root_dir := i.srcsForVersion(ctx, version)
1112 imports = append(imports, i.properties.Include_dirs...)
1117 if !proptools.Bool(i.properties.Unstable) {
1120 if i.properties.Stability != nil {
1121 preprocessCommand.FlagWithArg("--stability ", *i.properties.Stability)
1126 name := i.BaseModuleName()
1134 func (i *aidlInterface) DepsMutator(ctx android.BottomUpMutatorContext) {
1139 i := &aidlInterface{}
1140 i.AddProperties(&i.properties)
1141 android.InitAndroidModule(i)
1142 android.InitDefaultableModule(i)
1143 i.SetDefaultableHook(func(ctx android.DefaultableHookContext) { aidlInterfaceHook(ctx, i) })
1144 return i