blob: 781292e75fd4959b0ab76b897f8480fbf9d0485e [file]
// 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;
// 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;
ANDROID = 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.
repeated string passthrough_flags = 5;
// Toolchain info for this build.
KotlinToolchainInfo toolchain_info = 6;
// Paths to Jars that the kotlin compiler will allow package private access to.
repeated string friend_paths = 7;
// The path of the primary output for the task, this is derived from the flagfile.
string primary_output_path = 8;
// Strings to enable various debugging behaviours
// trace: enables trace logging.
// timings: causes timing information to be printed at the of an action.
repeated string debug = 9;
// Enable strict dependency checking for Kotlin
string strict_kotlin_deps = 10;
// Optimize classpath by removing dependencies not required for compilation
string reduced_classpath_mode = 11;
// Internal declarations are treaded as private for abi.jar generation
bool treat_internal_as_private_in_abi_jar = 12;
// Private classes are removed in abi.jar generation
bool remove_private_classes_in_abi_jar = 13;
// New Build Tools API. Required for incremental compilation.
bool build_tools_api = 14;
// Debug info is stripped in abi.jar generation
bool remove_debug_info = 15;
}
// Nested messages not marked with stable could be refactored.
message JvmCompilationTask {
// Directories used by the builder.
message Directories {
// The destination directory the Kotlin 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;
// The directory used by annotation processors containing generated stub classes.
string generated_stub_classes = 5;
string abi_classes = 6;
string generated_java_sources = 7;
// The destination directory the Java compiler should use for class files.
string java_classes = 8;
// The destination directory for code coverage metadata.
string coverage_metadata_classes = 9;
}
// Outputs produced by the builder.
message Outputs {
// The path to the primary output jar.
string jar = 1;
// The path to the jdeps file from Kotlin compilation.
string jdeps = 2;
string srcjar = 3;
// The path to the abijar
string abijar = 4;
// The path to the jar containing source generated from KAPT annotation processors.
string generated_java_src_jar = 5;
// The path to the jar containing stub classes generated from Kotlin annotation processors.
string generated_java_stub_jar = 6;
// The path to the jar containing classes generated from Kotlin annotation processors.
string generated_class_jar = 7;
// Source jar containing the generated KSP sources.
string generated_ksp_src_jar = 8;
// The path to the jar containing the generated KSP classes
string generated_ksp_classes_jar = 9;
}
message Inputs {
// The full classpath
repeated string classpath = 1;
// Direct dependencies of the target.
repeated string direct_dependencies = 2;
// 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;
// Annotation processor FQNames
repeated string processors = 7;
// Annotation processor classpath.
repeated string processorpaths = 8;
// Kotlin stubs phase compiler plugin options
repeated string stubs_plugin_options = 9;
// Kotlin stubs phase compiler plugin options
repeated string stubs_plugins = 10;
// Kotlin stubs phase compiler plugin options
repeated string stubs_plugin_classpath = 11;
// Kotlin compiler phase compiler plugin options
repeated string compiler_plugin_options = 12;
// Kotlin compiler phase compiler plugin options
repeated string compiler_plugins = 13;
// Kotlin compiler phase compiler plugin options
repeated string compiler_plugin_classpath = 14;
// Java opts to be passed to java compiler
repeated string javac_flags = 15;
// JDeps dependency artifacts
repeated string deps_artifacts = 16;
}
CompilationTaskInfo info = 1;
Directories directories = 2;
Outputs outputs = 3;
Inputs inputs = 4;
bool compile_kotlin = 6;
bool instrument_coverage = 7;
}