Commit Graph

102240 Commits

Author SHA1 Message Date
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
Sergej Jaskiewicz 30cd2c3025 [IR] Reorder parameters in IrFactory#createProperty
This is to prepare for IrFactory auto-generation (KT-59308).
2023-06-28 13:21:55 +00:00
Pavel Kunyavskiy cd3237295b [K/N] Remove module-wide ObsoleteDescriptorBasedApi opt-in 2023-06-28 13:18:09 +00:00
Kirill Rakhman 046b629baa [JPS Build] Fix list of ignored modules for JPS build
#KTI-1275 Fixed
2023-06-28 12:19:24 +00:00
Dmitrii Gridin 6553290b05 [LL FIR] FirElementFinder: drop obsolete debug info
Issue with CME already fixed in LL FIR some time ago
2023-06-28 10:34:04 +00:00
Dmitrii Gridin 2769632c77 [LL FIR] FirElementFinder: mark object internal 2023-06-28 10:34:04 +00:00
Dmitrii Gridin eb4fe1a1c5 [LL FIR] FirElementFinder: fix file name 2023-06-28 10:34:04 +00:00
Dmitrii Gridin 94d727a9ce [AA FIR] KtFirVisibilityChecker: drop redundant resolve
We can collect a designation path by psi declaration without resolution

^KT-59454 Fixed
2023-06-28 10:34:04 +00:00
Dmitrii Gridin ca521a81f8 [LL FIR] optimize search for fir declaration by kt declaration
Introduce new API to traverse FirFile by known declaration path
instead of unoptimized findSourceByTraversingWholeTree

^KT-59454
2023-06-28 10:34:04 +00:00
Sergej Jaskiewicz 7b77ec9930 [IR] Reorder parameters in IrFactory#createFunction
This is to prepare for IrFactory auto-generation (KT-59308).
2023-06-28 10:13:09 +00:00
cristiangarcia 650b00e1b2 Improve DexMethodCount task
Use lazy api to set the file and avoid configuring Jar tasks
2023-06-28 07:48:20 +00:00
Egor Kulikov d17c7d4729 [FIR] Correctly mute destructuring declaration test for 1.0
Merge-request: KT-MR-10847
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-06-27 16:17:07 +00:00
Leonid Startsev 0a573a803d Update and clarify documentation for kotlinx-metadata-jvm attributes:
- Review fixes
- Clarify KmClass.isData and enhance nodes documentaiton to mention extensions
2023-06-27 15:12:46 +00:00
Leonid Startsev 283f816320 Use source-version of kotlinx-metadata-jvm for embedding
Embedding published version while using source one can lead to runtime errors like NoClassDefFound
if a new (not yet published) declaration was used in implementation.
2023-06-27 15:12:46 +00:00
Leonid Startsev b15da7c63a Deprecate old kotlinx-metadata flags API:
Flag, Flag constants, Flags typealias, flagsOf() function, and
Flag accessors in nodes (such as KmClass.flags, KmClass.jvmFlags, KmProperty.setterFlags, etc)

#KT-59440
2023-06-27 15:12:46 +00:00
Leonid Startsev 1a1cbcb321 Rework flags in kotlinx.metadata:
Introduce extensions for KmNodes to work with various modifiers instead of old Flags.SOMETHING.invoke(flags).
Provide Visibility, Modality, and Kind enums.
Introduce KmPropertyAccessorAttributes to replace KmProperty.getterFlags and KmProperty.setterFlags.
Deprecate nodes constructors which take flags but not flags itself (yet).
Adapt KotlinP to changes.

#KT-59440 Fixed
2023-06-27 15:12:46 +00:00
Alexander Udalov ecc1f9fb0b Update to kotlinx-metadata-jvm 0.6.2
Migrate to the new API in kotlin-reflect build script, remove obsolete
workarounds.
2023-06-27 14:32:15 +00:00
Alexander Udalov 5451477eb0 Minor, remove useLegacyAbiGen test mode
Legacy jvm-abi-gen was removed in KT-55375.
2023-06-27 14:32:15 +00:00
Nikolay Krasko d4c8636c70 Relocate aalto-xml and stax2-api dependencies in embeddable compiler (KT-59631)
Two additional dependencies were added during 213 platform migration:
com.fasterxml:aalto-xml
org.codehaus.woodstox:stax2-api

Packages were not relocated and now might cause failures such as

```
Caused by: java.lang.NoSuchMethodError: 'void com.fasterxml.aalto.in.ReaderConfig.setXMLResolver(javax.xml.stream.XMLResolver)'
```

if proguard classes of kotlin-compiler-embeddable are registered early
in the classpath.
2023-06-27 12:48:37 +00:00
Dmitrii Krasnov 78e288be38 Bumped max supported gradle version to 8.0 in tests
#KT-56636 Fixed

Merge-request: KT-MR-10723
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-06-27 11:39:51 +00:00
Pavel Kirpichenkov 630c8e9df6 [AA, tests] Limit scopes of test libraries to their roots, add JDK_HOME
Without the fix, all libraries share the global scope for all project
libraries. JDK_HOME was used implicitly for things such as providing
Record support, but was not included as a test library/sdk.

KT-59637
2023-06-27 10:29:22 +00:00
Sergej Jaskiewicz 5b8b3644fc [IR] Reorder parameters in IrFactory#createLocalDelegatedProperty
This is to prepare for IrFactory auto-generation (KT-59308).
2023-06-27 10:22:54 +00:00
Egor Kulikov a7c1f53af8 [FIR] Correctly process invalid destructing declarations
^KTIJ-24730 fixed

Merge-request: KT-MR-10712
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-06-27 09:54:01 +00:00
Bogdan Mukvich a9d0ff83cf Add SBOM publishing for kotlin wasm libraries
^KTI-1273
2023-06-27 09:02:18 +00:00
Bogdan Mukvich 4ded83d266 Add SBOM publishing for kotlin-test-js-runner
^KTI-1273
2023-06-27 09:02:18 +00:00
Bogdan Mukvich 53ce5c22ca Add SBOM publishing for kotlin-test libraries
^KTI-1273
2023-06-27 09:02:18 +00:00
Bogdan Mukvich 9cfc66ae77 Restore SBOM publishing for stdlib
^KTI-1273
2023-06-27 09:02:18 +00:00
Bogdan Mukvich acb97d8cc9 Add SBOM for gradle plugins
^KTI-1273
2023-06-27 09:02:17 +00:00
Ivan Kylchik fba0bd79ad [K2] Don't crash compiler if receiver on property wasn't evaluated
Compilation crash must be handled separately in
`convertToConstantValues` method because we still want successfully
compile common code. All constants will be evaluated later on
fir2ir phase.

#KT-59362 Fixed
2023-06-27 08:51:39 +00:00
Bogdan Mukvich 8dab53f58a Add README for ArtifactsTests
^KTI-1103
2023-06-27 08:47:14 +00:00
Bogdan Mukvich 3bb429929a Update expected poms in ArtifactsTests
^KTI-1103
2023-06-27 08:47:14 +00:00
Alexander Udalov 0625c1ea76 Minor, workaround an incremental compilation issue
After the previous commit, IC does not recompile code related to CLI
arguments parsing (likely due to KT-57919), so the resulting dist
compiler doesn't work at all, and all related tests are failing. This
"useless" override tricks the IC to recompile the class and all its
subclasses.
2023-06-27 08:34:40 +00:00
Troels Bjerre Lund 111bb461a9 CLI: Change kotlin reflection to java reflection
The command line argument parser is using between 0.25s and 0.5s
(depending on platform) on finding annotated properties. This fix
replaces the slow kotlin reflection with java reflection, which is an
order of magnitude faster.

 #KT-58183 Fixed
2023-06-27 08:34:40 +00:00
Pavel Kunyavskiy b28b0e70b6 [commonizer] Support commonizing includedForwardDeclarations in manifest
It is a new manifest property which is used only in K2, and it is
required for correct K2 processing of forward declarations.

^KT-59132
2023-06-27 08:05:52 +00:00
Alexander Udalov f3a7312ee6 K2: use ClassKind.CLASS for object literals
K1 uses CLASS, and libraries like kotlinx-metadata-jvm and
kotlin-reflect already rely on it.

 #KT-57641 Fixed
2023-06-26 20:58:55 +00:00
Alexander Udalov 1be0fcb53a Kotlinp: add "test can be unmuted" error to K2 tests 2023-06-26 20:58:55 +00:00