blob: d1e4ced8e4167d34c55d66cefd0c23ad9c4bec73 [file] [log] [blame]
// Copyright 2018 The Bazel Authors. All rights reserved.
//
// 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 bazel.kotlin;
option java_package = "io.bazel.kotlin.model";
// An abstract definition of an annotation processor. This is encoded into a format understood by kapt3.
// +stable
message AnnotationProcessor {
// The annotation processor class.
string processor_class = 1;
// The Bazel `java_plugin` `generates_api` attribute.
bool generates_api = 2;
// The full transitive classpath required for annotation processing.
repeated string classpath = 3;
// The label of the plugin.
string label = 4;
}
// A container for all of the types of compiler plugins needed by the kotlin compilers.
// +stable
message CompilerPlugins {
// Regular java annotation_processor descriptors.
repeated AnnotationProcessor annotation_processors = 1;
}
// Toolchain info this contains info to be used to configure the compile tasks as well as configuring certain features
// in IDE plugins.
// +stable
message KotlinToolchainInfo {
// Common properties that should be common to all platforms.
message Common {
// mandatory
string language_version = 1;
// mandatory
string api_version = 2;
// mandatory
// oneof "enable", "warn" or "error"
string coroutines = 3;
}
// Properties specific to the JVM.
message Jvm {
// The property is additionally to configure the source and target bytecode levels in kapt3, javac and kotlin.
// mandatory
// oneof "1.6", or "1.8"
string jvm_target = 1;
}
Common common = 1;
Jvm jvm = 2;
}
// Mested messages not marked with stable could be refactored.
message BuilderCommand {
message Info {
string label = 1;
// derived from label
string package = 2;
// derived from label
string target = 3;
string rule_kind = 4;
string kotlin_module_name = 5;
string passthrough_flags = 6;
KotlinToolchainInfo toolchain_info = 7;
CompilerPlugins plugins = 8;
// All of the plugin descriptors in the format kotlinc understands.
// +derived
repeated string encoded_plugin_descriptors = 9;
// Jars that the kotlin compiler will allow package private access to.
repeated string friend_paths = 10;
}
// Directories used by the builder.
// +stable
message Directories {
// The directory the compiler should use for class files.
string classes = 1;
// The directory to use by annotation processors to produce classes.
string generated_classes = 2;
// The directory used by annotation processors. The generated sources are currently only java.
string generated_sources = 3;
// A temp directory that the compiler may use. The source_jars are expanding into here.
string temp = 4;
}
// Outputs produced by the builder.
// +stable
message Outputs {
// The path to the primary output jar.
string jar = 1;
// The path to the jdeps file.
string jdeps = 2;
}
message Inputs {
// The full classpath
repeated string classpath = 1;
// The full joined classpath
// +derived
string joined_classpath = 2;
// Direct dependencies of the target.
map<string, string> direct_dependencies = 3;
// Indirect dependencies of the target.
map<string, string> indirect_dependencies = 4;
// Partitioned from the builder flags and by expanding the source_jars.
// +derived
repeated string kotlin_sources = 5;
// Partitioned from the builder flags and by expanding the source_jars.
// +derived
repeated string java_sources = 6;
// Created during annotation processing and partitioned from the generated_sources directory.
// +dervived
repeated string generated_kotlin_sources = 7;
// Created during annotation processing and partitioned from the generated_sources directory.
// +derived
repeated string generated_java_sources = 8;
// Jars containing additional sources.
repeated string source_jars = 9;
}
Info info = 1;
Directories directories = 2;
Outputs outputs = 3;
Inputs inputs = 4;
}