[BT] Mark the Build Tools API as experimental
This commit is contained in:
committed by
Space Team
parent
5993e4bce4
commit
bfb314adcb
@@ -16,6 +16,9 @@ public abstract interface class org/jetbrains/kotlin/buildtools/api/CompilerExec
|
||||
public abstract fun useInProcessStrategy ()Lorg/jetbrains/kotlin/buildtools/api/CompilerExecutionStrategyConfiguration;
|
||||
}
|
||||
|
||||
public abstract interface annotation class org/jetbrains/kotlin/buildtools/api/ExperimentalBuildToolsApi : java/lang/annotation/Annotation {
|
||||
}
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/buildtools/api/KotlinLogger {
|
||||
public abstract fun debug (Ljava/lang/String;)V
|
||||
public abstract fun error (Ljava/lang/String;Ljava/lang/Throwable;)V
|
||||
|
||||
+2
@@ -22,6 +22,7 @@ import java.io.File
|
||||
*
|
||||
* This interface is not intended to be implemented by the API consumers. An instance of [CompilationService] is expected to be obtained from [loadImplementation].
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface CompilationService {
|
||||
/**
|
||||
* TODO KT-57565
|
||||
@@ -54,6 +55,7 @@ public interface CompilationService {
|
||||
arguments: List<String>
|
||||
)
|
||||
|
||||
@ExperimentalBuildToolsApi
|
||||
public companion object {
|
||||
@JvmStatic
|
||||
public fun loadImplementation(classLoader: ClassLoader): CompilationService =
|
||||
|
||||
+1
@@ -12,6 +12,7 @@ import java.io.File
|
||||
*
|
||||
* This interface is not intended to be implemented by the API consumers.
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface CompilerExecutionStrategyConfiguration {
|
||||
/**
|
||||
* Marks the compilation to be run inside the same JVM as the caller.
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.buildtools.api
|
||||
|
||||
@RequiresOptIn("This part of the Build Tools API is experimental and might change in the future releases")
|
||||
public annotation class ExperimentalBuildToolsApi
|
||||
+1
@@ -14,6 +14,7 @@ import kotlin.reflect.KClass
|
||||
* This way an API implementation can be loaded with almost fully isolated classpath, sharing only the classes from `org.jetbrains.kotlin.buildtools.api`,
|
||||
* so a caller still able to pass API parameters in a compatible way.
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
@Suppress("FunctionName")
|
||||
@JvmName("newInstance")
|
||||
public fun SharedApiClassesClassLoader(): ClassLoader = SharedApiClassesClassLoaderImpl(
|
||||
|
||||
+1
@@ -10,6 +10,7 @@ import java.io.File
|
||||
/**
|
||||
* A hierarchy representing source files changes for incremental compilation
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public sealed interface SourcesChanges {
|
||||
/**
|
||||
* A marker object stating that the API consumer cannot calculate changes (either because it's an initial build or for some other reason).
|
||||
|
||||
+3
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.buildtools.api.jvm
|
||||
|
||||
import org.jetbrains.kotlin.buildtools.api.ExperimentalBuildToolsApi
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
@@ -12,6 +13,7 @@ import java.io.File
|
||||
*
|
||||
* This interface is not intended to be implemented by the API consumers.
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface ClasspathEntrySnapshot {
|
||||
public val classSnapshots: LinkedHashMap<String, ClassSnapshot>
|
||||
|
||||
@@ -23,6 +25,7 @@ public interface ClasspathEntrySnapshot {
|
||||
*
|
||||
* This interface is not intended to be implemented by the API consumers.
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface ClassSnapshot {
|
||||
// ... TODO: KT-57565, it will expose some part of org.jetbrains.kotlin.incremental.classpathDiff.ClassSnapshot hierarchy
|
||||
}
|
||||
+6
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.buildtools.api.jvm
|
||||
|
||||
import org.jetbrains.kotlin.buildtools.api.ExperimentalBuildToolsApi
|
||||
import org.jetbrains.kotlin.buildtools.api.KotlinLogger
|
||||
import org.jetbrains.kotlin.buildtools.api.SourcesChanges
|
||||
import java.io.File
|
||||
@@ -17,6 +18,7 @@ import java.io.File
|
||||
*
|
||||
* This interface is not intended to be implemented by the API consumers.
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface JvmCompilationConfiguration {
|
||||
/**
|
||||
* A logger used during the compilation.
|
||||
@@ -74,6 +76,7 @@ public interface JvmCompilationConfiguration {
|
||||
*
|
||||
* This interface is not intended to be implemented by the API consumers.
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface IncrementalJvmCompilationConfiguration<P : IncrementalCompilationApproachParameters> {
|
||||
/**
|
||||
* A directory used as a base path for computing relative paths in the incremental compilation caches.
|
||||
@@ -151,6 +154,7 @@ public interface IncrementalJvmCompilationConfiguration<P : IncrementalCompilati
|
||||
*
|
||||
* This interface is not intended to be implemented by the API consumers.
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface ClasspathSnapshotBasedIncrementalJvmCompilationConfiguration :
|
||||
IncrementalJvmCompilationConfiguration<ClasspathSnapshotBasedIncrementalCompilationApproachParameters> {
|
||||
/**
|
||||
@@ -181,11 +185,13 @@ public interface ClasspathSnapshotBasedIncrementalJvmCompilationConfiguration :
|
||||
/**
|
||||
* Mandatory parameters for an incremental compilation approach
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public sealed interface IncrementalCompilationApproachParameters
|
||||
|
||||
/**
|
||||
* Mandatory parameters of the classpath snapshots based incremental compilation approach
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public class ClasspathSnapshotBasedIncrementalCompilationApproachParameters(
|
||||
/**
|
||||
* The classpath snapshots files actual at the moment of compilation
|
||||
|
||||
@@ -10,4 +10,10 @@ dependencies {
|
||||
|
||||
publish()
|
||||
|
||||
standardPublicJars()
|
||||
standardPublicJars()
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
optIn.add("org.jetbrains.kotlin.buildtools.api.ExperimentalBuildToolsApi")
|
||||
}
|
||||
}
|
||||
+3
@@ -12,12 +12,14 @@ import org.gradle.workers.WorkAction
|
||||
import org.gradle.workers.WorkParameters
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildMetricsReporter
|
||||
import org.jetbrains.kotlin.buildtools.api.CompilationService
|
||||
import org.jetbrains.kotlin.buildtools.api.ExperimentalBuildToolsApi
|
||||
import org.jetbrains.kotlin.buildtools.api.SharedApiClassesClassLoader
|
||||
import org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWorkArguments
|
||||
import org.jetbrains.kotlin.gradle.internal.ClassLoadersCachingBuildService
|
||||
import org.jetbrains.kotlin.gradle.internal.ParentClassLoaderProvider
|
||||
import java.io.File
|
||||
|
||||
@OptIn(ExperimentalBuildToolsApi::class)
|
||||
internal abstract class BuildToolsApiCompilationWork : WorkAction<BuildToolsApiCompilationWork.BuildToolsApiCompilationParameters> {
|
||||
internal interface BuildToolsApiCompilationParameters : WorkParameters {
|
||||
val classLoadersCachingService: Property<ClassLoadersCachingBuildService>
|
||||
@@ -48,6 +50,7 @@ internal abstract class BuildToolsApiCompilationWork : WorkAction<BuildToolsApiC
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalBuildToolsApi::class)
|
||||
private object SharedApiClassesClassLoaderProvider : ParentClassLoaderProvider {
|
||||
override fun getClassLoader() = SharedApiClassesClassLoader()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user