Commit Graph

2461 Commits

Author SHA1 Message Date
Yahor Berdnikau 800e382ba9 Warn on using 'jdkHome' option in Gradle builds.
User should instead use KotlinJavaToolchain that will take care of
tracking major java version and provide nicer API.

Gradle will still pass jdkHome value to the compiler, but it should
be changed in Kotlin 1.6 release.

^KT-45611 Fixed
2021-05-17 16:57:01 +03:00
Dmitriy Novozhilov 02c58b7a8f [FIR] Refactor deserialized dependency providers and session factories with FirModuleData 2021-05-14 14:30:33 +03:00
Ilya Goncharov 19393948d7 [Gradle, JS] irBuildCache means ir compiler enabled 2021-05-12 11:57:14 +03:00
Ilya Goncharov b9fc97b44f [Gradle, JS] Add arguments for building caches 2021-05-12 11:57:14 +03:00
Xin Wang b9209962cd CLI: Add documentation for -J argument in kotlinc -help 2021-05-11 19:50:24 +02:00
Jinseong Jeon efba90c6f1 LC: rename KtLightClassForFacade to ...Impl
before introducing a common interface for light class for facade

This is a mechanical refactoring.
2021-05-05 14:11:48 +02:00
Victor Petukhov 909f0d8bdb Implement caching module annotations per class id 2021-04-30 14:43:27 +03:00
Victor Petukhov 2e57ff25ee Leave KotlinCliJavaFileManager::findClass only passing JavaClassFinder.Request 2021-04-30 14:43:27 +03:00
Victor Petukhov bc5e92033b Support reading annotations on java 9 module on sources and binaries 2021-04-30 14:43:27 +03:00
Victor Petukhov 71755b7a5e Support java 9 modules in the diagnostic tests both in sources and binaries 2021-04-30 14:43:26 +03:00
Mikhael Bogdanov dfc6d85aee Enable runtime string concatenation by default (for -Xjvm-target=9 or greater)
#KT-42522 Fixed
2021-04-27 09:08:28 +02:00
Andrey Zinovyev f71e08df4d [lombok] Experimental lombok plugin prototype
Add extension point for java descriptors
Add simple usage of this point to generate getter method
Add simple test infrastructure to test compilation with lombok plugin
2021-04-25 18:17:53 +03:00
Simon Ogorodnik c6fa363487 [FIR] Add warning if FIR is used 2021-04-23 19:49:46 +03:00
Simon Ogorodnik 539d3e5df2 Add full-pipeline modularized tests for old frontend 2021-04-15 13:36:00 +03:00
Dmitriy Novozhilov 1f62a2d8cc [FIR] Add disposing of FirJavaElementFinder in FIR compiler entrypoint 2021-04-15 10:30:09 +03:00
Alexander Udalov 005aa57f6d Remove obsolete module cli-js-klib
It's no longer used anywhere in the build.
2021-04-14 13:47:02 +02:00
Alexander Udalov 988d1365a8 Remove dependency of backend.wasm on ir.tree.impl and ir.tree.persistent 2021-04-14 13:47:02 +02:00
Alexander Udalov 643c3f26c1 Remove dependency of backend.js on ir.tree.impl
By taking the instance of IrFactory either from SymbolTable, or passing
it from cli-js which depends on both ir.tree.impl and
ir.tree.persistent, and can choose the appropriate implementation.
2021-04-14 13:47:02 +02:00
Dmitriy Novozhilov 803d47daaa Distinguish classes from different sourcesets in SealedInheritorInSameModuleChecker
#KT-45848 Fixed
#KT-46031
2021-04-13 11:21:58 +03:00
Alexander Udalov 115e2673ae Minor, fix javac deprecation warning in DynamicBundle 2021-04-12 14:38:09 +02:00
Alexander Likhachev 9e78e43c49 [Gradle] Always declare system property reads for compile tasks
When Kotlin plugin is applied in buildSrc or included build that defines Gradle plugins it can cause Gradle to report undeclared system property reads at configuration time. Declaring all system properties reads through Gradle providers to cover all these cases.
#KT-45910 Fixed
2021-04-12 03:15:10 +03:00
Alexander Likhachev 16dc0a7d29 [Gradle] Read more system properties through Gradle providers
Related to #KT-43605
2021-04-08 14:28:05 +03:00
Alexander Likhachev c44d83c6ba [Gradle] Move Kotlin daemon system properties read to build service
Instead of having a copy of those properties in each task move them into single build service
Related to #KT-43605
2021-04-08 14:28:00 +03:00
Abduqodiri Qurbonzoda 40d1849f33 Migrate compiler, idea and others to new case conversion api 2021-04-08 03:22:02 +03:00
Ilmir Usmanov b5ecccb610 Enable suspend in fun interfaces by default
#KT-45836 Fixed
2021-04-01 20:26:42 +03:00
Vyacheslav Gerasimov f2a892a972 Cleanup 201 and as41 bunch files 2021-03-30 14:23:43 +03:00
Alexander Udalov 6e86df2f6d Workaround illegal access to JDK internals in DynamicBundle
This is basically a manual cherry-pick of
https://github.com/JetBrains/intellij-community/commit/547caebd980d.

 #KT-44624 Fixed
2021-03-30 11:33:07 +02:00
Alexander Udalov 8e1a70cff6 Copy com.intellij.DynamicBundle to compiler/cli
This is needed to fix KT-44264 without updating the whole project to
intellij 203, which might take significant time.

In this commit, the file is copied as is from
https://github.com/JetBrains/intellij-community/blob/27837dd8e68a95cc4da0954f93321c98017b3d11/platform/core-api/src/com/intellij/DynamicBundle.java.
2021-03-30 11:33:07 +02:00
Ting-Yuan Huang 8e7b561b10 Add AnalysisHandlerExtension extension point for K2JsCompiler
AnalysisHandlerExtension allows compiler plugins to:
1. Intercept and override the default analysis.
2. Utilize the compiler infrastructure to do custom analysis.

A well know plugin on the JVM platform is KAPT.
2021-03-29 20:41:05 +03:00
Ting-Yuan Huang 4db79285c1 Add AnalysisHandlerExtension extension point for K2MetadataCompiler
AnalysisHandlerExtension allows compiler plugins to:
1. Intercept and override the default analysis.
2. Utilize the compiler infrastructure to do custom analysis.

A well know plugin on the JVM platform is KAPT.
2021-03-29 20:41:03 +03:00
Victor Petukhov 9c38db754e Add compiler flag to enable strict mode for improvements in the type enhancement
^KT-45674 Fixed
2021-03-26 11:04:01 +03:00
Vladimir Dolzhenko 51393d2d0f Fix compilation 2021-03-25 16:23:01 +01:00
Simon Ogorodnik 0aca68e7c7 FIR: Add init time measurement to full pipeline 2021-03-25 18:05:51 +03:00
Ilya Chernikov 9ac6d30953 Fix arguments processing with scripting with old backend by default 2021-03-24 22:38:59 +01:00
Ilya Chernikov bcd7bc5fd7 Fix arguments processing with scriting with old backend by default 2021-03-24 21:26:57 +01:00
Ilya Chernikov a11f6d2e50 Add support for gradle option useFir and appropriate property...
`kotlin.useFir`
2021-03-24 21:24:20 +01:00
Ilya Chernikov 3e458a1efb FIR: Add IncrementalPackagePartsProvider usage in cli...
also refactor IncrementalPackagePartsProvider and parents to simplify
usage
2021-03-24 21:24:18 +01:00
Ilya Chernikov f8d50d585d FIR: Implement lookup tracking 2021-03-24 21:24:18 +01:00
Ilya Chernikov 7d29ae7cce FIR: add incremental compilation tests 2021-03-24 21:24:18 +01:00
Ilya Chernikov 88e7ba2a3b FIR: Report syntax errors in cli compilation 2021-03-24 21:24:18 +01:00
Ilya Muradyan 14d386223b [REPL] Fix unresolved imports caching
Before this fix, if some imports were not resolved during compilation,
this result had been saved in caches, and this import couldn't been
resolved during following compilations even if it was added to the
module dependencies. This commit adds special handling of resolution
caches for the REPL compiler.
2021-03-24 13:35:33 +03:00
Alexander Udalov 415d52fe54 Deprecate KotlinJvmOptions.useIR
Starting from language version 1.5, JVM IR is enabled by default, so
this option has no effect. To rollback to the old JVM backend, the new
option useOldBackend can be used.

 #KT-45504 Fixed
2021-03-19 14:57:55 +01:00
Mikhail Zarechenskiy 111e54c8c1 Do not generate DefaultImpls for light classes if not needed
#KT-41130 In Progress
2021-03-18 16:38:52 +03:00
Alexander Udalov 27174de891 Add JVM target bytecode version 16
#KT-45515 Fixed
2021-03-17 21:31:08 +01:00
Ilmir Usmanov a90a5f6dd4 Check for backend when checking for suspend in fun interfaces 2021-03-16 22:37:44 +01:00
Alexander Udalov 83a4b6396a Deduplicate source roots in psi2ir and CLI
Compiler plugins can add new source roots to the next compilation round
by using `AnalysisResult.RetryWithAdditionalRoots`. Some plugins added
already existing source roots to this list in some cases. For example,
this is reproducible with `square/anvil` with incremental compilation
(KT-45100, KT-44925). Psi2ir didn't deduplicate the source files before,
which resulted in several classes with the same name linked to the same
symbol. This led to a "symbol is already bound" exception, and in case
of KT-44925, to an additional NPE when we were rendering the class to
display it in the message.

The solution is to deduplicate classes before psi2ir. Note that this
commit has two changes, in CLI and in psi2ir. Any one of these is
sufficient for fixing the problem, however both are made just to make it
more future-proof against new components and/or changes in existing
subsystems (e.g. fir2ir).

In the old JVM backend, similar deduplication was happening in
`ClassFileFactory.registerSourceFiles`, which is why the problem is not
reproducible there.

 #KT-45100 Fixed
2021-03-15 16:30:46 +01:00
Dmitriy Novozhilov f82c7c4678 [FIR] Cleanup session creation utils 2021-03-11 13:10:04 +03:00
Vladimir Ivanov fd02802028 [Native] Export KDoc into generated native header 2021-03-09 16:50:23 +03:00
scaventz 9a7ef11043 Report a readable diagnostic on empty -J argument in CLI 2021-03-06 03:14:11 -08:00
scaventz 81a495b494 Fix the NullPointerException when pathname does not name a parent. 2021-03-06 01:50:40 -08:00