Replace loading the whole world IR with loading only exported (reachable) IR.
For that purpose the direct and inverse dependency graph is used.
It is stored in a cache directory and the cache updater keeps it up to date.
If after loading it is found that other files must be also implicitly rebuilt
(see rebuilt reasons below), IR for that files also will be loaded.
This algorithm repeats until the number of implicitly rebuilt files is not 0.
More rebuilt reasons (dirty state) have been added:
- added file: this is a new file;
- modified ir: ir of the file has been updated;
- updated exports: exports from the file have been added or removed
(e.g. a function has been used from another file);
- updated inline imports: imported inline function has been modified
(transitively);
- removed inverse depends: a dependent file has been removed;
- removed direct depends: a dependency file has been removed;
- removed file: this file has been removed.
Incremental cache tests has been refactored:
- The supporting of all rebuilt reasons (dirty states) has been added;
- New file name format "*.$suffix.kt" for the test steps has been allowed,
so the syntax highlight works now;
- Explicit stdlib dependency usage has been removed.
GranularMetadataTransformation requires the metadata for dependency
projects, for every given source set multiple times. This lead
to the metadata being built extremely often, causing a significant
bottleneck during import.
Do not process any dependency that was already processed previously.
When filling up the 'resolvedDependencyQueue' there is already
one filter present, checking that the resolved dependency was not
already visited.
However, this filter is insufficient, since the queue is just an
ArrayDeque and not a set. It happened that many dependencies
were enqueued multiple, multiple times.
This dependency brings gradleApi as a transitive dependency, which leads
to false-positive deprecation errors in plugin variants.
^KT-47047 In Progress
Leave empty new visible source sets in a metadata transformation
for a platform (leaf) source set.
Motivation:
* Platform source sets should get their deps from the compilation
* Metadata dependencies in platform source set shouldn't be used
as transitive library dependencies won't be correct in this case
KT-52216
^KTIJ-20875 Fixed
This artifact is used to denote maven artifacts from which IDEA Kotlin
plugin should compose kotlinc dist layout to use it in unbundled JPS
(KTIJ-11633)
Right now kotlin-dist-for-jps-meta tries as close as possible to a real
dist except for:
```
js.engines.jar
kotlin-ant.jar
kotlin-preloader.jar
mutability-annotations-compat.jar
// It's compiler/cli/cli-runner.
// It is `kotlin` in CLI and not needed for JPS
kotlin-runner.jar
// JPS doesn't support KAPT
kotlin-annotation-processing-cli.jar
// Sources
kotlin-annotations-jvm-sources.jar
kotlin-reflect-sources.jar
kotlin-script-runtime-sources.jar
kotlin-stdlib-jdk7-sources.jar
kotlin-stdlib-jdk8-sources.jar
kotlin-stdlib-js-sources.jar
kotlin-stdlib-sources.jar
kotlin-test-js-sources.jar
kotlin-test-junit5-sources.jar
kotlin-test-junit-sources.jar
kotlin-test-sources.jar
kotlin-test-testng-sources.jar
```
^ for elaboration on the list see KTIJ-20875
This commit is going to be cherry-picked to a bunch of old Kotlin
versions, so it needs to be conservative
Alternative fix: I could create a Gradle module but I didn't do that,
because I can't refer to compiler plugin maven modules which are also
specified in Maven poms `libraries/tools/kotlin-maven-*/pom.xml`.
1. `api(project(":kotlin-maven-allopen"))` in imaginary Gradle fix
obviously doesn't work
2. `api("org.jetbrains.kotlin:kotlin-maven-noarg:${project.version}")`
kinda works... but at least breaks IDE import (most probably, it
breaks something else as well)
Previously used the Gradle implementation, which had an undesirable
fallback for the case of missing classes in the given class loader.
For our tests, we want to ensure that only the specified class loader
is used.
All Gradle specific kpm entities shall be disambiguated by using
the `GradleKpm` prefix. For example `MyEntity` shall now be called
`GradleKpmMyEntity` and a subclass would be called like
`GradleKpmSpecialMyEntity`