Commit Graph

109329 Commits

Author SHA1 Message Date
Anton Lakotka bd84f93333 [Gradle, Test] makeSnapshotTo should fail when called in TC env
Developers (me) often forget to remove calls to this debugging
utility. Usually this changes is visible during Code Review but we
shouldn't rely on a sharp eye of a human. It is better to automatically
check it during remote run execution.
2024-02-19 10:42:46 +00:00
Anton Lakotka cd8843289b [Gradle, Test] Make utility isTeamCityRun as top-level function 2024-02-19 10:42:46 +00:00
Artem Kobzar 0d2c68664d [JS Plain Objects] Add README to the compiler plugin 2024-02-19 10:32:16 +00:00
Ilya Goncharov abb5f55087 [Wasm] Use static import for wasm imports
^KT-65777 fixed
2024-02-19 10:01:10 +00:00
Dmitrii Gridin 68e5fc7344 [LL FIR] LLFirLazyResolver: drop LLFirLockProvider parameter
It can be inferred from `LLFirResolveTarget` inside
`LLFirTargetResolver`
2024-02-19 09:41:22 +00:00
Dmitrii Gridin efeffb45b7 [LL FIR] LLFirLazyResolver: drop ScopeSession parameter
It can be inferred from `LLFirResolveTarget` inside
`LLFirTargetResolver`
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 7d672cd474 [LL FIR] drop ScopeSession parameter from LLFirModuleLazyDeclarationResolver
This parameter was required for on-air analysis
to avoid garbage in the original scope session.
Now we can drop it, and it will be less error-prone
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 80b698ce32 [FIR] drop obsolete FirResolveContextCollector
This interface is unused
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 2e17d8d524 [LL FIR] FileStructureElementDiagnosticRetriever: deduplicate code 2024-02-19 09:41:22 +00:00
Dmitrii Gridin 3f31bdb877 [LL FIR] merge DeclarationBaseStructureElement into FileStructureElement
To simplify the implementation
2024-02-19 09:41:22 +00:00
Dmitrii Gridin a9f7c153d2 [LL FIR] rename LLFirResolveMultiDesignationCollector to LLFirResolveDesignationCollector
As it is not "multi" after 77c850f0d0
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 0ecb174720 [LL FIR] LLFirLazyResolver: deduplicate code 2024-02-19 09:41:22 +00:00
Dmitrii Gridin 84f3cc9f9c [Analysis API] drop obsolete code 2024-02-19 09:38:18 +00:00
Dmitriy Dolovov 1c3633c9f2 [Native][tests] Use new KLIB tool entry point for running tests
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 215303606b [KLIB tool] Entry point for tests: org.jetbrains.kotlin.cli.klib.Main.exec
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 16a27c2e05 [KLIB tool] Split KlibToolCommand into multiple individual commands
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 358ad272f4 [KLIB tool] Extract class KlibToolCommand from main.kt
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 9878c1fa16 [KLIB tool] Introduce KlibToolOutput for capturing stdout and errors/warnings
With `KlibToolOutput` it's possible to forward the output of each
KLIB tool's command to either system stdout/stderr streams or to
some buffers which then can be read by tests.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 5b7c11ae39 [KLIB tool] Introduce a '-test-mode' CLI option
This is an option that allows running the commands that support it
in a special "test mode". The "test mode" means (but not limited to)
that a command may, for example, sort the output which is unsorted
by default, and this way guarantee stable output. This is essentially
helpful for tests, which rely on the command output.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 82115c1f26 [KLIB tool] Drop unused blind flag in "remove" command
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 77b574bd0d [KLIB tool] Rename class Library -> class KlibToolCommand
Also, make it use `KlibToolArguments` instead of separate isolated
arguments passed via constructor or via individual command calls.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 7aa106c3a0 [KLIB tool] Extract self-sufficient classes from main.kt to separate files
Classes extracted:
- KlibToolArguments
- KlibToolArgumentsParser
- KlibToolLogger
- KlibToolIrLinker

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 4fe8885376 [KLIB tool] Split KlibToolArguments to arguments & arguments parser
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 02ab472f0b [KLIB tool] Rename: class Command -> class KlibToolArguments
This way it would better reflect its purpose.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 921a787815 [KLIB tool] Move all CLI-related logic to the Command class
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov d4585ff3ce [KLIB tool] Refactoring. Fix visibility, add comments, drop useless code
What's done:
- Reduce the visibility of all entities inside the module to `internal`
  or `private`. Only leave `fun main()` as `public` because it's the
  single legal entry point.
- Add comments to few classes related to "contents" command that they
  should be removed together with the command after 2.0.
- Drop useless `DeclarationHeaderRenderer` interface.
- Rename: KlibToolLinker -> KlibToolIrLinker

^KT-62340
2024-02-19 09:36:10 +00:00
Anastasia.Nekrasova fd4f6c90c7 [K/N][K2] K2 behavioral difference with inconsistent inheritance of ObjCName
Support for complex cases with multiple substitution overrides.

#KT-64276 Fixed
2024-02-19 09:29:43 +00:00
Anastasia.Nekrasova d69240a2d5 [FIR] Fixed behavior of FirAnnotation.findArgumentByName for resolved annotations
The 'findArgumentByName' function was returning an invalid result for
annotation arguments with omitted argument name.

#KT-64276
2024-02-19 09:29:43 +00:00
Anastasia.Nekrasova bb8c7dd04c [K/N][K2] K2 behavioral difference with inconsistent inheritance of ObjCName
When a declaration with an ObjC annotation is stored in a different
module, the annotation arguments are not resolved by default. This leads
to a bug in the checker. Before attempting to find the objCName, it is
necessary to resolve the annotation first.

#KT-64276
2024-02-19 09:29:43 +00:00
Timofey Solonin 700432e111 Add a closure function to return a graph in explicit bfs order
^KT-65540
2024-02-19 09:28:08 +00:00
Ilya Goncharov 87fdf8e764 [Gradle, Wasm] Binaryen by default for production main binary
^KT-64553 fixed
2024-02-19 09:06:44 +00:00
vladislav.grechko 3dda88ddc2 [FIR] Handle FirErrorExpression when resolving arguments
^KT-65787: Fixed
2024-02-19 08:50:59 +00:00
Anton Lakotka 7a150cce47 [Gradle] Introduce defaultFragmentName for K2 MPP Structure
It is possible to add source files to task directly. Especially this is
a very popular case for Android integration. Android variants can
contain any number of extra-source files that should be compiled
together with other android-specific sources.
Android specific sources that come from Android source sets already
compiled together as part of "main" fragment (KT-62508).
With this change this logic is extended to any extra sources
that are added directly to the compile task.

^KT-62508 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka 020bb72d2b [Gradle] Associate Android java sources with related Kotlin Source Set
Java sources can be produced by the task or can be configured with
task dependencies. Previously sources were included into task directly
now they are properly configured with Kotlin Android Source Set.

^KT-63753 Verification Pending
^KT-65426 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka b5ed2326e7 [Gradle] Merge Android Source Sets into one K2 Fragment
Android projects has a number of build type/flavor specific source set.
These source sets are included into compilation of multiple variants.
In Android compilation model they should be compiled together and they
should see each-others declarations. With Kotlin MPP plugin applied
these android source sets gets associated with Kotlin Source Sets
counter parts. However in Kotlin Multiplatform Source sets have
a semantics about "expect/actual" refinement and with K2 it also got
stricter and visibility is checked. This is not compatible with Android
compilation model thus the solution is to merge Android Source Sets
into one K2 Fragment.

^KT-62508 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka 0a86f03457 [Gradle] Don't pass -Xfragment-sources for non-mpp compilations
It is unnecessary and confusing.

^KT-65768 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka fabf75f4e2 [Gradle] Pass Android-related sources to KotlinSourceSet instead task
Setting sources through compile task is not compatible with
Multiplatform K2 because for such sources no K2 Fragment relations
will be set and compilation will fail.

^KT-63753 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka b13b27a715 [Gradle] Migrate new-mpp-android from Groovy to Kotlin Script 2024-02-18 16:42:19 +00:00
Pavel Mikhailovskii 20bb6b0ea8 [KAPT] KT-64391 Make sure that all K2 KAPT tests really run with K2
Merge-request: KT-MR-14346
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-16 19:27:46 +00:00
Mark Mann 00ef313df2 [K/N] Add binary option to produce error on mangled objc names (#5264)
objcExportErrorOnNameCollisions=true binary option makes the compiler
emit an error whenever it mangles a name emitted by ObjCExport.

^KT-65863 Fixed
2024-02-16 18:17:30 +00:00
Yahor Berdnikau 0f8a416496 [Gradle] Migrate MppHighlightingTestDataWithGradleIT to new test DSL
^KT-65528 In Progress
2024-02-16 18:16:41 +00:00
Yahor Berdnikau a40459c520 [Gradle] Bump max Gradle version in tests to 8.5
^KT-62540 Verification Pending
2024-02-16 16:47:16 +00:00
eugene.levenetc 8f2fc3d1e2 [ObjCExport] Fix property setter
KT-64953: Required part for enum translation
2024-02-16 16:32:22 +00:00
Pavel Kunyavskiy 576851e514 [Tests] Update testdata after bad rebase 2024-02-16 15:37:28 +00:00
eugene.levenetc 97f585dd25 [ObjCExport] Add companion object translation
KT-64953: Required part for enum translation
2024-02-16 13:58:03 +00:00
Dmitriy Novozhilov acf2296590 [Test] Regenerate tests after two previous commits 2024-02-16 12:48:24 +00:00
Dmitriy Novozhilov d9beae0556 [Test] Change indent from four to two spaces in generated tests
This is needed to reduce the size of generated test files, which started
  to exceed default IDE limit
2024-02-16 12:48:24 +00:00
Dmitriy Novozhilov 9b5a9ccba8 [Test] Don't generate throws Exception on methods of generated tests
This is needed to reduce the size of generated test files, which started
 to exceed default IDE limit
Also update some (mostly old) test utilities to remove exceptions from
 java signatures
2024-02-16 12:48:24 +00:00
Nataliya.Valtman 7ad371b215 Fix ConcurrencyModification exception in KotlinBuildStatsBeanService
#KT-65825 Fixed
2024-02-16 11:43:52 +00:00
Mark Mann ec12637d7a [K/N][K2] INCOMPATIBLE_OBJC_NAME_OVERRIDE error message changed from K1
There's been a change in the error message for
INCOMPATIBLE_OBJC_NAME_OVERRIDE in K2 which makes it much more difficult
to diagnose the underlying issue. Previously in K1 the symbol that had
an incompatible objc name would be output, but in K2 only the class
declaration is output making it difficult to determine which member is
causing the error.

#KT-65572 Fixed
2024-02-16 11:20:54 +00:00