blob: c273dc6470573642c0a8605d921e0ed048659b21 [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
Ronald Braunsteinc5603092024-03-27 06:46:47 -070017import "github.com/google/blueprint"
18
Ronald Braunstein73b08ff2023-12-19 10:24:47 -080019func init() {
20 RegisterTeamBuildComponents(InitRegistrationContext)
21}
22
23func RegisterTeamBuildComponents(ctx RegistrationContext) {
24 ctx.RegisterModuleType("team", TeamFactory)
25}
26
27var PrepareForTestWithTeamBuildComponents = GroupFixturePreparers(
28 FixtureRegisterWithContext(RegisterTeamBuildComponents),
29)
30
31type teamProperties struct {
32 Trendy_team_id *string `json:"trendy_team_id"`
33}
34
35type teamModule struct {
36 ModuleBase
37 DefaultableModuleBase
38
39 properties teamProperties
40}
41
Ronald Braunsteinc5603092024-03-27 06:46:47 -070042type TestModuleInformation struct {
43 TestOnly bool
44 TopLevelTarget bool
45}
46
47var TestOnlyProviderKey = blueprint.NewProvider[TestModuleInformation]()
48
Ronald Braunstein73b08ff2023-12-19 10:24:47 -080049// Real work is done for the module that depends on us.
50// If needed, the team can serialize the config to json/proto file as well.
51func (t *teamModule) GenerateAndroidBuildActions(ctx ModuleContext) {}
52
53func (t *teamModule) TrendyTeamId(ctx ModuleContext) string {
54 return *t.properties.Trendy_team_id
55}
56
57func TeamFactory() Module {
58 module := &teamModule{}
59
60 base := module.base()
61 module.AddProperties(&base.nameProperties, &module.properties)
62
63 InitAndroidModule(module)
64 InitDefaultableModule(module)
65
66 return module
67}