Commit Graph

662 Commits

Author SHA1 Message Date
Marco Pennekamp 53f2dfec41 [Kapt4] Update Kapt4 test data after AA Standalone fix for sealed inheritors
- The Standalone Analysis API now correctly calculates sealed inheritors
  in source modules. This causes Kapt4 to pick up on sealed subclasses
  in the `modifiers` test. The change is in line with the non-FIR test
  results in `modifiers.txt`.

^KT-66013
2024-03-18 21:14:36 +00:00
Jinseong Jeon 94e5653eb7 Migrate utils to check/alter TypeMappingMode according to suppress wildcard annotations
^KT-61734
2024-03-07 10:16:59 +00:00
Artem Kobzar 2e4d02e9f4 [PSI2IR, K/Wasm] Sync start and end offsets on PSI and FIR for primary constructors 2024-02-29 14:42:33 +00:00
Pavel Mikhailovskii 12552e4e04 [KAPT] KT-44706 Support @JvmRecord-annotated classes
Don't parse Java stubs in tests if no validation is needed

Merge-request: KT-MR-14308
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-29 12:44:56 +00:00
Marco Pennekamp 708ed81eb2 [Test] Avoid importing unused @Nested annotations in generated tests
- Unused `Nested` imports frequently cause unused import warnings in the
  IDE, which are especially annoying in after-commit warning/error
  analysis.
2024-02-27 20:30:06 +00:00
Dmitriy Novozhilov acf2296590 [Test] Regenerate tests after two previous commits 2024-02-16 12:48:24 +00:00
Leonid Startsev 09e89db82f Change kotlinx- to kotlin- in kotlin-metadata-jvm and related projects
Change package, artifact group, artifact name, and Gradle module name to
kotlin-metadata and kotlin-metadata-jvm, respectively.

In Kotlin 2.0, kotlin-metadata-jvm library is promoted to stable, and is
a part of Kotlin distribution now.

Note that kotlinx-metadata-klib is left with org.jetbrains.kotlinx group, artifact name and package
because -klib part is considered not stable and for internal use. Since it is still published via Sonatype,
it should have kotlinx group. Therefore, it will have both classes from kotlin.metadata and kotlinx.metadata packages. This is not a problem, because we already had kotlinx.metadata split package between -jvm and -klib before.

#KT-63219 Fixed
2024-02-15 15:32:33 +00:00
Alexander Udalov 88fbaed22e Tests: minor, do not use target backend in kapt tests
These tests now only make sense for JVM_IR. Incidentally this fixes the
JVM illegal access warnings from generateTests, because the test
framework no longer tries to instantiate these tests (which leads to
`doOpenInternalPackagesIfRequired`) to determine the target backend.

The change in JvmEnvironmentConfigurator is needed so that JVM tests
without target backend would default to JVM IR instead of the old
backend.

Also rename files to match the class names.
2024-02-15 10:13:24 +00:00
Dmitriy Dolovov 03418c11c3 [kotlinp] Change the package name in :tools:kotlinp-jvm subproject
Change the package name for all *.kt files inside
the :tools:kotlinp-jvm subproject from "org.jetbrains.kotlin.kotlinp"
to "org.jetbrains.kotlin.kotlinp.jvm"

^KT-62340
2024-02-13 21:01:08 +00:00
Dmitriy Dolovov d30efdb001 [kotlinp] Split :tools:kotlinp into "common" and "jvm" subprojects
The "common" subproject keeps only backend-neutral logic and depends
only on :kotlinx-metadata library. It takes the name of the former
project - :tools:kotlinp

The "jvm" subproject depends on the "common" one and also depends
on :kotlinx-metadata-jvm. It gets the new name - :tools:kotlinp-jvm

There is a lot of touched files in this commit. The majority of them
is just moved files (tests, test data, etc).

Only the following files were actually modified:
  .space/CODEOWNERS
  build.gradle.kts
  libraries/tools/abi-comparator/build.gradle.kts
  libraries/tools/kotlinp/build.gradle.kts
  libraries/tools/kotlinp/jvm/build.gradle.kts
  plugins/kapt3/kapt3-compiler/build.gradle.kts
  settings.gradle

 ^KT-62340
2024-02-13 21:01:08 +00:00
Dmitriy Dolovov eec76865a7 [kotlinp] Refactor to separate common part from JVM-specific part
This refactoring includes the following:
1. Separate backend-neutral part of the metadata printer `Kotlinp`
   from the part that accesses JVM-specifics: `JvmKotlinp`.
2. Introduce `org.jetbrains.kotlin.kotlinp.Printer`: The component
   that renders both individual `Km*` nodes and the whole metadata
   tree, and does so with the proper indentation.

^KT-62340
2024-02-13 21:01:08 +00:00
strangepleasures e363a1228d KT-65404 KAPT should print a warning if stub generation is triggered for an interface with method bodies but without -Xjvm-default=all or -Xjvm-default=all-compatibility
Merge-request: KT-MR-14139
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-12 11:17:32 +00:00
Pavel Mikhailovskii d75463a7d5 [KAPT] KT-65399 Fix rendering of types with names starting with $.
Solves a specific issue with Kotlin serialization, and most likely,
similar issues with synthetic classes.

Types with `$` in other positions will be still rendered incorrectly
due to imprecise conversion of such types from Kotlin to Java
in the analysis API.


Merge-request: KT-MR-14235
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-12 11:15:36 +00:00
strangepleasures 9688c3e761 [KAPT] Improve stub formatting; check raw stubs in tests
Merge-request: KT-MR-14244
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-09 15:41:37 +00:00
Pavel Mikhailovskii 7ab9e03347 KT-65684: KAPT: (Re)enable fallback to K1 KAPT and make it default
[KAPT] KT-65684 Set languageVersion=1.9 in KaptToolIntegrationTestGenerated

[KAPT] KT-65684 Re-enable a few now-passing tests in Kapt4IT

[KAPT] KT-65684 Fix the logic setting -Xuse-kapt4 flag in Kapt4IT.forceKapt4()

The change is needed to make sure that all the tests have the flag set,
 otherwise some of them would silently switch to the fallback node.
Also disables a few now failing tests.

[KAPT] KT-65684 Revert "KT-64385 Enable K2 KAPT by default"

This reverts commit 7e9d6e60


Merge-request: KT-MR-14291
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-09 12:54:28 +00:00
Pavel Mikhailovskii f81b1150b2 [KAPT] KT-65453 Disable generation of type annotations in Java stubs
A workaround for KT-65608


Merge-request: KT-MR-14236
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-08 18:05:49 +00:00
Evgeniy.Zhelenskiy 7eab4b672d [K1, K2, CLI] Mark whole position range of compiler diagnostics in CLI
#KT-64989
2024-02-08 12:59:31 +00:00
strangepleasures 17955ce7d9 Revert "Remove flaky Kapt4ToolIntegrationTestGenerated test"
This reverts commit 58fd558308.
2024-01-29 15:47:36 +00:00
Alexander Udalov 7ca2df3ff9 Kapt: minor, remove unneeded check
Most likely it has been made obsolete by KT-27936 where we started to
generate all inner class names correctly.

 #KT-61080 Fixed
2024-01-29 12:58:06 +00:00
Nikolay Krasko 58fd558308 Remove flaky Kapt4ToolIntegrationTestGenerated test
The test is now very flaky and leads to java.lang.OutOfMemoryError

KTI-1559
2024-01-19 14:01:02 +00:00
strangepleasures 0dd3abba2a [KAPT] Support type annotations in K2 KAPT. Fixes KT-64479 2024-01-15 10:24:38 +00:00
strangepleasures 7e9d6e601d KT-64385 Enable K2 KAPT by default
Also adds support for front-end compiler plugins in Kapt
2024-01-15 10:22:32 +00:00
Dmitrii Gridin b6d373d8e5 Update copyright to 2024 2024-01-05 13:43:17 +00:00
Alexander Udalov a9f85d75f4 Kapt: remove support for old JVM backend
#KT-64680 Fixed
2024-01-03 19:37:40 +00:00
Alexander Udalov c251eb19a6 Kapt: remove old JVM backend test data (2/2)
In this commit, .ir.txt expectation test data files for the JVM IR
backend are renamed to .txt. This is done as two separate commits so
that Git would recognize that these files were logically moved, not that
the contents of the original .txt files were changed.

 #KT-64680
2024-01-03 19:37:40 +00:00
Alexander Udalov 9c67616b25 Kapt: remove old JVM backend test data (1/2)
In this commit, .txt expectation test data files for the old JVM backend
are deleted.

 #KT-64680
2024-01-03 19:37:40 +00:00
Alexander Udalov e4a608c6e7 Kapt: remove tests on old JVM backend
#KT-64680
2024-01-03 19:37:40 +00:00
Sonya Valchuk 588549d1d0 JVM_IR: add offsets to JvmStatic and JvmOverloads proxies
KAPT3 needs them to correct error types in arguments.

 #KT-64639 Fixed
2024-01-02 17:43:09 +00:00
strangepleasures b32f408767 [KAPT] KT-64389 Fix stub generation with generic type constraints 2023-12-19 13:33:38 +00:00
strangepleasures 1015ae858e [KAPT] KT-64301 Report invalid enum value names
Merge-request: KT-MR-13520
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2023-12-13 17:53:52 +00:00
strangepleasures b84aa190d7 [KAPT] KT-64297 Mark deprecated members with @java.lang.Deprecated
Merge-request: KT-MR-13521
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2023-12-13 17:18:54 +00:00
Sergej Jaskiewicz f844a86057 [utils] Introduce the bind function and use it throughout 2023-12-13 10:04:45 +00:00
Leonid Startsev 36703ff9ae Implement strict and lenient modes for Kotlin metadata reading
In strict mode, an exception will be thrown when inconsistent metadata is encountered. In lenient mode, the reader will attempt to handle the inconsistent metadata by ignoring certain inconsistencies. This is a solution to a problem of reading metadata 'from the future' that is not allowed by default, but desired in certain cases. See updated ReadMe for details.

Also fix problem with Strict Semantics flag.

#KT-57922 Fixed
#KT-59441 Fixed
2023-12-01 17:43:11 +00:00
Ilmir Usmanov 37417f7919 KAPT: Use reflection to access code, changed in JDK 21
#KT-57389 Fixed
2023-11-22 14:58:55 +00:00
Ilmir Usmanov 4f7c96ae43 KAPT: Always print parens on empty annotation parameters
Since JDK 17+ pretty-printer does not print parens on empty annotation
parameters, print them anyway. Otherwise, tests with annotations differ
on different JDKs.
 #KT-57389
2023-11-22 14:58:55 +00:00
Ilmir Usmanov 87aed4bf47 KAPT: Run tests on JDK 21
Previously, some tests have also been disabled on JDK 11+, since
we did not filter out empty filesets, which led to failed assertion
inside JDK.
 #KT-57389
2023-11-22 14:58:55 +00:00
strangepleasures 03ed1d1d31 KT-62560 [SLC] Fix handling of empty varargs in annotations 2023-11-20 20:57:21 +00:00
strangepleasures 9c2ce475e2 KT-60821 [KAPT] Generate stubs without KaptTreeMaker
Merge-request: KT-MR-12979
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2023-11-16 21:14:36 +00:00
Ivan Kochurkin 1827df82c4 Removed useless as casts from compiler code
It allows compiling code with K2 and enabled `-Werror`
2023-10-24 20:59:56 +00:00
strangepleasures 6a2cea8a8e [KAPT4] KT-62097 Keep import statements for unresolved annotation classes 2023-10-20 08:33:17 +00:00
Mikhail Glukhikh 2a8b655294 Update tests after switching to LV 2.0
Related to KT-59171
2023-09-19 15:46:27 +00:00
strangepleasures c31a3869c6 [KAPT] Fix package names org.jetbrains.kotlin.base.kapt3 -> org.jetbrains.kotlin.kapt3.base 2023-09-15 19:36:30 +00:00
strangepleasures 8fb7ea1126 [KAPT4] KT-61333 Support REPORT_OUTPUT_FILES
Add extra logging
2023-09-15 11:05:05 +00:00
strangepleasures cf01d2970f [SLC] [KAPT] KT-61916 Fix generation of annotations in annotation arguments 2023-09-14 13:21:07 +00:00
strangepleasures 52b0ea65d2 [KAPT4] KT-61761 Prevent Kapt from reporting unsupported plugin in K2/PSI
Also:
- remove the redundant KaptOptions.USE_K2
- prevent registration of Kapt4AnalysisHandlerExtension in K1
2023-09-12 16:58:38 +00:00
strangepleasures 6475942ced [KAPT4] A temporary workaround for KT-60482 2023-09-12 16:58:13 +00:00
Alexander.Likhachev 6eaccc997f [Build] Fix the typo junit jupyter -> jupiter 2023-09-06 22:47:34 +00:00
Alexander.Likhachev 6f96be0b76 [Build] Get rid of the testApiJUnit5 method
#KTI-1349 In Progress
2023-09-06 22:47:34 +00:00
strangepleasures 9d43945b19 [KAPT4] KT-61729 Resolve annotation arguments during generation of @Metadata annotations 2023-09-06 19:47:28 +00:00
Alexander Udalov 761221904c K2 kapt: add kapt.use.k2 Gradle property
... and `-Kapt-use-k2` CLI flag to enable K2 kapt.

 #KT-61114 Fixed
2023-09-01 22:51:19 +00:00