blob: 2af674ff00666dc0c36728456cd618f943d225aa [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";
option java_multiple_files = true;
// 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;
}
enum RuleKind {
LIBRARY = 0;
BINARY = 1;
TEST = 2;
IMPORT = 3;
}
enum Platform {
JVM = 0;
JS = 1;
}
// Common info about a Kotlin compilation task, this message is shared by all compilation tasks.
message CompilationTaskInfo {
string label = 1;
// The Platform type.
Platform platform = 2;
// The kind of the rule.
RuleKind rule_kind = 3;
// The name of the module being compiled.
string module_name = 4;
// Flags to be passed straight through to the compiler.
string passthrough_flags = 5;
// Toolchain info for this build.
KotlinToolchainInfo toolchain_info = 6;
// Compiler plugin descriptors.
CompilerPlugins plugins = 7;
// Paths to Jars that the kotlin compiler will allow package private access to.
repeated string friend_paths = 8;
}
// Mested messages not marked with stable could be refactored.
message JvmCompilationTask {
// Directories used by the builder.
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.
message Outputs {
// The path to the primary output jar.
string jar = 1;
// The path to the jdeps file.
string jdeps = 2;
string srcjar = 3;
}
message Inputs {
// The full classpath
repeated string classpath = 1;
// Direct dependencies of the target.
map<string, string> direct_dependencies = 2;
// Indirect dependencies of the target.
map<string, string> indirect_dependencies = 3;
// Partitioned from the builder flags and could have been augmented with sources discovered by expanding the
// source_jars and from annotation processing.
repeated string kotlin_sources = 4;
// Partitioned from the builder flags and could have been augmented with sources discovered by expanding the
// source_jars and from annotation processing.
repeated string java_sources = 5;
// Jars containing additional sources.
repeated string source_jars = 6;
}
CompilationTaskInfo info = 1;
Directories directories = 2;
Outputs outputs = 3;
Inputs inputs = 4;
}