Commit Graph

10019 Commits

Author SHA1 Message Date
Yahor Berdnikau 294b36e16f [Gradle] Repurpose 'kotlin.experimental.tryK2'
Now it sets +1 to default one language version. Property name was
updated to 'kotlin.experimental.tryNext'.

^KT-61975 Fixed
2023-11-21 11:58:45 +00:00
Yahor Berdnikau a20f21f76f [Gradle] Introduce 'kotlin.internal.compiler.arguments.log.level' property
This property allows changing log level for message printing the final
set of compiler arguments used to run compilation.

Possible levels are 'error', 'warning', 'info', 'debug'. Default level
is 'debug'.

^KT-60733 Fixed
2023-11-20 21:03:38 +00:00
Evgenii Mazhukin 5973951f71 [IC] Smoke tests for KMP IC, part 1
Assert reasonable compile avoidance when basic changes are made in a
multiplatform project

^Relates to KT-56963

Merge-request: KT-MR-13032
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-11-20 17:17:27 +00:00
Dmitriy Dolovov 6de0b3a645 [Gradle][MPP] Minor: Don't use @GradleTestVersions in the test
^KT-62515
2023-11-20 13:40:54 +00:00
Ilya Goncharov 94ce4c06a7 [Gradle, Wasm] Use separate hierarchical methods for JS and wasi
^KT-63417 fixed
2023-11-20 10:30:58 +00:00
Ilya Goncharov dcab981ee8 [Gradle, Wasm] Use static source sets accessors for wasm
^KT-62955 fixed
2023-11-20 10:30:16 +00:00
Artem Kobzar 1832f5a3f7 [K/JS] Introduce the ability to consume platform-specific cli arguments inside the main function ^KT-16981 Fixed 2023-11-18 11:01:34 +00:00
Kirill Rakhman 4964ee12a9 [CLI] Update CLI argument descriptions after review 2023-11-17 14:36:28 +00:00
Dmitriy Dolovov bc8841c6fe [Gradle][MPP] Don't save library dependency versions in KLIB manifest
^KT-62515
2023-11-17 13:49:29 +00:00
Yahor Berdnikau 3413b07550 [IC, Gradle] Remove 'kotlin.incremental.useClasspathSnapshot' system property
^KT-62962 Fixed
2023-11-17 11:34:19 +00:00
Ilya Goncharov 342c9e8c81 [Gradle, JS] Set compiler arg ir and produce-* unconditionally
^KT-63312 fixed
2023-11-17 10:25:21 +00:00
Anton Lakotka 980708e533 [Gradle] Check if host-specific metadata artifact exists for GMT
In gradle metadata transformations for CInterops in composite builds
it is possible that resolved artifact is not actually created.
For example if host machine is not MacOS but composite build has
projects with enabled Apple targets. So apple-specific tasks will be
disabled but still configured and during dependency resolution
its outputs will be provided in artifact view.

We have already checked for cases when there is no resolved artifact.
But apparently it is not enough, and it is important to check that file
exists physically.

^KT-63197 Verification Pending
2023-11-17 08:00:40 +00:00
Anton Lakotka 9fc7d3693e [Gradle] Test composite build import with enabled CInterop commonization
On non-mac machines. With projects that have enabled MacOS targets.

In this scenario we don't want to ruin IDE UX for users that just
want to use IDE and work with project parts that is not related to apple

^KT-63197
2023-11-17 08:00:40 +00:00
Alexander.Likhachev 6fbd26905a [Gradle] Add Gradle 8.2+ plugin variant
Fixups KT-52976 as the intention was to remove conventions registration. However until this commit, `gradle81` variant was used for all the 8.1+ versions providing an implementation that registers conventions.
^KT-63499 Fixed
2023-11-16 16:59:02 +00:00
Alexander.Likhachev 965b6b544d [Gradle] Add integration test for KT-63499 2023-11-16 16:59:02 +00:00
Ilya Chernikov 6877fa8e42 Scripting: remove obsolete script-util module
#KT-58367 fixed
2023-11-16 15:46:08 +00:00
Nataliya.Valtman c332e1beb5 Remove BuildStatsService.applyIfInitialized outside BuildFlowService
#KT-58768 In Progress
2023-11-16 15:22:01 +00:00
Yahor Berdnikau 55f6614b66 [Gradle] Increase max Kotlin daemon heap size to 2g for all kapt tests
Apparently, they all require more than 1g of heap size to run kapt.
2023-11-16 08:01:33 +00:00
Alexander.Likhachev 11e0edc124 [Gradle, K/N] Remove the enableEndorsedLibs flag
This is the last stage of the flag's deprecation cycle.
^KT-56455 Fixed
2023-11-15 17:01:40 +00:00
Yahor Berdnikau 580c2a490d [Gradle] Apply attribute disambiguation rules conditionally
Not all Kotlin disambiguation rules are required for non-MPP projects.
On the other hand, they lead to increased memory consumption in Gradle
daemon especially notable on big multimodule projects.

To address this memory increase, we start to apply these rules
conditionally based on the applied plugin.

^KT-63005 Fixed
2023-11-15 11:18:41 +00:00
Yahor Berdnikau 6eca282e9a [Gradle] Bump minimal supported AGP version to 7.1.3
^KT-62939 Fixed
2023-11-15 10:31:03 +00:00
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
Ilya Gorbunov 5e61cb5098 [stdlib-docs] Fix JS stdlib source paths in API docs builds 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 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