10537 Commits

Author SHA1 Message Date
Alexander.Likhachev bb23602cb3 [Gradle] Do not hold a reference to Gradle objects in FUS services
Despite the FUS services are intended to be scoped to a build, the legacy compatibility service wasn't properly managed and that caused a significant memory leak together with changes in KT-59826.
#KT-62318 In Progress
2023-10-09 13:44:29 +00:00
Evgenii Mazhukin 203b7a4da3 [KGP] Treat friendPaths as non-incremental Input property
When friendPaths change, internal symbols from other modules become hidden
or visible. This might change which functions are called, which types
are returned, etc. So we should recompile the affected classes.

Gradle doesn't allow Input policy on FileCollection properties, so we
introduce friendPathsSet. It allows us to keep the ABI of BaseKotlinCompile
unchanged, detect non-incremental configuration changes on Gradle side,
and use normal incremental compilation for everything else.

^KT-61918 Fixed


Merge-request: KT-MR-12372
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-10-09 11:23:02 +00:00
Anton Lakotka d820ddc27d [Gradle] Mark "main" metadata compilation as non-klib in all cases
Metadata compilation with name "main" isn't used in Hierarchical
Multiplatform. It used to compile commonMain source set to legacy
metadata artifacts. With Hierarchical MPP common source sets start
to compile to klib metadata.
2023-10-06 15:39:05 +00:00
Anton Lakotka f01c8de216 [Gradle] Add multiplatformExtension.metadataTarget 2023-10-06 15:39:05 +00:00
Anton Lakotka 0230f809c4 [Gradle] Fix CME when subplugins create source sets
GranularMetadataTransformation.ProjectData is created for all projects
There was a chance when it is created too early before some projects
evaluation. And if that happened that these projects contained some
subplugins (for example KSP) that add more source sets. Then old
algorithm of collecting sourceSetsMetadataOutputs() would fail with
ConcurrentModificationException. For example in this scenario:

Lets assume we evaluate sourceSetsMetadataOutputs for project with
just one common source set: commonMain.
And therefore one metadata compilation whose default source set name is:
commonMain.
On top of that a subplugin applied to this project. This subplugin
creates additional source set for each metadata compilation.

Then with old algorithm following would happen:

* start iterating over sourceSets
* for `commonMain` source set await its Metadata Compilation
* * When Metadata Compilation gets configured at some point of time
 it will reach KotlinCommonSourceSetProcessor.doTargetSpecificProcessing
 method. Which will apply subplugins.
* * When subplugin is applied it adds a new Source Set to
  the sourceSets collections: CME is occurred!

Adding a source set in subplugins should be regulated
either allow it and fix related side effects OR deprecate it.

The current fix doesn't solve all potential issues with adding new
source sets from subplugins. It primarily focused on CME occurrence
for the case above.

^KT-62299 Verification Pending
2023-10-06 15:39:05 +00:00
Ilya Gorbunov 7bdcaff89a KT-61126 Change test expectations
Also improve failure diagnostics in test
2023-10-06 00:46:08 +00:00
Ilya Gorbunov 785d6858ea KT-62004 Drop legacy JS build of kotlin-stdlib
- preserve kotlin-stdlib-js.jar in dist and maven
- change packaging to klib in .pom
- fix manifest attributes of kotlin-stdlib-js
2023-10-06 00:46:08 +00:00
Ilya Gorbunov 2590e7f48b KT-62004 Add kotlin-test maven artifacts to BOM integration test 2023-10-06 00:46:08 +00:00
Ilya Gorbunov eb813b7837 KT-62004 Drop legacy JS build of kotlin-test 2023-10-06 00:46:08 +00:00
Artem Daugel-Dauge 62544ec9c8 [Gradle] Don't copy DSYM in embedAndSign task
^KT-62232 Verification Pending
2023-10-05 14:40:15 +00:00
Ilmir Usmanov e5aa737eaf Do not trim getType from com.intellij.lang.jvm.JvmParameter
Since K2 KAPT uses this API, absence of class bodies in classes
from the package leads to java.lang.NoSuchMethodError

 #KT-61879 Fixed
2023-10-04 17:15:05 +00:00
Sebastian Sellmair 1dad890652 [Gradle][KMP] Remove top level and target level compilerOptions APIs
as those experimental APIs have shown to negatively affect usages
of stable APIs (because of resolve confusion), whilst also
failing to address popular use cases.

KT-61636
KT-61355
KT-61368
2023-10-04 12:23:39 +00:00
Dmitry Savvinov 23dbe5ed3e [mpp, tests] Minor: fix incorrect testdata
It was missed on rr/CI because those tests run only on macs, and
currrently CI has some troubles with that
2023-10-03 15:55:37 +00:00
Ilya Goncharov 68b55181fe [Gradle, JS] Fix muted JS gradle integration tests 2023-10-03 12:40:27 +00:00
Sebastian Sellmair 750ae2c850 [Gradle][KMP] IdeJvmAndAndroidPlatformDependencyResolver: Do not filter ProjectDependencies
as this will result in losing transitive dependencies from said
project dependency.

KT-59020 is now fixed by detecting this case
before creating the 'IdeaKotlinUnresolvedBinaryDependency'

Caused by: KT-59020
^KT-62029 Verification Pending
2023-10-03 11:59:50 +00:00
Ilya Goncharov 7e52aa7b00 [Gradle, JS] Not depends on kotlin npm package 2023-10-03 10:40:21 +00:00
Nataliya.Valtman 5b7b159d64 Fix unstable TryK2IT.smokeTestForNativeTasks test
fix test fails with unexpected task execution order for Linux
2023-10-03 07:05:34 +00:00
Dmitrii Krasnov e63e4b17b7 [Gradle IT] Fixed regex for extracting task log on Windows
#KT-51553 Ready for Review
2023-10-02 20:28:55 +00:00
Dmitriy Dolovov 620c9434ca [Gradle] Use -Xmetadata-klib CLI arg to produce metadate KLIBs
The `-Xexpect-actual-linker` CLI argument is deprecated and replaced by
`-Xmetadata-klib` CLI argument.

^KT-61136
2023-10-02 16:21:17 +00:00
Alexander Korepanov 522952db1f [JS IR] Run diagnostics by IR before the klib serialization
Implement an infrastructure for checking IR before JS klib serialization.
Implement the EXPORTING_JS_NAME_CLASH and EXPORTING_JS_NAME_CLASH_ES checks.

^KT-61710 Fixed
2023-09-23 19:49:17 +02:00
Dmitrii Krasnov 93fcee7532 [Gradle] Muted NativeDownloadAndPlatformLibsNonParallelIT on Windows. 2023-09-23 06:26:11 +00:00
Dmitrii Krasnov 3074b50e86 Migrated GeneralNativeIT to junit 5 and gradle TestKit 2023-09-22 18:21:46 +00:00
Nataliya.Valtman e4fc375900 Fix unstable TryK2IT.smokeTestForNativeTasks test
fix test fails with unexpected task execution order


Merge-request: KT-MR-12327
Merged-by: Nataliya Valtman <Nataliya.Valtman@jetbrains.com>
2023-09-22 08:09:32 +00:00
Ilya Goncharov df95a8ed6e [Gradle, Wasm] Add run task for wasi
^KT-61973 fixed
2023-09-21 14:43:46 +00:00
Hung Nguyen 0d04b8783c [IC] Handle custom source set located outside project directory
To support build cache relocatability, we need to convert absolute paths
into relative paths before storing them in IC caches.

Before this commit, we computed relative paths based on the (root)
project directory and FAIL if some source files are located outside the
project directory.

With this commit, we will NOT FAIL in that case. This means relative
paths may start with "../". It's not "clean", but it can work.

Test: New test in BuildCacheRelocationIT
^KT-61852 Fixed
2023-09-21 14:39:52 +00:00
Sebastian Sellmair 9031deeacf [Commonizer] PropertyCommonizer: Support annotation commonization
^KT-62028 Verification Pending
2023-09-21 12:39:15 +00:00
Alexander.Likhachev 33df94d96e [Gradle] Fix mpp+kapt tests on Windows
Previously expected paths were defined with forward slash, however, on Windows the paths are transformed to use backslash.
2023-09-21 08:05:10 +00:00
Vladimir Sukharev c4221b0ec7 [MPP] Enable integration test "K2: Check native stdlib is not shadowed by commonMain stdlib metadata"
^KT-61645 Fixed


Merge-request: KT-MR-12243
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-21 06:57:58 +00:00
Dmitry Savvinov 0db4f464bb [gradle, kmp] Minor: add more info to deprecation message
Buildscripts that used `ios`-shortcut certainly used
`val iosMain by getting` as well, which will lead to Gradle exception
after migration. Mention in the diagnostic message that one should
replace `by getting` with static accessors

^KT-60734
2023-09-20 13:33:06 +00:00
Ilya Goncharov 24e8c9c90d [Gradle, Wasm] Add nodeJs setup task dependency to wasi test task
^KT-61971 fixed
2023-09-19 16:54:42 +00:00
Mikhail Glukhikh 02961b7712 LV 2.0: fix Native Gradle integration test data 2023-09-19 15:46:31 +00:00
Anton Lakotka 232bbda076 [Gradle] Disable Kapt4.testKt18799 for K2
Until KT-61845 is fixed

^KT-61845
^KT-61106 Verification Pending
2023-09-19 15:46:30 +00:00
Anton Lakotka 79778877c2 [Gradle] Add missing kotlin-compiler-args plugin for test
This will ensure that language version is set correctly.

^KT-61106 Verification Pending
2023-09-19 15:46:30 +00:00
Anton Lakotka 88f0acfc79 [Gradle] Fix CInterop test after migration to K2
^KT-61106 Verification Pending
2023-09-19 15:46:30 +00:00
Anton Lakotka e23801fdfc [Gradle] Add missing depends on relation in test data project
^KT-61106 Verification Pending
2023-09-19 15:46:30 +00:00
Mikhail Glukhikh 7c68e73816 LV 2.0: fix test data in HierarchicalMppIT.testProjectDependencies
This commit contains two kind of fixes:
1) K2 does not create entries for empty subpackages anymore,
so for the file with 'package foo.bar.baz' it creates an entry
only for the main package 'foo.bar.baz' and not for 'foo' or 'foo.bar'
2) K2 uses changed format of the classpath for third party common lib,
now it looks like other dependencies 'name-of-lib-<version>-commonMain'
instead of 'name-of-lib-metadata-<version>'
2023-09-19 15:46:30 +00:00
Anton Lakotka 58b0d6ffa8 [Gradle] Update MppHighlightingTestDataWithGradleIT for K2
^KT-61106 Verification Pending
2023-09-19 15:46:29 +00:00
Anton Lakotka c290a44f2b [Gradle] Update UnnamedTaskInputsIT to use correct MPP project
And fix incorrect code in hierarchical-mpp-multi-modules

^KT-61106 Verification Pending
2023-09-19 15:46:29 +00:00
Anton Lakotka 311b4c2deb [Gradle] Remove tests related to Legacy Metadata Compilation
it is no longer supported in k2

^KT-61817
^KT-61106 Verification Pending
2023-09-19 15:46:29 +00:00
Anton Lakotka 642c9e4261 [Gradle] Remove tests for legacy multiplatform plugin
Stdlib is already migrated, kotlin-test is on the way. In Kotlin 2.0
this should be removed completely.

^KT-61816
^KT-61106 Verification Pending
2023-09-19 15:46:29 +00:00
Anton Lakotka c7e4fa8654 [K2, Gradle, Test]: Remove check for languageVersion=2.0 in tests
Since Kotlin default version is already 2.0
then this check can be removed.

^KT-60860 Fixed
2023-09-19 15:46:28 +00:00
Ilya Chernikov a182c907bc Fix scripting testdata for changed diagnostics in K2 2023-09-19 15:46:28 +00:00
Ilya Chernikov beeae2772e LV20: fix / mute failing main-kts test 2023-09-19 15:46:28 +00:00
Ilya Chernikov 562ede4c7d LV20: Fix maven plugins test metadata 2023-09-19 15:46:28 +00:00
Aleksei.Cherepanov 39a0829f39 Fix Maven tests for K2
1) Update test data according to K2 compiler output
2) Finally switch logic of choosing compiler runner depends on language version instead of deprecated useK2 flag

#KT-60859 Fixed
2023-09-19 15:46:27 +00:00
Ilya Chernikov e3dae559d0 LV20: refactor K2 scripting tests - rename tasks 2023-09-19 15:46:27 +00:00
Mikhail Glukhikh e077be38f7 Migrate some Gradle tests to Kotlin 2.0 2023-09-19 15:46:27 +00:00
Mikhail Glukhikh 5fb38008b7 Switch Kotlin version to 2.0
#KT-59171 In Progress
2023-09-19 15:46:26 +00:00
Sebastian Sellmair 68ca571528 [Gradle] jvm+android: Add additional test for 'java only'
^KT-62033 Verification Pending
2023-09-19 15:31:57 +00:00
Sebastian Sellmair cb5026b528 [Gradle] jvm+android: Support source dependency resolution to jvm only project
^KT-62033 Verification Pending
2023-09-19 15:31:57 +00:00