Commit Graph

14106 Commits

Author SHA1 Message Date
Yahor Berdnikau 59f544cb7c [Gradle, Kapt] Don't immediately check if kaptClasspath dependencies are empty
Now sub-plugins are applied to compilation before users `afterEvaluate`
closure execution, which could lead to unexpected by the user state.
For example, when a user adds dependencies to 'kaptClasspath' in
'afterEvaluate'.

This fix removes check in Kapt plugin if dependencies are present on
'kaptClasspath' and moves it into KaptTask.onlyIf spec. So the task
will still have SKIPPED state if there are no AP provided.

^KT-63366 Fixed
2023-11-15 08:42:28 +00:00
Anton Lakotka 951830fcef [Gradle] Use source set name for Cinterop configurations
This will ensure that source set have isolated Cinterop configurations.
With proper extendsFrom relations.
And prevent from dependencies i.e. from linuxMain to nativeMain if they
both have the same set of underlying targets.

^KT-63338 Verification Pending
2023-11-14 22:26:27 +00:00
Anton Lakotka 645d263474 [Gradle] Test that source set have own Cinterop configurations
It is necessary to prevent leaking dependencies in source set hierarchy
i.e. if linuxMain depends on some project with cinterops and
nativeMain also have the same set of underlying targets it is important
that nativeMain should not see any dependencies from linuxMain!

And vice versa, if linuxMain should see own + parents dependencies.

^KT-63338
2023-11-14 22:26:26 +00:00
Yahor Berdnikau 656b61b945 [Gradle] Restore writing errors into <project_dir>/.gradle directory
This is required for compatibility with older IDEA releases where it
expects errors only in <project_dir>/.gradle/kotlin/errors directory.

It is possible to disable such behaviour via
"kotlin.project.persistent.dir.gradle.disableWrite" property.

^KT-58223 Fixed
2023-11-14 18:38:12 +00:00
Yahor Berdnikau 070de9cc85 [Gradle] Split global and project persistent caches
Now for project persistent caches plugin will use '<rootDir>/.kotlin'
directory. Global persistent cache has stayed in the
'<user.home>/.kotlin' directory.

^KT-58223 Fixed
2023-11-14 18:38:12 +00:00
Yahor Berdnikau 5413973891 [Gradle] Add integration test checking 'kotlin.user.home' is possible to change
^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau e8a7c53dde [Gradle] Use for Gradle IT tests custom location for kotlin.user.home
Such way, we could easily clean all persistent storage produced by
test runs.

^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau 3d94679db4 [Gradle] Migrate errors collector to new persistent storage
^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau cf44bff164 [Gradle] Change property name to 'kotlin.user.home'
To be analogous to GRADLE_USER_HOME as they serve almost the same
purpose.

^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau ce695de84d [Gradle] Migrate metadata caches to new persistent location
^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Yahor Berdnikau 0d57436bce [Gradle] Introduce persistent storage dir in 'user.home/.kotlin'
This storage directory should be used for:
- files that should live between builds
- files that should stay after calling 'clean' task
- some persistent caches that are usually better to keep around

In this commit, we are introducing the first cache type - for session
flag files. Such files should be unique per-project. To distinguish
between different projects, md5 hash of the project root dir absolute
path is used.

^KT-58223 In Progress
2023-11-14 18:38:12 +00:00
Anton Lakotka 73c76c5b2d [Gradle] Add KOTLIN_PERSISTENT_GRADLE_DATA_DIR with .kotlin/ as default
Don't store data in `.gradle` as it treated specially by gradle i.e.
they are exclude this dir from UP-TO-DATE checks. This can lead into
broken IDE import state which is not fixable by re-importing.

Move CInterop Commonized libraries and Metadata Transformation results
to new KOTLIN_PERSISTENT_GRADLE_DATA_DIR to avoid IDE import issues.

^KT-58223
2023-11-14 18:38:12 +00:00
Ilya Goncharov 405a502675 [Gradle, Wasm] Tests can be up-to-date, and use by default chrome headless
^KT-62633 fixed
2023-11-14 17:58:42 +00:00
Yahor Berdnikau ea49a9a292 [Gradle] Limit max heap size for Kotlin daemon in integration tests
This change should further reduce memory pressure on running these tests
on CI agents.

Kapt4 tests require more Kotlin daemon memory than default 1g. It is
a known issue and eventually should be addressed by the compiler team.
2023-11-14 15:40:38 +00:00
Nataliya.Valtman 6210da0c98 Ignore ConcurrencyModificationExceptions at project.tasks.names
#KT-62131: Fixed
2023-11-14 14:39:11 +00:00
Artem Daugel-Dauge 4df73551c7 [Gradle] Don't depend on generated podspec in synthetic podInstall task
^KT-63331 Verification Pending
2023-11-14 14:30:43 +00:00
Abduqodiri Qurbonzoda a3f5db566c Remove KDoc for K/N ArrayList primary constructor
The documentation is provided for ArrayList class but describes its
primary constructor. Thus, in documentation website it appears
as ArrayList documentation. When no KDoc is provided, website generator
takes it from other platforms.
2023-11-14 09:47:25 +00:00
Troels Bjerre Lund 5a8faa8775 Align ListBuilder with native ArrayList
Furthermore, add test for ListBuilder.subList detection of concurrent
modification, and fix error in ListBuilder and ArrayList.

Fix KT-62346
2023-11-14 09:47:25 +00:00
Troels Bjerre Lund d62dbbb1bd Simplify K/N ArrayList
This commit specializes the existing Kotlin/Native stdlib ArrayList into
two subclasses:
 * ArrayList
 * ArraySubList
This avoids repeatedly checking whether a basic ArrayList is created as a
sublist of another ArrayList.

In the iterators, checkForComodification is marked for inlining, since
this significantly improves iterations performance.

A number of benchmarks are added to the native ring benchmark suite, to
test whether the changed runtime type of ArrayList.subList(...) has an
impact.
2023-11-14 09:47:25 +00:00
Abduqodiri Qurbonzoda c30eb1c56a Stdlib buildscript error: file included in two modules #KT-63447
The error is reported only when K2 is enabled in stdlib


Merge-request: KT-MR-12930
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-11-13 22:52:50 +00:00
Ilya Gorbunov fc64e30829 [stdlib-js] Move jsTypeOf to a documentable source root and restore its kdoc 2023-11-13 20:06:27 +00:00
Ilya Gorbunov 27ed611e70 [stdlib] Minor cleanup of JS stdlib build
- Remove unused jsIrTarget variable
- Rename the directory with copied builtin sources
2023-11-13 19:21:08 +00:00
Ilya Gorbunov 5e61cb5098 [stdlib-docs] Fix JS stdlib source paths in API docs builds 2023-11-13 19:21:08 +00:00
Ilya Gorbunov c69f36a8be [stdlib-js] Move public API out of runtime helpers directory 2023-11-13 19:21:08 +00:00
Anton Lakotka f2ddae533e [Gradle] Create archive tasks for custom compilations
This change is needed for kotlin-test in order to support
correct project dependencies in kotlin.git repository.

^KT-62943 Verification Pending
2023-11-13 16:56:58 +00:00
Ilya Goncharov 87e81d8562 [Gradle, JS] Distribution is copy task, webpack targeting to separate directory
^KT-63040 fixed
2023-11-13 10:56:04 +00:00
Dmitriy Dolovov d65fc00578 [KLIB] Introduce isJsStdlib() and isWasmStdlib() checks for KLIBs 2023-11-11 13:33:06 +00:00
Ilya Chernikov 932b5bf8cd Scripting: avoid proguarding of slf4j libs in main-kts
slf4j libs are bundled unshadowed to main-kts jar to avoid annoying
slf4j stderr printout (slf4j is used in the maven dependencies resolver)
Exluding it from proguard processing solves problems with using it
directly from scripts.
#KT-60813 fixed
#KT-54819 fixed
2023-11-10 17:24:12 +00:00
Ilya Chernikov a47ee44e65 Scripting: refactor test infrastructure - add missing stderr handling 2023-11-10 17:24:12 +00:00
Ilya Chernikov e927ac5fc3 Scripting: ignore some diags if artefact is resolved
The failure diagnostics from resolvers are ignored now if followed
by a successful result from a following resolver.
#KT-63352 fixed
the commit is idirectly tested by the test MainKtsIT.testUseSlf4j
from the followin commit "Scripting: ignore some diags if artefact is
resolved", namely without these changes, additional two warnings are
reported in this test.
2023-11-10 17:24:12 +00:00
Alexander Shabalin fa9c620261 [K/N] Migrate some runtime/basic tests to new testing infra ^KT-61259 2023-11-10 15:51:05 +00:00
Ilya Gorbunov 9ccce52915 Clean up WasExperimental annotation from declarations with SinceKotlin<=1.4
Since it is not possible to use -api-version < 1.4, this annotation has no effect
2023-11-10 12:20:52 +00:00
Alexander.Likhachev defa0b955b [Gradle] Use kotlin-compiler-embeddable instead of kotlin-gradle-plugin-compiler-dependencies
^KT-62650 In Progress
2023-11-09 12:19:23 +00:00
Anton Lakotka fe87f41c39 [Gradle] Correct valueSourceProviderCompat
* rename it to valueSourceWithExecProviderCompat
* After Gradle 7.5 use provider.of

^KT-63044
2023-11-09 08:09:56 +00:00
Igor Yakovlev 38695ff14c Fix Wasm gradle plugin DSL invalid behaviour
Fixed #KT-63315
2023-11-08 18:48:33 +01:00
Yahor Berdnikau 224a46e438 [Gradle] Decrease in tests Gradle daemons idle timeout
Our Gradle integration tests could launch multiple Gradle daemons
with different versions and using different JDK versions. They are
stick around until the whole test finishes using necessary memory.

Especially this is a problem on our CI where OOM killer often tries
to kill actually needed daemon.

This commit decreases spawned Gradle Daemon idle timeout, so they
shut down itself much earlier than default timeout of 3 hours.
2023-11-08 17:10:26 +00:00
Anton Lakotka 5161b3b7d8 [Gradle] Replace TaskProvider.flatMap with map { it.get() }
flatMap doesn't support implicit task dependencies due to bug:
https://github.com/gradle/gradle/issues/25645

However `map { it.get() }` works.

^KT-63011 Verification Pending
2023-11-08 11:50:23 +00:00
Anton Lakotka 5aa8ecca9b [Gradle] Test that framework configurations task dependencies
^KT-63011
2023-11-08 11:50:23 +00:00
Abduqodiri Qurbonzoda 999b0f7099 Avoid allocating large buffers in File.writeText #KT-51058
Also fixes File.appendText and Path.write/appendText.


Merge-request: KT-MR-12804
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-11-08 11:18:56 +00:00
Ilya Gorbunov 48ce45e22f [stdlib] Fix outdated documentation in Kotlin-Java Duration conversions
Add tests for documentation statements
2023-11-07 16:25:06 +00:00
Sebastian Sellmair 5506384cc9 [Gradle] Remove unused KotlinTargetConfigurator.configurePlatformSpecificModel
KT-61634
2023-11-07 12:29:31 +00:00
Sebastian Sellmair b347ff2c53 [Gradle] Migrate KotlinNativeTargetConfigurator.warnAboutIncorrectDependencies to KotlinGradleProjectChecker
KT-61634
2023-11-07 12:29:31 +00:00
Sebastian Sellmair faecd7f772 [Gradle] Implement KotlinNativeTargetConfigurator.registerEmbedAndSignAppleFrameworkTasks as EP as side effects
KT-61634
2023-11-07 12:29:31 +00:00
Sebastian Sellmair 9b47c98ce9 [Gradle] Implement KotlinNativeTargetConfigurator.createCInteropTasks as EP based side effects
KT-61634
2023-11-07 12:29:31 +00:00
Sebastian Sellmair 8651d67aeb [Gradle] Implement ConfigureFrameworkExportSideEffect
KT-61634
2023-11-07 12:29:31 +00:00
Ilya Goncharov 3a6cdc83cf [Gradle, JS] Use KotlinJsIrCompilation with deprecated KotlinJsCompilation
^KT-41382 fixed
2023-11-07 08:48:50 +00:00
Nikita Bobko 4050285fef Drop unnecessary suppress from stdlib
^KT-62785 Fixed
Review: https://jetbrains.team/p/kt/reviews/12858/files
2023-11-06 19:00:35 +00:00
Dmitrii Krasnov f8507d5220 [Gradle, Native] Switched downloading k/n to from Maven Central in KGP
#KT-62907 Fixed
2023-11-06 16:50:43 +00:00
Yahor Berdnikau 570d9dbb19 [Gradle] Fix early buildDir capturing in kotlinTestRegistry
User may change build directory location in the script, and our
plugin should handle such situations correctly.

^KT-61295 Fixed
2023-11-06 14:42:52 +00:00
Anton Lakotka ebe0a84dee [Gradle] Fix GCC support for IOS specific Kotlin Native Test Tasks
^KT-63044 Verification Pending
2023-11-06 09:37:59 +00:00