The `compileOnly` configuration of a source set was not included in the
granular dependency transformation, which led to the dependencies from
the configuration being excluded as unrequested during dependency
processing.
Fix this by properly including the compileOnly scope into the
dependencies transformation.
Issue #KT-36469 Fixed
In some setups, the friendArtifacts that we had in addition to direct
associate compilations' output classes were insufficient. For example:
1. When an Android module's tests depend on another module which
transitively depends on the module containing tests: then the AGP
API doesn't tell us that there are artifacts from the tested
variant, but instead there's just the module's artifact.
2. Similar case but without Android, and if the classes are read from
the module's artifact rather than the production output classes dir,
then they are definitely not on the friend paths (which include the
production classes dirs and not the the production artifact).
In both cases, the friendArtifacts mechanism allows us to add those
potential sources of the friend classes to the friend paths.
Issue #KT-35942 Fixed
This commit partially reverts 970ee4539b.
The Kotlin/Native klib compilation task configuration logic involved
adding dependencies for the compiler plugin artifacts. However, the
compiler plugins classpath, shared across all of the K/N tasks, was
tracked as the tasks' input. This made the following scenario possible:
1. Configuration of some of the Kotlin/Native tasks is avoided at the
evaluation phase;
2. During task graph construction, one of the tasks are evaluated, and
to determine their dependencies, Gradle resolves their inputs,
including the compiler plugins classpath mentioned above;
3. Another K/N task is evaluated afterwards, and the configuration logic
attempts to add a dependency into the compiler plugin classpath
configuration, which has already been resolved in (2).
The build fails.
Fix this by cancelling task configuration avoidance for the K/N tasks.
Issue #KT-36804 Fixed
- In kotlinx.html there is invocation of packageJson function on compilations["main"]
It can be casted in user script to KotlinJsCompilation, or override on plugin side
The relocation root different from the one in embeddable compiler
lead to "linking" errors for classes included in both jars, e.g.
Disposable. Reuse common root to avoid it.
Iterating over all tasks triggered the tasks to configure even if that
was not necessary. Filter the task collection by type instead.
Issue #KT-36472 Fixed
- Can't write npm project to task data because 2 reasons:
-- May be not npm project (if not declared nodejs or browser)
-- In Android there is clash of clean tasks on creating NPM project