blob: daa70a725075a31b34ba655e719e48d5ae86a79f [file] [log] [blame]
Colin Cross9454bfa2015-03-17 13:24:18 -07001// Copyright 2015 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 common
16
17import (
18 "blueprint"
19)
20
21func CheckbuildSingleton() blueprint.Singleton {
22 return &checkbuildSingleton{}
23}
24
25type checkbuildSingleton struct{}
26
27func (c *checkbuildSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
28 deps := []string{}
29 ctx.VisitAllModules(func(module blueprint.Module) {
30 if a, ok := module.(AndroidModule); ok {
31 if len(a.base().checkbuildFiles) > 0 {
32 deps = append(deps, ctx.ModuleName(module)+"-checkbuild")
33 }
34 }
35 })
36
37 ctx.Build(pctx, blueprint.BuildParams{
38 Rule: blueprint.Phony,
39 Outputs: []string{"checkbuild"},
40 Implicits: deps,
41 Optional: true,
42 })
43}