xref: /aosp_15_r20/build/blueprint/incremental.go (revision 1fa6dee971e1612fa5cc0aa5ca2d35a22e2c34a3)
1// Copyright 2024 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 blueprint
16
17import (
18	"text/scanner"
19)
20
21type BuildActionCacheKey struct {
22	Id        string
23	InputHash uint64
24}
25
26type CachedProvider struct {
27	Id    *providerKey
28	Value *any
29}
30
31type BuildActionCachedData struct {
32	Providers        []CachedProvider
33	Pos              *scanner.Position
34	OrderOnlyStrings []string
35}
36
37type BuildActionCache = map[BuildActionCacheKey]*BuildActionCachedData
38
39type OrderOnlyStringsCache map[string][]string
40
41type BuildActionCacheInput struct {
42	PropertiesHash uint64
43	ProvidersHash  [][]uint64
44}
45
46type Incremental interface {
47	IncrementalSupported() bool
48}
49
50type IncrementalModule struct{}
51
52func (m *IncrementalModule) IncrementalSupported() bool {
53	return true
54}
55