Commit Graph

551 Commits

Author SHA1 Message Date
Alexander Udalov a594434a95 Kapt+JVM_IR: do not run IR plugins in kapt mode
Because in kapt stub generation mode (aka ClassBuilderMode.KAPT3, aka
generateBodies=false in psi2ir), method bodies are not generated and
compiler plugins such as kotlinx-serialization might not expect that.

 #KT-54245 Fixed
2022-12-07 21:14:30 +00:00
Alexander Udalov 5848b2fde6 Kapt+JVM_IR: add IrKotlinKapt3IntegrationTest 2022-12-07 21:14:29 +00:00
Andrey Uskov 41ff283856 Don't call File.getCanonicalPath in KGP
Relates to KT-54579.
2022-12-04 18:49:30 +00:00
Andrey Uskov ca8f234f28 Improve performance of KAPT on JDK 17
Getting canonical path is expensive on JDK 17, thus check, whether
file is belongs to some folder becomes expensive.
In this commit implementation was replaced to a new one based on
File.getParent. It gives profit 49seconds-> 500 ms/100k files.
Note! Now if there are present two files which are actually links of the
same file, they are treated as two different files.
#KT-54579 Fixed
2022-12-04 18:49:30 +00:00
Vyacheslav Gerasimov 50ad5027fe Build: Fix kotlin-annotation-processing pom dependencies
#KTI-878
2022-12-01 15:50:38 +01:00
Mads Ager 30002e29d1 [KAPT+JVM_IR] Do not generate initializers for delegated properties.
^KT-54870 Fixed
2022-11-28 22:27:09 +01:00
Alexander Udalov c813e03c1e Kapt+JVM_IR: do not generate nested enum as final
#KT-54187 Fixed
2022-10-24 12:48:22 +00:00
Daniel Santiago 189be2b117 [KAPT] Setup KaptJavaLog writers during initialization.
Migrate KaptJavaLog to not used deprecated constructor in newer JDKs and instead set up the writers during initialization. This enables us to get rid of KaptJavaLog17.

Fixes KT-54030
2022-10-11 23:48:18 +02:00
Nicklas Ansman Giertz b02948b5f7 KAPT: Kapt generates illegal stubs for private interface methods
Interface methods that were private got both the `default` and `private`
modifiers when using `jvm-default=all` which is not valid.

The stub will now just contain `private` in this case.

This fixes KT-48013.
2022-09-26 12:21:56 +02:00
Nikolay Krasko 1630386712 Move to JDK_X_Y variables 2022-09-21 22:53:19 +00:00
Vladimir Sukharev c8864369fd Use main class as test generator name
Merge-request: KT-MR-7031
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-09 12:51:18 +00:00
Nikita Bobko 70ed76e0bd Drop unused ':dist' dependency in some tests
Review: https://jetbrains.team/p/kt/reviews/6753

This commit doesn't fix any issue except for "cleanup". If you find a
mistake in this commit feel free to revert part of it/the whole commit

I checked every module where I drop ':dist' dependency. Tests still pass
in those modules
2022-08-22 15:42:34 +02:00
Dmitry Gridin 4ceb170917 regenerate tests 2022-08-05 14:12:41 +02:00
Dmitriy Novozhilov af8caae387 [KAPT] Fix formatting 2022-07-20 10:12:25 +00:00
Dmitriy Novozhilov 8b960de76a [KAPT] Add additional test tasks for running tests on JDK 11 2022-07-20 10:12:24 +00:00
Dmitriy Novozhilov 9c41e75802 [KAPT] Migrate kapt tests to new test infrastructure 2022-07-20 10:12:24 +00:00
Dmitriy Novozhilov fdf1b8b1c0 [KAPT] Migrate tests in kapt3-base and kapt3-cli to JUnit 5 2022-07-20 10:12:24 +00:00
Alexander Udalov bd0fe2f146 Remove dependency of compiler tests on fir2ir tests
Compiler tests use the old test infrastructure, but fir2ir tests use the
new one (tests-common-new). Removing this dependency means that now the
two big modules, `:compiler:compileTestKotlin` and
`:compiler:tests-common-new:compileTestKotlin` can be compiled in
parallel, which improves the total build time.
2022-07-18 13:13:01 +02:00
Dmitriy Novozhilov 1a8496757e [Compiler] Mark all entrypoints to compiler API as experimental 2022-06-29 12:00:01 +00:00
Dmitriy Novozhilov f587c02d38 [FE] Move ServiceLoaderLite to :compiler:frontend.common
This is needed to be able to use this class inside FIR part of IDE plugin
2022-06-29 12:00:00 +00:00
Dmitriy Novozhilov c979e1edcf [Plugins] Deprecate ComponentRegistrar
^KT-52665 In Progress
2022-06-29 11:59:58 +00:00
Pavel Mikhailovskii c3c09aa95a KT-4107 Data objects 2022-06-28 16:58:20 +02:00
Mikhael Bogdanov 162ca4ac2b KAPT+IR: support IR error types
#KT-49682
2022-06-20 11:42:53 +00:00
Simon Ogorodnik e3c7929fee KT-52284 Clarify message in Kapt with K2 error 2022-06-20 10:39:25 +00:00
Alexander Udalov 448cba07bb Psi2ir: do not generate init block body in kapt mode 2022-06-17 16:51:06 +02:00
Alexander Udalov 7e9d7c895a Kapt: add flag kapt.use.jvm.ir for enabling JVM IR support
#KT-49682
2022-06-17 16:51:06 +02:00
Simon Ogorodnik 0b88748623 KT-52284 Kapt. Report error for kapt run with K2 2022-05-06 15:25:41 +00:00
Simon Ogorodnik 1c90d8a960 KT-52038 Kapt. Disable FIR for kapt run automatically 2022-04-28 15:42:41 +00:00
Alexander Udalov 45f87bc71a Advance JVM target to 1.8 for kapt, AE, parcelize runtimes 2022-04-19 22:54:40 +02:00
Ilya Chernikov 2044754628 Backend: remove psi files from generation state
pass them explicitly to all destinations. This is a step in attempt to
abstract dependencies on PSI in the GenerationState and related places.
2022-03-30 08:33:59 +00:00
Ilya Chernikov da41fddabb Backend: remove codegen factory from generation state
use it explicitly. This is a step in attempt to abstract dependencies
on PSI in the GenerationState and related places.
2022-03-30 08:33:51 +00:00
Udi Cohen c9d2f40b95 Rename params show/dumpProcessorTimings to show/dumpProcessorStats
^KT-51132 Fixed
2022-03-25 18:54:02 +00:00
Udi Cohen eb3b9f148d Support dumping stats for number of generated sources by annotation processors
^KT-51132 In Progress
2022-03-25 18:54:02 +00:00
Victor Petukhov b5933c70e2 [FE 1.0] Refactor error utils: split error entities and introduce error type and error scope kinds 2022-03-23 21:13:33 +00:00
Mikhael Bogdanov 093b1bebb0 KAPT+IR: Generate LVT in kapt mode 2022-03-22 09:50:08 +00:00
Mikhael Bogdanov 41a54241bb Update testdata 2022-03-15 11:38:04 +01:00
Mikhael Bogdanov 15c3dd527c KAPT+IR: Support data classes 2022-03-15 11:38:04 +01:00
Mikhael Bogdanov ceedad40f3 KAPT+IR: Support secondary constructors 2022-03-15 11:38:03 +01:00
Ivan Gavrilovic 72532f6f03 KT-41456: Incremental KAPT - optimize .class file counting
When counting .class files, stop once the required number is reached.
Also, implement simple counting logic directly, it is 25% faster than
using File.walk(). The way this information is used is a heuristic, so
reducing computation cost makes sense.

^KT-41456 Fixed
2022-02-21 18:10:03 +03:00
Ivan Gavrilovic 0074e0209c KT-41456: Incremental KAPT - check compiled sources before running incrementally
Because incremental KAPT tries to reuse .class files produced by kotlinc
and javac, it should check for their existence before starting
an incremental run. Otherwise, annotation processors that perform type
validation will fail to run.

Current check counts the number of declared types in processed .java
sources, and it makes sure the total number of .class files in compiled
sources dirs is equal or higher. Otherwise, KAPT runs non-incrementally.

Tests: KaptIncrementalWithIsolatingApt.testMissingKotlinOutputForcesNonIncrementalRun

^KT-41456 In Progress
2022-02-21 18:10:00 +03:00
Ivan Gavrilovic c7e73ce88d KT-41456: Incremental KAPT - represent source and class file structure differently
When storing source information needed for type analysis, store
.java file and .class file information separately. This is because
for class files only declared typed is needed.

Tests: updating existing ones

^KT-41456 In Progress
2022-02-21 18:09:58 +03:00
Mikhael Bogdanov ccbecbaccb KAPT+IR: Update tests 2022-02-17 12:26:42 +01:00
Mikhael Bogdanov 7b767aaa1c KAPT+IR: Don't clear binding context if KAPT is used 2022-02-17 12:26:42 +01:00
Mikhael Bogdanov f05c72d48f KAPT+IR: Properly process annotations and backing field annotations 2022-02-17 12:26:42 +01:00
Mikhael Bogdanov ea2bf3c867 KAPT+IR: Support -Xjvm-default modes 2022-02-17 12:26:41 +01:00
Mikhael Bogdanov 00f2b83b84 KAPT+IR: Support @JvmOverloads annotation 2022-02-17 12:26:41 +01:00
Mikhael Bogdanov 7ec19d015c KAPT+IR: Properly process repeatable annotation
~review fix
2022-02-17 12:26:41 +01:00
Mikhael Bogdanov d810d93578 IR: Keep annotations in enum constructor during lowering 2022-02-17 12:26:40 +01:00
Alexander Udalov 032d69aa41 Kapt: handle special names correctly
Parameter names of some methods are different in JVM IR, for example
extension receivers of property `$annotations` methods are named
`<this>`, which made the `Name.identifier` call fail. It seems fine to
use the "p + index" name for this instead.

 #KT-49682
2022-02-08 20:15:14 +01:00
Alexander Udalov 07d3e3a5bd Kapt: support property $annotations methods for JVM IR
`is PropertyDescriptor` check doesn't work for JVM IR where descriptor
is created on-the-fly and is an `IrBasedSimpleFunctionDescriptor`.

 #KT-49682
2022-02-08 20:15:14 +01:00