Commit Graph

13917 Commits

Author SHA1 Message Date
Ilya Goncharov 376d27dc6a [Gradle, Wasm] Fix proxy for karma wasm tests on windows
^KT-62128 fixed
2023-10-12 09:27:34 +00:00
Artem Daugel-Dauge c19fc3ced3 [Gradle] Fix some macOS Gradle IT 2023-10-10 10:57:08 +00:00
Ilya Goncharov ed247a3892 [JS] Remove kotlin-archetype-js
^KT-54868 fixed
2023-10-10 09:16:14 +00:00
Dmitrii Krasnov 9bda7571fd [Gradle IT] Removed old configuration for K/N IT
#KT-51553 Fixed
2023-10-10 09:10:14 +00:00
Alexander Udalov 9164b7d405 K2 kapt: remove reference to "kapt 4" from the warning
#KT-62438 Fixed
2023-10-09 16:08:45 +00:00
Alexander.Likhachev afdd8466cc [Gradle] Introduce KotlinBuildStatsServicesRegistry to manage FUS services
KT-57371 introduced a legacy JMX service without proper management.
#KT-62318 Fixed
2023-10-09 13:44:29 +00:00
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 6d5b1f84f9 KT-62004 Publish kotlin-dom-api-compat only for JS IR consumers 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
Mahdi Hosseinzadeh d803e0e31c Fix a grammatical issue in String::isNotBlank docs
"except of ..." is wrong.
Instead, it should be either of the following:
  - "except ..."
  - "except for ..."
  - "with the exception of ..."

See https://www.merriam-webster.com/dictionary/except%20for
and https://ell.stackexchange.com/q/148197
2023-10-05 03:56:05 +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
Alexander.Likhachev a2b688eb31 [Build] Preserve original jar with unshaded postfix in subplugin example
Otherwise we have two tasks writing output to the same file. That behavior confuses Gradle.
2023-10-02 18:02:47 +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
Filipp Zhinkin e803977924 KT-58588 Optimize Sequence::flatten
Rewrite FlatteningSequence to use
the same optimization technique as AbstractIterator.
Didn't extend AbstractIterator as storing and reloading a value
from a field is slightly slower compared to the implemented approach.
2023-10-02 08:03:13 +00:00
Filipp Zhinkin 7ca506870a KT-58588 Optimize Sequence::distinct
Use integer constants instead of enum to track AbstractIterator's state:
- for switches with a few cases, integer constants are
faster as there's no need to load ordinal value from
enum and map it into tableswitch index;
- on JVM, JIT-compiler can optimize away state-tracking code if it uses
integer constants, but when it comes to enums and tableswitches,
it can't apply a same set of optimizations to it.
2023-10-02 08:03:13 +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
Ilya Chernikov 141333bdcd K2: Update extension receiver after checking in CheckExtensionReceiver
fixes receiver selection when the candidate has more that one possible
extension receiver
#KT-62129 fixed
2023-09-22 11:33: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
Mikhail Glukhikh a77b758efa LV 2.0: drop reporting FIR_COMPILED_CLASS and relevant stuff
#KT-62056 Fixed
Related to KT-59171, KT-61951
2023-09-21 11:14:09 +00:00
Bogdan Mukvich e705cd3dac SBOM for kotlin-dom-api-compat
^KTI-1243
2023-09-21 08:26:03 +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 Gorbunov 93b107000a [stdlib-mpp] Remove stdlib projects no longer included in build 2023-09-20 01:07:59 +00:00
Ilya Gorbunov 222f996d45 [stdlib-mpp] Cleanup kotlin.stdlib.mpp build flag (always true) 2023-09-20 01:07:59 +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 c3ab626c63 [Gradle] Enable K2 support for sample compiler plugin
^KT-61106 Verification Pending
2023-09-19 15:46:30 +00:00