[BT] Implement classpath snapshotting in the Build Tools API
#KT-57565 In Progress
This commit is contained in:
committed by
Space Team
parent
329fd6be45
commit
83c53b7ce3
@@ -9,7 +9,7 @@ public final class org/jetbrains/kotlin/buildtools/api/CompilationResult : java/
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/buildtools/api/CompilationService {
|
||||
public static final field Companion Lorg/jetbrains/kotlin/buildtools/api/CompilationService$Companion;
|
||||
public abstract fun calculateClasspathSnapshot (Ljava/io/File;)Lorg/jetbrains/kotlin/buildtools/api/jvm/ClasspathEntrySnapshot;
|
||||
public abstract fun calculateClasspathSnapshot (Ljava/io/File;Lorg/jetbrains/kotlin/buildtools/api/jvm/ClassSnapshotGranularity;)Lorg/jetbrains/kotlin/buildtools/api/jvm/ClasspathEntrySnapshot;
|
||||
public abstract fun compileJvm (Lorg/jetbrains/kotlin/buildtools/api/ProjectId;Lorg/jetbrains/kotlin/buildtools/api/CompilerExecutionStrategyConfiguration;Lorg/jetbrains/kotlin/buildtools/api/jvm/JvmCompilationConfiguration;Ljava/util/List;Ljava/util/List;)Lorg/jetbrains/kotlin/buildtools/api/CompilationResult;
|
||||
public abstract fun finishProjectCompilation (Lorg/jetbrains/kotlin/buildtools/api/ProjectId;)V
|
||||
public static fun loadImplementation (Ljava/lang/ClassLoader;)Lorg/jetbrains/kotlin/buildtools/api/CompilationService;
|
||||
@@ -82,6 +82,10 @@ public final class org/jetbrains/kotlin/buildtools/api/SourcesChanges$Unknown :
|
||||
public static final field INSTANCE Lorg/jetbrains/kotlin/buildtools/api/SourcesChanges$Unknown;
|
||||
}
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/buildtools/api/jvm/AccessibleClassSnapshot : org/jetbrains/kotlin/buildtools/api/jvm/ClassSnapshot {
|
||||
public abstract fun getClassAbiHash ()J
|
||||
}
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/buildtools/api/jvm/ClassSnapshot {
|
||||
}
|
||||
|
||||
@@ -93,7 +97,7 @@ public final class org/jetbrains/kotlin/buildtools/api/jvm/ClassSnapshotGranular
|
||||
}
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/buildtools/api/jvm/ClasspathEntrySnapshot {
|
||||
public abstract fun getClassSnapshots ()Ljava/util/LinkedHashMap;
|
||||
public abstract fun getClassSnapshots ()Ljava/util/Map;
|
||||
public abstract fun saveSnapshot (Ljava/io/File;)V
|
||||
}
|
||||
|
||||
@@ -115,6 +119,9 @@ public abstract interface class org/jetbrains/kotlin/buildtools/api/jvm/Classpat
|
||||
public abstract fun useProjectDir (Ljava/io/File;)Lorg/jetbrains/kotlin/buildtools/api/jvm/ClasspathSnapshotBasedIncrementalJvmCompilationConfiguration;
|
||||
}
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/buildtools/api/jvm/InaccessibleClassSnapshot : org/jetbrains/kotlin/buildtools/api/jvm/ClassSnapshot {
|
||||
}
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/buildtools/api/jvm/IncrementalCompilationApproachParameters {
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.buildtools.api
|
||||
|
||||
import org.jetbrains.kotlin.buildtools.api.jvm.ClassSnapshotGranularity
|
||||
import org.jetbrains.kotlin.buildtools.api.jvm.ClasspathEntrySnapshot
|
||||
import org.jetbrains.kotlin.buildtools.api.jvm.JvmCompilationConfiguration
|
||||
import java.io.File
|
||||
@@ -28,7 +29,7 @@ public interface CompilationService {
|
||||
/**
|
||||
* TODO KT-57565
|
||||
*/
|
||||
public fun calculateClasspathSnapshot(classpathEntry: File): ClasspathEntrySnapshot
|
||||
public fun calculateClasspathSnapshot(classpathEntry: File, granularity: ClassSnapshotGranularity): ClasspathEntrySnapshot
|
||||
|
||||
/**
|
||||
* Provides a default [CompilerExecutionStrategyConfiguration] allowing to use it as is or customizing for specific requirements.
|
||||
|
||||
+15
-3
@@ -15,7 +15,7 @@ import java.io.File
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface ClasspathEntrySnapshot {
|
||||
public val classSnapshots: LinkedHashMap<String, ClassSnapshot>
|
||||
public val classSnapshots: Map<String, ClassSnapshot>
|
||||
|
||||
public fun saveSnapshot(path: File)
|
||||
}
|
||||
@@ -26,6 +26,18 @@ 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
|
||||
public sealed interface ClassSnapshot
|
||||
|
||||
/**
|
||||
* [ClassSnapshot] of an inaccessible class.
|
||||
*
|
||||
* A class is inaccessible if it can't be referenced from other source files (and therefore any changes in an inaccessible class will not
|
||||
* require recompilation of other source files).
|
||||
*/
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface InaccessibleClassSnapshot : ClassSnapshot
|
||||
|
||||
@ExperimentalBuildToolsApi
|
||||
public interface AccessibleClassSnapshot : ClassSnapshot {
|
||||
public val classAbiHash: Long
|
||||
}
|
||||
Reference in New Issue
Block a user