xref: /aosp_15_r20/tools/treble/build/treble_build/app/build.go (revision 105f628577ac4ba0e277a494fbb614ed8c12a994)
1*105f6285SAndroid Build Coastguard Worker// Copyright 2022 The Android Open Source Project
2*105f6285SAndroid Build Coastguard Worker//
3*105f6285SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*105f6285SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*105f6285SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*105f6285SAndroid Build Coastguard Worker//
7*105f6285SAndroid Build Coastguard Worker//      http://www.apache.org/licenses/LICENSE-2.0
8*105f6285SAndroid Build Coastguard Worker//
9*105f6285SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*105f6285SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*105f6285SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*105f6285SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*105f6285SAndroid Build Coastguard Worker// limitations under the License.
14*105f6285SAndroid Build Coastguard Workerpackage app
15*105f6285SAndroid Build Coastguard Worker
16*105f6285SAndroid Build Coastguard Worker// Query
17*105f6285SAndroid Build Coastguard Workertype BuildQuery struct {
18*105f6285SAndroid Build Coastguard Worker	Target  string   `json:"target"`
19*105f6285SAndroid Build Coastguard Worker	Inputs  []string `json:"inputs"`
20*105f6285SAndroid Build Coastguard Worker	Outputs []string `json:"outputs"`
21*105f6285SAndroid Build Coastguard Worker}
22*105f6285SAndroid Build Coastguard Worker
23*105f6285SAndroid Build Coastguard Worker// Input
24*105f6285SAndroid Build Coastguard Workertype BuildInput struct {
25*105f6285SAndroid Build Coastguard Worker	Target string   `json:"target"`
26*105f6285SAndroid Build Coastguard Worker	Files  []string `json:"files"`
27*105f6285SAndroid Build Coastguard Worker}
28*105f6285SAndroid Build Coastguard Worker
29*105f6285SAndroid Build Coastguard Worker// Commands
30*105f6285SAndroid Build Coastguard Workertype BuildCommand struct {
31*105f6285SAndroid Build Coastguard Worker	Target string   `json:"target"`
32*105f6285SAndroid Build Coastguard Worker	Cmds   []string `json:"cmds"`
33*105f6285SAndroid Build Coastguard Worker}
34*105f6285SAndroid Build Coastguard Worker
35*105f6285SAndroid Build Coastguard Worker// Path
36*105f6285SAndroid Build Coastguard Workertype BuildPath struct {
37*105f6285SAndroid Build Coastguard Worker	Target     string   `json:"target"`
38*105f6285SAndroid Build Coastguard Worker	Dependency string   `json:"dependency"`
39*105f6285SAndroid Build Coastguard Worker	Paths      []string `json:paths"`
40*105f6285SAndroid Build Coastguard Worker}
41*105f6285SAndroid Build Coastguard Worker
42*105f6285SAndroid Build Coastguard Worker// Build target
43*105f6285SAndroid Build Coastguard Workertype BuildTarget struct {
44*105f6285SAndroid Build Coastguard Worker	Name      string                 `json:"name"`        // Target name
45*105f6285SAndroid Build Coastguard Worker	Steps     int                    `json:"build_steps"` // Number of steps to build target
46*105f6285SAndroid Build Coastguard Worker	FileCount int                    `json:"files"`       // Number of input files for a target
47*105f6285SAndroid Build Coastguard Worker	Projects  map[string]*GitProject `json:"projects"`    // Inputs projects/files of a target
48*105f6285SAndroid Build Coastguard Worker}
49*105f6285SAndroid Build Coastguard Worker
50*105f6285SAndroid Build Coastguard Worker// Build command result
51*105f6285SAndroid Build Coastguard Workertype BuildCmdResult struct {
52*105f6285SAndroid Build Coastguard Worker	Name    string   `json:"name"`
53*105f6285SAndroid Build Coastguard Worker	Output  []string `json:"output"`
54*105f6285SAndroid Build Coastguard Worker	Success bool     `json:"success"`
55*105f6285SAndroid Build Coastguard Worker}
56*105f6285SAndroid Build Coastguard Worker
57*105f6285SAndroid Build Coastguard Worker// Build dependencies
58*105f6285SAndroid Build Coastguard Workertype BuildDeps struct {
59*105f6285SAndroid Build Coastguard Worker	Targets map[string][]string `json:"targets"`
60*105f6285SAndroid Build Coastguard Worker}
61