Commit Graph

103075 Commits

Author SHA1 Message Date
Yahor Berdnikau 36f748cbcc [Gradle] Fix Jvm Toolchain Android tests are not running on CI
JUnit5 combines tags and then applies to this combined list filters from
 the test task. If this list contains any excluded tag - test will be
 ignored.

^KT-59587 In Progress
2023-06-30 14:18:05 +00:00
Yahor Berdnikau 05ce873d2a [Gradle] Fix Android tests for Jvm Toolchain
^KT-59587 In Progress
2023-06-30 14:18:05 +00:00
Sergey Bogolepov d433d1eb3f KT-58862: Remove cinterop -mode option
metadata cinterop libraries perform pretty well for years,
so we can drop this flag.
2023-06-30 14:16:01 +00:00
Pavel Kargashinsky 807e7f1c28 [MPP][Tests] Bump AndroidAndJavaConsumeMppLibIT tests Gradle version to 7.6.
Tests will be failed if AGP >=7.1.0 or Gradle >= 8.0
See KT-57351 for details
2023-06-30 14:15:40 +00:00
Pavel Kargashinsky 816efc2def [MPP][Tests] Use max supported Gradle version for MPP old-dsl tests 2023-06-30 14:15:39 +00:00
Aleksei.Glushko 5618ee84f8 [K/N] try to reimplement safe points with a load-branch-call 2023-06-30 14:12:17 +00:00
Ilya Kirillov 5b4916a808 Introduce StandardNames.IMPLICIT_LAMBDA_PARAMETER_NAME
and use it instead of hardcoded constant
2023-06-30 13:43:31 +00:00
Ilya Kirillov 0a1f27e43a [LC] remove duplicating checkIsMangled function 2023-06-30 13:43:30 +00:00
Ilya Kirillov c4e8a6dee9 [SLC] implement isMangled for symbol light method
`isMangled` is needed for implementing rename refactoring

^KTIJ-25903
2023-06-30 13:43:30 +00:00
Ilya Kirillov 8b0eb0488f [Analysis API] add method for implicit companion object reference detection
Add a new method `isImplicitReferenceToCompanion` to determine
if the given reference is an implicit reference to a companion object.

The method is needed for the rename refactoring in IJ.

^KTIJ-25863
2023-06-30 13:43:30 +00:00
Alexander Udalov f5bbf2b4fe Reflection: create synthetic classes for Java lambdas
... as well as $SwitchMap and other synthetic classes generated by javac
or other JVM language compilers or runtimes.

Note that for Kotlin, all synthetic classes were already handled by the
subsequent check for `KotlinClassHeader.Kind.SYNTHETIC_CLASS`, but after
this change we won't call `ReflectKotlinClass.create` for those, which
is a minor optimization.

 #KT-41373 Fixed
2023-06-30 13:11:41 +00:00
Alexander Udalov 5dc882abf5 Reflection: create synthetic classes instead of throwing UOE
... for Kotlin-generated classes which do not correspond to a "class"
from the Kotlin language's point of view. For example, Kotlin lambdas,
file facade classes, multifile class facade/part classes, WhenMappings,
DefaultImpls. They can be distinguished from normal classes by the value
of `KotlinClassHeader.Kind` (which is the same as `Metadata.kind`).

Another theoretical option would be to throw exception at the point
where the `::class` expression is used, if the expression's type on the
left-hand side is a synthetic class. But we can't really do that since
it'll affect performance of most `<expression>::class` expressions.

So, construct a fake synthetic class instead, without any members except
equals/hashCode/toString, and without any non-trivial modifiers. It kind
of contradicts the general idea that kotlin-reflect presents anything
exactly the same as the compiler sees it, but arguably it's worth it to
avoid unexpected exceptions like in KT-41373.

In the newly added test, Java lambda check is muted but it should work
exactly the same as for Kotlin lambdas and other synthetic classes. It's
fixed in a subsequent commit.

 #KT-41373 In Progress
2023-06-30 13:11:41 +00:00
Alexander Udalov d833b732c9 Reflection: support Java anonymous/local classes
Local classes and anonymous objects are normal classes and
kotlin-reflect can load all declarations and modifiers from them, and
support calling members, exactly in the same way as it does for normal
non-local classes.

 #KT-41373 In Progress
2023-06-30 13:11:41 +00:00
Alexander Udalov 1e031d9fb8 Reflection: add test on introspection of local classes
kotlin-reflect works correctly already for Kotlin-generated local
classes and anonymous objects, but not for Java ones. This is fixed in a
subsequent commit.

 #KT-41373 In Progress
2023-06-30 13:11:41 +00:00
Sergej Jaskiewicz 9fcdc10019 [IR] Reorder parameters in IrFactory#createValueParameter
This is to prepare for IrFactory auto-generation (KT-59308).
2023-06-30 12:41:02 +00:00
Kirill Rakhman 2cc588d6d8 [RAW FIR] Rename raw FIR builder types for clarity 2023-06-30 12:05:43 +00:00
Ilya Kirillov 26e9e9de11 [LL FIR] add regression tests for KTIJ-23090
^KTIJ-23090 obsolete
2023-06-30 11:13:47 +00:00
Ilya Kirillov 048ecdf981 [Analysis API] add regression tests for KTIJ-24163
^KTIJ-24114 obsolete
2023-06-30 11:13:46 +00:00
Sergej Jaskiewicz 3f6420c5b9 [IR] Move IrFactory#createExpressionBody overloads to extension methods
This is to prepare for IrFactory auto-generation (KT-59308).
2023-06-30 11:06:09 +00:00
Nataliya.Valtman ea8b482f4f Don't get BuildScanExtension when buildScan report is disabled
#KT-59589: Fixed
2023-06-30 09:59:09 +00:00
ksenia.sergeeva 5e7e1e6c92 add gradle integration tests for explicit api mode in android KT-59117 2023-06-30 09:52:17 +00:00
Sebastian Sellmair 24debfd9b7 [Gradle] ExternalTargetApi: Implement ExternalKotlinTargetSourcesJarUtils
This utils are intended to be used external target authors exclusively
and shall help to create sources.jar files using regular
Kotlin Multiplatform conventions.

^KT-58109 Verification Pending
2023-06-30 09:34:07 +00:00
Sebastian Sellmair 3f1faa26ac [Gradle] ExternalTargetApi: Add sourcesElements-published and add this configuration to the published component
^KT-58109 In Progress
2023-06-30 09:34:07 +00:00
Sergey Bogolepov aee9b7aae3 [K/N] Add a trivial test-case for KT-59167 2023-06-30 09:01:38 +00:00
Sergey Bogolepov 0ceadc5933 [K/N] Fix KT-59167 2023-06-30 09:01:37 +00:00
Bogdan Mukvich 45e56f9c14 Disable SBOM for Gradle plugins
Current implementation causes publishing to fail

^KTI-1282
2023-06-30 07:55:45 +00:00
vladislav.grechko a6e45f9b59 Find correct class owner for inlined local delegated properties
Note that call-site class has no metadata for inlined local delegated
properties. Thus, for an inlined local delegated property we should
obtain declaration-site class as owner - otherwise, the corresponding
`PropertyReference` will have an owner without property metadata.
2023-06-29 17:44:25 +02:00
Timofey Solonin d6d1ed6c35 [MPP] Fix NewMultiplatformIT and make it run on arm macOS
^KT-58822
2023-06-29 14:59:45 +00:00
Jinseong Jeon f467c970b2 Drop param name check in PSI-KtSymbol eq checker
Parameter names might not be available, e.g., header jar (ijar).
2023-06-29 14:44:41 +00:00
Ilya Goncharov 49b2ac1b10 [JS] Remove legacy js in maven 2023-06-29 14:25:45 +00:00
Ilya Goncharov 0ac0c51c23 [JS] Remove Ant js test 2023-06-29 14:25:45 +00:00
Ilya Goncharov b0b266b73d [JS] Fix test of Ir Stdlib api 2023-06-29 14:25:45 +00:00
Ilya Goncharov 8c014baa28 [JS] Fix JPS tests with js part 2023-06-29 14:25:45 +00:00
Ilya Goncharov a0f86d8dd6 [JS] Remove JS legacy lookup tracker tests 2023-06-29 14:25:45 +00:00
Artem Daugel-Dauge 6861591840 [Gradle] Migrate Xcode/CocoaPods warnings to the new diagnostics infra + elevate deprecation of useLibraries
^KT-59313 Verification Pending
^KT-58519 Verification Pending
2023-06-29 14:23:55 +00:00
Artem Daugel-Dauge 67c19b00e0 [Gradle] Excplictly pass locale to CocoaPods invocations
^KT-59522 Verification Pending
2023-06-29 14:23:30 +00:00
Sergej Jaskiewicz f14a713e49 [mangling] Remove the unused fqnString method from KotlinMangler 2023-06-29 13:04:25 +00:00
Anna Kozlova 11c4fcda5f [psi][AA] don't decompile code when stubs have enough information
^ KTIJ-25979
+ do not assert when there are no stubs (text is already computed)
2023-06-29 10:09:20 +00:00
aleksandrina-streltsova 4ccea40651 [AA] Provide API for obtaining array element type of KtType
KTIJ-23199
2023-06-29 09:41:40 +03:00
Vsevolod Tolstopyatov 37c2c862d8 KT-53154 enumEntries experimental intrinsic stub
Provide an inefficient default implementation and make it "@PublishedApi internal" so it can be safely merged as is.

Intrinsics will be added later in follow-up PRs, and then the implementation will be adjusted accordingly

Merge-request: KT-MR-10843
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-06-28 20:25:11 +00:00
Jinseong Jeon 0d19a5b3ea AA: make paths platform-independent before using JRT file system
^KT-59697 Fixed
2023-06-28 22:13:16 +02:00
Abduqodiri Qurbonzoda bf1c9774aa Fix the ConcurrentModification test that fails in jdk9+
Modification registration seems to changed in Java 9. Now if the asked
capacity in `ensureCapacity` function is less than current capacity,
no modification is registered.
2023-06-28 19:00:46 +00:00
Nikolay Krasko ac0e493bac Temporary disable sbom publication for gradle plugin configuration
When signing is enabled it leads to error

```
Build file '/Users/Shared/Projects/kotlin/libraries/tools/kotlin-gradle-plugin-api/build.gradle.kts' line: 13

Cannot change dependencies of dependency configuration ':kotlin-gradle-plugin-api:commonApi' after it has been included in dependency resolution.
```

When running with
```
gradle :kotlin-test:publish -Psigning.gnupg.keyName=* -Psigning.gnupg.passphrase=* -PsigningRequired=true
```
2023-06-28 18:00:14 +00:00
Nikolay Krasko 7f751c5d61 Fix signing in :kotlin-annotation-processing-embeddable
Problem is reproducible only when singing is enabled.
Register dependencies between publication and signing tasks.
It looks like signing tasks have same output and need to be registered
in all publications.

Error:

* What went wrong:
Some problems were found with the configuration of task ':kotlin-annotation-processing-embeddable:publishMainPublicationToMavenLocal' (type 'PublishToMavenLocal').
  - Gradle detected a problem with the following location: '/Users/Shared/Projects/kotlin/plugins/kapt3/kotlin-annotation-processing-embeddable/build/libs/kotlin-annotation-processing-embeddable-1.9.255-SNAPSHOT-sources.jar.asc'.

    Reason: Task ':kotlin-annotation-processing-embeddable:publishMainPublicationToMavenLocal' uses this output of task ':kotlin-annotation-processing-embeddable:signGradleCompatPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

Reproduce:

gradle :kotlin-annotation-processing-embeddable:publishToMavenLocal -Psigning.gnupg.keyName=* -Psigning.gnupg.passphrase=* -PsigningRequired=true

KTI-1282
2023-06-28 18:00:14 +00:00
Nikolay Krasko e6df34805f Fix Gradle implicit dependency error in kotlin-test when signing enabled
Remove dependency to same javadoc jar in all publications as it produces
an implicit dependency to the same signing task. Use different javadoc
tasks instead.

Error:

org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':kotlin-test:signCommonPublication' (type 'Sign').
 - Gradle detected a problem with the following location: '/kotlin/libraries/kotlin.test/build/distributions/kotlin-test-1.9.20-dev-0000-javadoc.jar.asc'.

  Reason: Task ':kotlin-test:publishAnnotationsCommonPublicationToMavenLocal' uses this output of task ':kotlin-test:signCommonPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

Reproduce:

gradle :kotlin-test:publishToMavenLocal -Psigning.gnupg.keyName=***** -Psigning.gnupg.passphrase=**** -PsigningRequired=true

KTI-1282
2023-06-28 18:00:14 +00:00
Artem Daugel-Dauge 27600eecb3 [Gradle] Make check for illegal target names case-insensitive
^KT-59733 Verification Pending
2023-06-28 17:51:07 +00:00
Ilya Goncharov 0b912b0200 [Gradle, JS] Return back deprecated methods for compatibility
^KT-59604 fixed
2023-06-28 17:14:52 +00:00
Timofey Solonin 16236936e5 [MPP] Use proper assertion in CommonizerIT
^KT-58712
2023-06-28 16:58:10 +00:00
Jinseong Jeon a93bc60655 AA: use simple name of local type as JVM internal name
Otherwise, e.g., if a local type is within an anonymous object, full
class id will include that anonymous object too, resulting in invalid
type signature for PsiType.

^KT-59533 Fixed
2023-06-28 18:38:01 +02:00
Ilya Goncharov 2d178e5273 [Gradle, JS] Not reset runtimeChunk because it does not affect stacktraces 2023-06-28 15:58:22 +00:00