// Copyright 2021 Bloomberg Finance L.P
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package build.buildbox;

import "build/bazel/remote/execution/v2/remote_execution.proto";
import "build/buildbox/execution_stats.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";

message CompilerExecutionData {
    string command = 1;

    string full_command = 2;

    repeated build.bazel.remote.execution.v2.FileNode source_file_info = 3;

    map<string, string> environment_variables = 4;

    string tool_name = 5;
    string tool_version = 6;

    build.bazel.remote.execution.v2.Platform platform = 7;

    build.buildbox.ExecutionStatistics local_resource_usage = 8;

    string working_directory = 9;

    ReccData recc_data = 10;

    string correlated_invocations_id = 11;

    google.protobuf.Timestamp timestamp = 12;

    google.protobuf.Duration duration = 13;

    google.protobuf.Int32Value exit_code = 14;
}

message ReccData {
    map<string, google.protobuf.Duration> duration_metrics = 1;
    map<string, int64> counter_metrics = 2;
    build.bazel.remote.execution.v2.Digest action_digest = 3;
}
