blob: d3ef979156c1f7ea5a185c4e513d899027242abf [file] [log] [blame]
Lorenz Brunb60d9cb2021-02-18 17:34:00 +01001// Copyright 2020 The Monogon Project Authors.
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17syntax = "proto3";
18
19package ccfixspec;
20
21// CCFixSpec is the root configuration message for bazel_cc_fix
22message CCFixSpec {
23 // replace contains replace directives which modify normal include file resolution. They can be used to for example
24 // redirect system includes to third-party library to the correct inter-workspace path or to change the location
25 // of certain generated files.
26 repeated Replace replace = 1;
27
28 // See GeneratedFile
29 repeated GeneratedFile generated_file = 2;
30
31 // If set, all files in this directory are treated as generated files. Useful for out-of-tree build systems like
32 // meson and cmake. Shouldn't be set on build systems which build in-tree.
33 string build_dir = 3;
34}
35
36message Replace {
37 enum Type {
38 UNKNOWN = 0;
39 // SYSTEM replaces included system headers (within < >) with the given
40 // workspace or inter-workspace (external/<otherworkspace>) paths. It
41 // matches literally as these files are generally not resolvable.
42 SYSTEM = 1;
43 // WORKSPACE replaces included workspace-relative headers (after resolving)
44 // with the given workspace or inter-workspace paths. It matches
45 // pre-resolved workspace-relative paths.
46 WORKSPACE = 2;
47 }
48 Type type = 1;
49 string from = 2;
50 string to = 3;
51}
52
53// GeneratedFile represents a generated file which is not present in the
54// workspace as it has not been generated yet. Specifying it explicitly allows
55// the resolver to know about it an resolve it properly.
56message GeneratedFile { string path = 1; }