Ivet
09/25/2024, 11:02 AMdmitriy.novozhilov
09/25/2024, 11:08 AMIvet
09/30/2024, 6:01 AMAnton Lakotka [JB]
09/30/2024, 8:46 AMWe are currently integrating the Kotlin Incremental Compiler into our build toolJust curious what is this build tool? How deep do you want support Kotlin in there?
Is there an available API that would allow us to create classpath entry snapshot files using the hashes provided by our build tool?So you want to use your implementation of Classpath Snapshoter? But then I'm wondering how you'd want to use it further? Do you use
BuildToolsApi
to invoke Kotlin Compiler? Or do you invoke it via your own infrastructure?
If you want to Integrate your ClasspathSnapshoter into BuildToolsApi
I'm not sure if it is correct but it looks like you can provide your implementation of CompilationService
i.e. instead of this:
override fun calculateClasspathSnapshot(classpathEntry: File, granularity: ClassSnapshotGranularity) =
ClasspathEntrySnapshotImpl(ClasspathEntrySnapshotter.snapshot(classpathEntry, granularity, DoNothingBuildMetricsReporter))
implement via your snapshotter:
override fun calculateClasspathSnapshot(classpathEntry: File, granularity: ClassSnapshotGranularity) =
ClasspathEntrySnapshotImpl(CustomSnapshotter.snapshot(classpathEntry, granularity, DoNothingBuildMetricsReporter))
But I'll CC relevant people, that were designing and implementing BTA
cc: @Alexander.Likhachev @tapchicomatapchicoma
09/30/2024, 10:57 AMAnton Lakotka [JB]
09/30/2024, 11:17 AMsealed class AccessibleClassSnapshot : ClassSnapshot() {
abstract val classId: ClassId
/** The hash of the class's ABI. */
abstract val classAbiHash: Long
override fun toString() = classId.toString()
}
Ivet
09/30/2024, 12:16 PMJust curious what is this build tool? How deep do you want support Kotlin in there?Buck. Kotlin compilation using the K2JVMCompiler is already supported (pointer).
Ivet
09/30/2024, 12:23 PMSo you want to use your implementation of Classpath Snapshoter? But then I'm wondering how you'd want to use it further?
Do you useWe are currently experimenting with the BuildToolsApi to enable incremental Kotlin compilation and create classpath snapshot files, which need to be provided here. However, Buck already has its own support for incremental actions, as documented here. We are wondering if we can reuse this data instead of recalculating it on the Kotlin side.to invoke Kotlin Compiler? Or do you invoke it via your own infrastructure?BuildToolsApi
Ivet
09/30/2024, 12:28 PMClasspath snapshot is not about hashes, but about extracting ABI from compilation dependenciesIsn't it represented by a hash at the end? (assuming by looking at AccessibleClassSnapshot).
Ivet
09/30/2024, 12:43 PMyou can provide your implementation ofI was already looking into this, but the documentation for the CompilationService states that "This interface is not intended to be implemented by API consumers," so I was not sure if it was the right approach.CompilationService
Ivet
09/30/2024, 12:44 PMIvet
09/30/2024, 1:01 PM