Commit Graph

6624 Commits

Author SHA1 Message Date
Sergey Igushkin eddf8c9e72 KT-50736: Fix the implementation of whenEvaluated
Re-implement `whenEvaluated` using a constant number of calls to
`withPlugin` per project.

The approach with `plugins.all { ... }` introduced by the fix
of KT-50509 had an issue with Android plugins applied last in the build:
in those cases that implementation didn't dispatch the actions after
Android and instead fired them earlier in `afterEvaluate`, because
`hasPlugin` doesn't return true in the callback when that exact plugin
is applied.

This change preserves the performance similar to that of the previous
implementation.

Issue #KT-50736

Merge-request: KT-MR-5418
2022-01-12 13:13:56 +00:00
Sergey Igushkin 3ac472ceb3 Fix Android unit test tasks not running in allTests
The Android unit test tasks were not created by the Kotlin Gradle
plugin, so the plugin didn't add the
tadk dependencies to its aggregating
`allTests` task.

Issue #KT-38456
Issue #KT-44227
2022-01-11 22:15:14 +00:00
Hung Nguyen 8d298bd25c Fixed possible hanging of metrics collection in KGP
#KT-50719 Fixed
2022-01-11 19:15:42 +03:00
sebastian.sellmair 6c55e8cc58 [Gradle] GradleKotlinCompilerRunner: Be lenient to isolated classpaths
^KT-50592
2022-01-11 08:34:04 +00:00
sebastian.sellmair 56fa2655b7 [Gradle] Fixup testDetectingDifferentClassLoaders in respect of ^KT-50592 and KT-50598 2022-01-11 08:34:03 +00:00
sebastian.sellmair b1bb68c10f [Gradle] testProject/AndroidProject: Ensure non-isolated classpaths
^KT-50592
2022-01-11 08:34:03 +00:00
sebastian.sellmair 0b981a54bc [Gradle] NativeDistributionCommonizerTask: Use safe project extension
... to access `KotlinMultiplatformExtension` on subprojects.
This will prevent strange ClassCastExceptions and show users
a proper error message when the operation fails because of isolated
classpaths.

This will also be lenient if the isoalted Kotlin plugin is not
a multiplatform plugin.

^KT-50592 Verification Pending
2022-01-11 08:34:02 +00:00
sebastian.sellmair a355fefd05 [Gradle] KotlinProjectExtension: use castIsolatedKotlinPluginClassLoaderAware
Using this special cast function for accessing any Kotlin extension
will ensure that an isolated classpath will be reported to the user
when the casting fails because of it.

^KT-50592 WIP
2022-01-11 08:34:02 +00:00
sebastian.sellmair 32177b2cd2 [Gradle] Implement commonizer test with isolated jvm subproject
^KT-50592
2022-01-11 08:34:02 +00:00
Igor Yakovlev e58d4163ad [WASM] Add std methods for collections 2022-01-05 13:12:32 +01:00
Igor Yakovlev c9a92d71ae [WASM] Add kotlin.math tests 2022-01-05 13:12:32 +01:00
Ilya Gorbunov 2954769296 KT-50059 Stop publishing artifacts with 'modular' classifier 2021-12-29 17:43:56 +00:00
sebastian.sellmair 353593fa77 [MPP] Add documentation to .configureTaskOrder() 2021-12-28 21:15:20 +00:00
sebastian.sellmair f9c70758a2 [MPP] Add CInteropMetadataDependencyTransformationTaskTest 2021-12-28 21:15:19 +00:00
sebastian.sellmair 2e1fc15a9a [MPP] Only enable cinterop metadata transformation when cinterop commonization is enabled
Both library author and consumer need to enable cinterop commonization
in order to support libraries with commonized cinterops
in their API surface.
2021-12-28 21:15:19 +00:00
sebastian.sellmair 4d5446a174 [MPP] CInteropMetadataDependencyTransformationTask: Replace mutex
Replace previous 'mutex' output file in favour of proper
task ordering and task enabling.
2021-12-28 21:15:19 +00:00
sebastian.sellmair 146099e92e [MPP] Don't check commonizer classpath for UP-TO-DATE mechanism
Using a different commonizer classpath is a very uncommon practice.
Checking the classpath for Gradle's UP-TO-DATE mechanism is
already misleading, because we are relying on a custom UP-TO-DATE
implementation that will not include this classpath anyway.

Removing this input is intended to improve commonizer startup time.
2021-12-28 21:15:18 +00:00
Alexander Udalov 9a9a8f1999 Restore support of language version 1.3
#KT-50251 Fixed

(cherry picked from commit a0004ed03adc9f50f26c8b11d178afcc2abf2a9c)
2021-12-28 13:21:18 +01:00
Alexander Likhachev 5097d426c1 [Gradle] Mark MetricsWriter with Serializable interface
#KT-50549 Fixed
2021-12-28 12:05:09 +00:00
Alexander Likhachev 426faf4ca6 [Gradle] Add test for KT-50549 2021-12-28 12:05:08 +00:00
Sergey Igushkin cb9dfc8e01 KT-50509: Optimize the performance of whenEvaluated { ... } wrapper
The Gradle API `pluginManager.withPlugin(id) { ... }` turned out to have
a significant performance footprint due to operations on underlying
immutable collections.

We can replace calls to `withPlugin` with checks of `hasPlugin` running
on each applied plugin.

Issue #KT-50509 Verification pending
2021-12-28 10:09:42 +00:00
Yahor Berdnikau f895e92b11 Bump Gradle 7.3 version to 7.3.3
^KT-45745 In Progress
2021-12-27 15:19:19 +01:00
Yahor Berdnikau 3fca808b63 Revert "Revert "Set minimal supported Gradle version to 6.7.1.""
This reverts commit 2aa1c187d9.

^KT-49733 Fixed
2021-12-27 15:19:15 +01:00
Hung Nguyen a900f2b66d KT-45777: Reorganize unit test data for classpath snapshot feature
to make it easier to add more tests in the next commits.

- Add unit tests for constants and inline functions

Also add tests for different kinds of Kotlin classes: CLASS,
FILE_FACADE, MULTIFILE_CLASS.

-Add unit test for nested classes

Also remove the existing integration test for nested classes to keep the
integration tests focused on the key scenarios while unit tests will
cover the corner cases.

Ignore inline functions that are private
2021-12-24 18:31:49 +03:00
Yahor Berdnikau 8bdb19a11e Deprecate 'kotlin.coroutines' property and extension
Deprecation 'kotlin.coroutines' property and related
'kotlin.experimental.coroutines' extension DSL. These properties
are not doing anything since 1.5.0 release and has to be removed long
time ago.

^KT-50369 Fixed
2021-12-24 11:55:56 +00:00
Yahor Berdnikau 6c02ef0a44 Provide Android SDK with accepted licenses
For benchmarks using Android provide Android SDK via environment.

^KT-49921 In Progress
2021-12-23 11:03:13 +01:00
Yahor Berdnikau 10a1d2ca1d Pass current Kotlin version to benchmark script
Allows using different current Kotlin versions in benchmark.
For example, SNAPSHOT version when current branch is master and
dev version on CI build.

^KT-49921 In Progress
2021-12-23 10:00:23 +01:00
Mikhael Bogdanov f5da166d7c Switch -jvm-target default to null 2021-12-23 07:25:59 +00:00
konstantin.tskhovrebov e955fa429b Add groovy friendly DSL for kotlin artifacts. 2021-12-23 01:04:37 +03:00
Alexander Udalov 7771e5914d Revert "Do not write version requirements for suspend functions"
This reverts commit 6807ed6642.

The reason is that Kotlin compilers until and including version 1.6.10
have code that detects obsolete coroutines via these version
requirements (see `versionAndReleaseCoroutinesMismatch`). Since Kotlin
1.6.10 can read metadata of version 1.7, the earliest we can drop these
version requirements is Kotlin 1.8.0.
2021-12-21 20:06:07 +01:00
konstantin.tskhovrebov 2d0fea4dcb Set right FatFramework name inside XCFramework. 2021-12-21 18:04:49 +03:00
Yahor Berdnikau 8d195e079e Add basic benchmarks for Duckduckgo Android application
^KT-49921 In Progress
2021-12-21 14:00:57 +00:00
Yahor Berdnikau d1f6faf236 Add Gradle project to run regression benchmarks
This project will contain all required Gradle infrastructure to run
regression benchmark scripts.

^KT-49921 In Progress
2021-12-21 14:00:57 +00:00
Yahor Berdnikau 7418d3c898 Add build regression benchmark script template
This template provides all infrastructure to write Kotlin scripts for
build regression benchmarks. These benchmarks will use gradle-profiler
to run provided scenarios on user projects. All benchmark results
in the script then will be aggregated into single one showing
difference between them.

Generally such kind of benchmarks should be used to track early Gradle
 build regressions between releases.

^KT-49921 In Progress
2021-12-21 14:00:56 +00:00
Joseph Walton f38e1b218d Scripting, maven: use getArtifacts to get the plugin's runtime classpath
..to correctly pass the dependencies in the ExecuteKotlinScriptMojo.
#KT-50306 fixed

Also add a test that a script has access to plugin-configured
dependencies.
If plugin/dependencies is populated, the extra artifacts should be
made available when the script is run. This test uses 'junit' simply
because it's commonly-used, but not already present, or shaded as part
of another artifact.
2021-12-20 18:02:16 +03:00
nataliya.valtman 9c0ea11c1b Try to figure out which metric collection cause timeout exception 2021-12-17 21:39:23 +03:00
nataliya.valtman 999d2051ac Add listener's metrics 2021-12-17 17:38:55 +00:00
konstantin.tskhovrebov 8423374343 Fix gradle task name clash for Xcode framework tasks. 2021-12-17 15:07:07 +03:00
Rick Clephas 2c8086bbfe Preserve symlinks during framework copy 2021-12-17 15:07:06 +03:00
Dmitry Savvinov 46ab972cb1 Exclude common parts of kotlin-test from platform source sets
See details in linked issue. Tests are on the intellij-side

^KT-47570 Fixed
2021-12-17 15:04:51 +03:00
nataliya.valtman 9e4f3e3848 KT-41689: Support statistics for Configuration Cache
#KT-41689 Fixed
2021-12-16 19:20:04 +00:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Alexander Udalov 6807ed6642 Do not write version requirements for suspend functions
Coroutines are a stable feature since 1.3. Version requirement on
suspend functions, or functions mentioning suspend function types in the
signature, was needed to prevent older compilers from reading metadata
that they can't properly use. It's not needed anymore because a newer
metadata version prevents older compilers from reading any metadata
altogether.

Also, computing isSuspendOrHasSuspendTypesInSignature took ~0.5% of
backend time on compilation of intellij (related to KT-48233).
2021-12-15 22:27:51 +01:00
Nikolay Krasko a74c68c70a Regenerate gradle options 2021-12-15 19:18:53 +03:00
Ilya Goncharov db9640c3b3 [Gradle, JS] Add gradle property for per-module/whole-program
Merge-request: KT-MR-5200
2021-12-15 09:08:45 +00:00
konstantin.tskhovrebov 2bb155edc1 KT-50159 Check that all inner frameworks in XCFramework have same names
And warn if XCFramework has different name with inner frameworks.

#KT-50159 Fixed
2021-12-14 14:47:42 +03:00
Yahor Berdnikau 1c8a1e656e Add function to make a snapshot of current test project
This will allow checking current state of test project and try
to work with it directly.

^KT-45745 In Progress
2021-12-14 12:45:51 +01:00
Ilya Chernikov ec2d6ea5f1 Restore script testing on both backends, fix some tests 2021-12-14 13:39:19 +03:00
Hung Nguyen 586fa8af64 KT-45777: Shrink classpath snapshot incrementally
Currently, we shrink classpath snapshots at 2 steps:
  - Classpath diffing: Shrink the current classpath snapshot against
    the previous lookup symbols
  - Classpath snapshot saving: Shrink the current classpath snapshot
    against the current lookup symbols

With this commit, the shrinking at the second step is now incremental.
The shrinking at the first step is still non-incremental.
2021-12-14 13:10:08 +03:00