blob: df61f4021b14f556ff981e40f39e6f9bf6897f1d [file] [log] [blame]
Ronald Braunstein73b08ff2023-12-19 10:24:47 -08001// Copyright 2020 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package android
16
17func init() {
18 RegisterTeamBuildComponents(InitRegistrationContext)
19}
20
21func RegisterTeamBuildComponents(ctx RegistrationContext) {
22 ctx.RegisterModuleType("team", TeamFactory)
23}
24
25var PrepareForTestWithTeamBuildComponents = GroupFixturePreparers(
26 FixtureRegisterWithContext(RegisterTeamBuildComponents),
27)
28
29type teamProperties struct {
30 Trendy_team_id *string `json:"trendy_team_id"`
31}
32
33type teamModule struct {
34 ModuleBase
35 DefaultableModuleBase
36
37 properties teamProperties
38}
39
40// Real work is done for the module that depends on us.
41// If needed, the team can serialize the config to json/proto file as well.
42func (t *teamModule) GenerateAndroidBuildActions(ctx ModuleContext) {}
43
44func (t *teamModule) TrendyTeamId(ctx ModuleContext) string {
45 return *t.properties.Trendy_team_id
46}
47
48func TeamFactory() Module {
49 module := &teamModule{}
50
51 base := module.base()
52 module.AddProperties(&base.nameProperties, &module.properties)
53
54 InitAndroidModule(module)
55 InitDefaultableModule(module)
56
57 return module
58}