Commit Graph

101469 Commits

Author SHA1 Message Date
Yahor Berdnikau 8c8f1718b9 [repo] KGP: more fine-grained AGP dependency
Removed unneeded transitive dependencies
2023-05-26 13:20:40 +00:00
Yahor Berdnikau e2801c366b [repo] KGP: remove compiler dependencies coming transitively 2023-05-26 13:20:40 +00:00
Yahor Berdnikau ec01e037f3 [repo] KGP: depend on :kotlin-compiler-runner-unshaded for compileOnly 2023-05-26 13:20:40 +00:00
Yahor Berdnikau 6ddc7ce23f [repo] KGP: remove kotlin-project-model dependency
It is coming transitively from KGP-api
2023-05-26 13:20:40 +00:00
Yahor Berdnikau 83a3e7f8a1 [repo] KGP: drop some android dependencies 2023-05-26 13:20:40 +00:00
Yahor Berdnikau 4ee0a97ddd [repo] KGP: drop guava dependency
It was unused.
2023-05-26 13:20:40 +00:00
Yahor Berdnikau f7e2b8b516 [repo] KGP: drop groovy-all dependency
Add ported from Groovy escapeJavaStyleString method into our
codebase.
2023-05-26 13:20:40 +00:00
Yahor Berdnikau 99dd2517c4 [repo] KGP: remove transitive dependencies coming from KGP-API 2023-05-26 13:20:40 +00:00
Yahor Berdnikau 2de4495711 [repo] migrate KGP to compiler options DSL 2023-05-26 13:20:40 +00:00
Andrei Klunnyi 3d1e5bb548 [KT-58817] Compiler defect workaround
Base method `RawFirBuilder.Visitor.convertElement` has a parameter with
default value, its overridden one in `VisitorWithReplacement` is not
allowed to declare default. So far so good.
During its work the compiler throws an exception:
`java.lang.IllegalArgumentException: No argument for parameter`.
2023-05-26 12:55:01 +00:00
Andrei Klunnyi 6535278bd3 [KT-58817] Implicit receiver for code completion
Prior to this commit code completion for .kts files was supported only
partially. Script has an implicit receiver - base class representing a
script itself, the point where its basic API resides. The knowledge of
this receiver was missing.

There are at least two context where this knowledge is crucial:
1. Code highlighting (worked fine)
2. Code completion (failed)

`FirScriptConfiguratorExtension` is responsible for filling
`FirScriptBuilder` with base script class (in addition to other
properties). See usages of [1] in its implementation.

The thing is that resolution during the completion works a bit
different. Instead of converting the entire `KtFile` it's interested
in `KtScript` only. See usages of [2].
`RawFirBuilder.Visitor.visitScript` is where implicit receivers were
missing.

Code completion and inspections applied to `.kts` files already have
`FirScript` and don't require its full reconstruction with expensive
`FirScriptConfiguratorExtension`. `RawFirBuilder.Visitor` was modified
to support sometimes already existing `FirElement`.

----------------------------------------------------------------
[1]: ScriptCompilationConfiguration.baseClass
[2]: RawFirBuilder.Visitor.convertScript
2023-05-26 12:55:01 +00:00
Andrei Klunnyi 2a1d4a42ae [KT-58817] Implicit import issues cannot be reported
To be reported with [1] imports require source. It was missing for
implicit script imports.

`FirScriptConfiguratorExtensionImpl` was extended and now adds fake
source elements (users don't see imports in the source code).

Since diagnostics for implicit import statements are meaningless for
IDE, they are suppressed in `LLFirDiagnosticReporter`.

----------------------------------------------------------------------
[1]: DiagnosticReporter.reportOn()
2023-05-26 12:55:00 +00:00
Andrei Klunnyi 28ff94533a [KT-58817] Add script-related extensions for FIR session
The following two registrars were missing:
- FirScriptingCompilerExtensionIdeRegistrar
- FirScriptingSamWithReceiverExtensionRegistrar

`FirScriptingCompilerExtensionIdeRegistrar` was introduced as a copy of
`FirScriptingCompilerExtensionRegistrar` adapted for usage from IDE.

`FirRegisteredPluginAnnotations` and `FirJvmTypeMapper` are mandatory at
`FirExtensionService.registerExtensions` and reported as missing at
runtime.
2023-05-26 12:55:00 +00:00
Andrei Klunnyi 1b8fd01969 [KT-58817] Star-imports are not handled
Default imports coming from script configuration can be of "star" type.
Prior to this commit they were effectively ignored due to a bug at FQN
assembly.

Before: org.gradle.dsl.* => org.gradle.dsl.
After: org.gradle.dsl.* => org.gradle.dsl
2023-05-26 12:55:00 +00:00
Andrei Klunnyi 6255efa7f7 [KT-58817] Publish K2 script compiler artifact
With this commit kotlin script compiler (as a plugin) becomes
available for IDE.
2023-05-26 12:55:00 +00:00
Troels Bjerre Lund 1ef3561caa [K/N] custom alloc: pre-fault OS pages ^KT-55364
On linux, some memory access patterns cause a cascade of page faults. By
asking mmap for MAP_POPULATE on linux, the page faults happen up front
in a much more efficient manner.


Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-697
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-05-26 12:44:36 +00:00
Kirill Rakhman 0ac02be534 [FIR] Generate annotations to data class copy method parameters
#KT-57003 Fixed
2023-05-26 11:29:13 +00:00
Mikhail Glukhikh 5ae3a93084 FE approximator conf: simplify typeVariable/HandleAsTypeVariable
Related to KT-58618
2023-05-26 11:13:39 +00:00
Mikhail Glukhikh 6e58ba8f33 FE: don't approximate type variable based types for public/local declarations
#KT-58618 Fixed
2023-05-26 11:13:39 +00:00
Mikhail Glukhikh 2cfa3d7e0d K2: reproduce KT-58618 2023-05-26 11:13:39 +00:00
Ilya Goncharov 666239c587 [Gradle, JS] Upgrade yarn.lock 2023-05-26 11:03:57 +00:00
Sergej Jaskiewicz 02180e8685 Factor out duplicated mangling logic for functions into the base class
^KT-57777 Fixed
^KT-57818 Fixed
2023-05-26 10:55:24 +00:00
Ilya Goncharov 8ae196d4fc [Gradle, Wasm] Add kotlin-stdlib-wasm to IDE deps 2023-05-26 09:07:07 +00:00
Nikolay Krasko 15825549a2 Auto provide JDK_21_0 env variable to relevant tests
KTI-1229
2023-05-26 09:05:54 +00:00
Alexander Shabalin 0457001a87 [K/N] Apply execution timeout to tests 2023-05-25 16:28:00 +00:00
Sergey Bogolepov 89be94f123 [K/N] Fix KT-58839
Do not export extensions of classes that are
hidden from the generated Objective-C API.

Merge-request: KT-MR-10330
Merged-by: Sergey Bogolepov <sergey.bogolepov@jetbrains.com>
2023-05-25 15:17:18 +00:00
Nikolay Lunyak c0ce37a271 [FIR] KT-58460: Report a return type mismatch diagnostic
^KT-58460 Fixed
2023-05-25 14:52:04 +00:00
Nikolay Lunyak ff61f70dd0 [FIR] KT-58460: Ensure the error is missing 2023-05-25 14:52:04 +00:00
Nataliya.Valtman 06ac8a10cd Use FlowParameter for buildFinish event
Support build scan report for Gradle 8.1

#KT-55740: Fixed
#KT-58251: Fixed
2023-05-25 14:24:16 +00:00
Troels Bjerre Lund 99e4ca65be [K/N] Fix GC stats reporting sweep in wrong epoch ^KT-55364
Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-696
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-05-25 12:48:30 +00:00
Sergej Jaskiewicz 2fc5316c1b [IR] Add a kdoc for IrValueParameter.isHidden 2023-05-25 12:33:35 +00:00
Egor Kulikov 9a77632f1c [FIR] Fix invalid expression throwing exception when determining type
^KTIJ-25421 fixed

Merge-request: KT-MR-10317
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-05-25 12:31:42 +00:00
Egor Kulikov 5e38c2d570 [FIR] Fix invalid expression throwing exception when determining type
^KTIJ-25421 fixed

Merge-request: KT-MR-10290
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-05-25 12:29:46 +00:00
Nikolay Lunyak 83f2c2e1f0 [FIR] KT-58623: Unify FirInlineDeclarationChecker
> Condition 'isSuspendFunctionType' is always false when reached

The change in the native tests is needed, because K2
doesn't support disabling old language features

^KT-58623 Fixed
2023-05-25 12:19:51 +00:00
Nikolay Lunyak 75c0304671 [FIR] KT-58623: Ensure the diagnostics are missing for Native 2023-05-25 12:19:51 +00:00
Nikolay Lunyak 699366f178 [FIR] KT-58184: Prevent missing diagnostics on component calls
Update the component function visibility
based on the already resolved visibility
of the property before transforming
the status of the component function itself.

^KT-58184 Fixed
2023-05-25 12:19:30 +00:00
Svyatoslav Scherbina d45e0116dd Bump Kotlin/Native version to 1.9.20-dev-2332 2023-05-25 12:13:46 +00:00
Alexander Udalov d32268c5cb JVM: do not assume that methods have body in BridgeLowering
They don't have bodies in the kapt stub generation mode.

 #KT-58787 Fixed
2023-05-25 12:07:58 +00:00
Brian Norman b2230327df [FIR] Refactor upper bound validation with better source element info
Attach source information to each argument of the type before expanding
to preserve information during validation. This allows errors to be
reported on the original argument during nested type alias expansion.

^KT-50798 Fixed
^KT-50703 Fixed
2023-05-25 11:24:17 +00:00
Alexander Shabalin d82a6f2fa2 [K/N] Fix default value of testTarget 2023-05-25 10:32:48 +00:00
Anton Lakotka 9456872bbe [Gradle] Remove unnecessary participatingSourceSetsLazy
The `withDependsOnClosure` is live object, it is ok to request it early
as long as other properties will read data from it at the end of the
configuration.

^KT-58471 Verification Pending
2023-05-25 10:25:17 +00:00
Anton Lakotka 731d3bf602 [Gradle] Remove legacy participatingSourceSets logic
It is unknown why we would need to include commonMain source set
explicitly from kotlinExtension.sourceSets.

Few assumptions:
* common main source set loaded somehow from different classloader
* compatibility with legacy multipaltform plugins

^KT-58471 Verification Pending
2023-05-25 10:25:16 +00:00
Anton Lakotka 60939a8fe6 [Gradle] Change skipProjectDependencies to transformProjectDependencies
For better code readability

^KT-58471 Verification Pending
2023-05-25 10:25:16 +00:00
Anton Lakotka 792c08ec7d [Gradle] Test CInterop commonization doesn't trigger configuration resolution
...before taskGraph is ready

KT-56858 Verification Pending
2023-05-25 10:25:16 +00:00
Anton Lakotka fc33892e70 [Gradle] Test cinterop dependency from composite build
KT-58471 Verification Pending
2023-05-25 10:25:16 +00:00
Anton Lakotka 7c47ff0819 [Gradle] Introduce isProjectComponentIdentifierInCurrentBuild
KT-58471 Verification Pending
2023-05-25 10:25:16 +00:00
Anton Lakotka 9ead1d84b1 [Gradle] Fix CInterop commonization for included builds
KT-58471 Verification Pending
2023-05-25 10:25:16 +00:00
Anton Lakotka b6a3a60f36 [Gradle] Update UP-TO-DATE checks in MppCInteropDependencyTransformationIT
CInteropDependencyTransformation task now is executed also for project
dependencies.

KT-58471 Verification Pending
2023-05-25 10:25:16 +00:00
Anton Lakotka e937f0739b [Gradle] Process project dependencies in CLI version of CInterop[MDT]Task
If MetadataDependencyTransformation is triggered it will resolve related
metadata dependency configuration. Which is not recommended from gradle
performance point of view.
Update CInterop[MDT]Task to work as regular [MDT]Task i.e. it will
process project dependencies during task execution but keep the original
functionality for IDE. Since during IDE import it is expected to resolve
configurations during gradle configuration phase.

^KT-58471 Verification Pending
2023-05-25 10:25:16 +00:00
Anton Lakotka 72c7d15be8 [Gradle] Share Cinterop and regular [MDT]Tasks inputs
These tasks are essentially operating on the same inputs but produces
different ouputs. Therefore, it makes sense to extract their Task Inputs
into a separate container and let these tasks share it.

KT-58471 Verification Pending
2023-05-25 10:25:16 +00:00