Files
kotlin-fork/compiler/build-tools/kotlin-build-tools-api
Hung Nguyen 894ba9ab80 [IC] Relocatable IC caches for projects with custom buildDir
IC caches often contain file paths. To make them relocatable, we need
to convert these file paths into relative paths, relative to a base
directory.
  - If the file paths are source files, we can use the root project
    directory as base.
  - If the file paths are class files, we should use the classes
    directory as base (before this commit, we used the root project
    directory in both cases, that's why we hit KT-58547).

The key changes in this commit include:
  - RelocatableFileToPathConverter: converts paths to relative paths
  - IncrementalCompilationContext: contains 2 different path converters,
    one for source files and one for class files
  - SourceToOutputFilesMap: maps source files to class files using the
    above path converters
  - IncrementalCompilerRunner: creates the path converters based on file
    locations

Test: RelocatableFileToPathConverterTest unit test
      SourceToOutputFilesMapTest unit test
      BuildCacheRelocationIT.testCustomBuildDirectory integration test
^KT-58547 Fixed
2023-08-16 13:40:19 +00:00
..

Build Tools API

This module contains public interfaces for Kotlin build tools. Using APIs from this module should be the preferred way to work with Kotlin compiler when integrating Kotlin builds into different build systems. The Kotlin stdlib of at least Kotlin 1.4 is expected to be a dependency of a consumer of the API.

The default implementation of the API is located in the kotlin-build-tools-impl directory. Interfaces implementation are expected to be loaded using the ServiceLoader. The purpose of such a segregation is to allow using this API with different Kotlin compiler versions.