This is the Gradle plugin that does not rely on the
Java model and uses the same Kotlin model
(target – compilation – source set) as MPP does.
Also add JS DCE support for this plugin.
Issue #KT-5756 Fixed
Issue #KT-13256 Fixed
Issue #KT-16355 Fixed
Issue #KT-20156 Fixed
Issue #KT-29284 Fixed
The attributes applied by the user to the target and its compilations
were ignored in single-platform plugins while the target was not a part
of the API.
Since the user will be able to access and configure the target, we need
to apply the attributes to the relevant configurations in the same way
as in MPP.
In MPP, the disambiguation classifier is always the same as the target
name. In single-platform projects, the task name suffix should be empty
for the JVM targets. Using the `disambiguationClassifier` for this
purpose is more consistent with other usages of
`disambiguationClassifier`.
The target name for all existing single-platform plugins will be just
'kotlin'.
Ensure that custom target and compilation attributes are copied to
relevant configurations of Android targets as well, which did not happen
because of Android variants (and missing simple apiElements,
runtimeElements) and Android compilations being created late in the
project configuration.
Issue #KT-27714 Fixed
As Android variants are created after the project is evaluated,
the build script and plugins might have added some item handlers to the
domain object containers which are yet to be filled.
To ensure that those handlers see properly configured compilations and
their tasks, we need to add a compilations to the container only after
it has been properly configured.
Also, the `forEachVariant` handler is already executed in
`afterEvaluate`, and there seems to be no need to wrap our
code working with variants in `afterEvaluate`.
Issue #KT-29964 Fixed
Inner class constructors should use the argument instead of reading
outer `this` from a field because if such an access happens before a
delegating constructor call, e.g. when evaluating an argument, a JVM
bytecode validation error will be thrown. (The only operation on `this`
allowed before a delegating constructor call is SETFIELD, and only if
the field in question is declared in the same class.)
Previously we showed list of all deprecated APIs even if a user uses
only one of them. This patch changes the behaviour and shows only
APIs really used by the user. An approach similar to the one used by
SingleWarningPerBuild in applied here.
Issue #KT-29998 Fixed
This is a preparation step for JS-IR CLI:
- CompiledModule was overused. Split it into KlibModuleRef and TranslationResult
- Deserialize klib dependencies from klibs itself