Lines Matching refs:scope

172 func initApiScope(scope *apiScope) *apiScope {
173 name := scope.name
174 scopeByName[name] = scope
176 scope.propertyName = strings.ReplaceAll(name, "-", "_")
177 scope.fieldName = proptools.FieldNameForProperty(scope.propertyName)
178 scope.prebuiltStubsTag = scopeDependencyTag{
180 apiScope: scope,
183 scope.everythingStubsTag = scopeDependencyTag{
185 apiScope: scope,
188 scope.exportableStubsTag = scopeDependencyTag{
190 apiScope: scope,
193 scope.stubsSourceTag = scopeDependencyTag{
195 apiScope: scope,
198 scope.apiFileTag = scopeDependencyTag{
200 apiScope: scope,
203 scope.stubsSourceAndApiTag = scopeDependencyTag{
205 apiScope: scope,
208 scope.latestApiModuleTag = scopeDependencyTag{
210 apiScope: scope,
213 scope.latestRemovedApiModuleTag = scopeDependencyTag{
215 apiScope: scope,
223 if scope.annotation != "" {
224 scopeSpecificArgs = []string{"--show-annotation", scope.annotation}
226 for s := scope; s != nil; s = s.extends {
231 if s != scope && s.annotation != "" {
237 if scope.canAccess == nil {
238 scope.canAccess = scope.extends
243 scope.droidstubsArgs = proptools.ShellEscapeList(scopeSpecificArgs)
245 return scope
248 func (scope *apiScope) stubsLibraryModuleNameSuffix() string {
249 return ".stubs" + scope.moduleSuffix
252 func (scope *apiScope) exportableStubsLibraryModuleNameSuffix() string {
253 return ".stubs.exportable" + scope.moduleSuffix
256 func (scope *apiScope) apiLibraryModuleName(baseName string) string {
257 return scope.stubsLibraryModuleName(baseName) + ".from-text"
260 func (scope *apiScope) sourceStubLibraryModuleName(baseName string) string {
261 return scope.stubsLibraryModuleName(baseName) + ".from-source"
264 func (scope *apiScope) exportableSourceStubsLibraryModuleName(baseName string) string {
265 return scope.exportableStubsLibraryModuleName(baseName) + ".from-source"
268 func (scope *apiScope) stubsLibraryModuleName(baseName string) string {
269 return baseName + scope.stubsLibraryModuleNameSuffix()
272 func (scope *apiScope) exportableStubsLibraryModuleName(baseName string) string {
273 return baseName + scope.exportableStubsLibraryModuleNameSuffix()
276 func (scope *apiScope) stubsSourceModuleName(baseName string) string {
277 return baseName + ".stubs.source" + scope.moduleSuffix
280 func (scope *apiScope) apiModuleName(baseName string) string {
281 return baseName + ".api" + scope.moduleSuffix
284 func (scope *apiScope) String() string {
285 return scope.name
290 func (scope *apiScope) snapshotRelativeDir() string {
291 return filepath.Join("sdk_library", scope.name)
296 func (scope *apiScope) snapshotRelativeCurrentApiTxtPath(name string) string {
297 return filepath.Join(scope.snapshotRelativeDir(), name+".txt")
302 func (scope *apiScope) snapshotRelativeRemovedApiTxtPath(name string) string {
303 return filepath.Join(scope.snapshotRelativeDir(), name+"-removed.txt")
310 for _, scope := range scopes {
311 list = append(list, accessor(scope))
321 for i, scope := range scopes {
322 ret[accessor(scope)] = i
328 for _, scope := range scopes {
329 if strings.HasSuffix(name, scope.exportableStubsLibraryModuleNameSuffix()) {
330 return strings.TrimSuffix(name, scope.exportableStubsLibraryModuleNameSuffix()) +
331 scope.stubsLibraryModuleNameSuffix()
1110 if scope, ok := scopeByName[scopeName]; ok {
1111 paths := c.findScopePaths(scope)
1140 return nil, fmt.Errorf("unknown scope %s in %s", scope, tag)
1156 func (c *commonToSdkLibraryAndImport) getScopePathsCreateIfNeeded(scope *apiScope) *scopePaths {
1160 paths := c.scopePaths[scope]
1163 c.scopePaths[scope] = paths
1169 func (c *commonToSdkLibraryAndImport) findScopePaths(scope *apiScope) *scopePaths {
1174 return c.scopePaths[scope]
1179 func (c *commonToSdkLibraryAndImport) findClosestScopePath(scope *apiScope) *scopePaths {
1180 for s := scope; s != nil; s = s.canAccess {
1434 for _, scope := range AllApiScopes {
1435 scopeProperties := module.scopeToProperties[scope]
1444 for _, scope := range AllApiScopes {
1445 scopeProperties := module.scopeToProperties[scope]
1451 defaultEnabledStatus = scope.defaultEnabledStatus
1453 defaultEnabledStatus = scope.legacyEnabledStatus(module)
1457 enabledScopes[scope] = struct{}{}
1458 generatedScopes = append(generatedScopes, scope)
1464 for _, scope := range AllApiScopes {
1465 if _, ok := enabledScopes[scope]; ok {
1466 extends := scope.extends
1469 ctx.ModuleErrorf("enabled api scope %q depends on disabled scope %q", scope, extends)
1700 for scope, scopePaths := range module.scopePaths {
1702 scopes[scope.name] = scopeInfo
1703 scopeInfo["current_api"] = scope.snapshotRelativeCurrentApiTxtPath(baseModuleName)
1704 scopeInfo["removed_api"] = scope.snapshotRelativeRemovedApiTxtPath(baseModuleName)
2142 scope := apiScope
2143 for scope != nil {
2144 …apiContributions = append(apiContributions, module.stubsSourceModuleName(scope)+".api.contribution…
2145 scope = scope.extends
2404 for _, scope := range generatedScopes {
2406 path := path.Join(mctx.ModuleDir(), apiDir, scope.apiFilePrefix+api)
2435 for _, scope := range generatedScopes {
2437 …module.createStubsSourcesAndApi(mctx, scope, module.stubsSourceModuleName(scope), scope.droidstubs…
2439 module.createStubsLibrary(mctx, scope)
2440 module.createExportableStubsLibrary(mctx, scope)
2443 if scope == apiScopePublic {
2448 module.createApiLibrary(mctx, scope, alternativeFullApiSurfaceStubLib)
2451 module.createTopLevelStubsLibrary(mctx, scope, contributesToApiSurface)
2452 module.createTopLevelExportableStubsLibrary(mctx, scope)
2502 stubsLibraryModuleName(scope *apiScope, baseName string) string
2504 stubsSourceModuleName(scope *apiScope, baseName string) string
2506 apiLibraryModuleName(scope *apiScope, baseName string) string
2508 sourceStubsLibraryModuleName(scope *apiScope, baseName string) string
2510 exportableStubsLibraryModuleName(scope *apiScope, baseName string) string
2512 exportableSourceStubsLibraryModuleName(scope *apiScope, baseName string) string
2518 func (s *defaultNamingScheme) stubsLibraryModuleName(scope *apiScope, baseName string) string {
2519 return scope.stubsLibraryModuleName(baseName)
2522 func (s *defaultNamingScheme) stubsSourceModuleName(scope *apiScope, baseName string) string {
2523 return scope.stubsSourceModuleName(baseName)
2526 func (s *defaultNamingScheme) apiLibraryModuleName(scope *apiScope, baseName string) string {
2527 return scope.apiLibraryModuleName(baseName)
2530 func (s *defaultNamingScheme) sourceStubsLibraryModuleName(scope *apiScope, baseName string) string…
2531 return scope.sourceStubLibraryModuleName(baseName)
2534 func (s *defaultNamingScheme) exportableStubsLibraryModuleName(scope *apiScope, baseName string) st…
2535 return scope.exportableStubsLibraryModuleName(baseName)
2538 func (s *defaultNamingScheme) exportableSourceStubsLibraryModuleName(scope *apiScope, baseName stri…
2539 return scope.exportableSourceStubsLibraryModuleName(baseName)
2593 for _, scope := range AllApiScopes {
2594 scopeToProperties[scope] = scope.scopeSpecificProperties(module)