Added metrics and their anonymization rules added. Persisted gradle
statistical information will not contain any sensitive information.
#KT-33404 Fixed
The build performance information is collected during the build
when the Kotlin Gradle plugin is applied. Only hashed values are
saved if they may contain sensitive information. Numeric metrics
obtained on the basis of user's project are saved with random seed.
Persisted information is saved in gradleUserHomeDir.
#KT-33404 Fixed
We don't compile a klib if there are no sources for it (NO-SOURCE
checks). So, we need to take this fact into account and don't
pass such libraries to compiler in dependent modules. See also:
GH-2617 in the K/N repo.
This patch checks that a klib file exists before passing it to the
compiler.
This test is one of the most time-consuming tests because
it builds a lot of final native binaries. Moreover, it exists
in two versions: for Groovy DSL and for Kotlin DSL. The only
difference between these versions is build script DSL.
This patch disables project building for the Groovy DSL version to
reduce total test execution time. Now this test only checks that
project configuration is successful. But it's enough to detect DSL
problems.
Inline functions require Kotlin compiler at least 1.3.50 if they were
generated by the compiler with API version >= 1.4. This is because since
API version 1.4, we've changed the generation scheme of parameter
nullability assertions and they now refer to methods from the standard
library which did not exist until 1.4. See
JvmSerializerExtension.writeInlineParameterNullCheckRequirement.
Some properties were calculated based on yarn and nodeJs version. So,
when version is changed properties were not updated. This change moves
calculation to the end of configuration phase and adds assertion to
ensure that version and other poperties are not changed
after configuration was done.
We pass compiler flags using an arg file if the compiler is executed
in a separate process because Windows limits maximal command line
length (see https://github.com/JetBrains/kotlin-native/issues/1999).
But for the compiler daemon we pass the args directly to the compiler
entry point method. So we can abandon using an arg file here.
We use an argument file to pass arguments to the K/N compiler.
Earlier each line of such a file was treated by the compiler
as a separate argument. But this logic was updated some time
ago and now content for this file is treated as a space separated
list of arguments.
This patch takes this into account at the Gradle side and quotes
arguments written to the arg file.
Issue #KT-35934 Fixed
* In the Kotlin/JVM tasks, move the compiler arguments setup logic to
a separate class, so that it can be reused by the Kapt tasks without
directly referencing the Kotlin/JVM tasks
* In the Kapt tasks, carefully capture the values using the Provider API
so that the task can be serialized for Instant Execution and then
deserialized and executed without relying on the project model
Issue #KT-35181 Fixed
For users that have Gradle's build cache [1] enabled, make NodeJsSetupTask
and YarnSetupTask cacheable to avoid the distribution archives being
downloaded again if they have been downloaded before by other builds of
other projects that apply the Kotlin plugin.
[1] https://docs.gradle.org/current/userguide/build_cache.html