Commit Graph

2309 Commits

Author SHA1 Message Date
Jinseong Jeon 911963bafd CLI: utilize JRT path split (w/o magic number) 2022-06-21 11:34:09 +02:00
Simon Ogorodnik b7a215334e KT-52409 Report error when using K2 with multi-platform 2022-06-20 10:39:25 +00:00
Ilya Chernikov c2316ca305 Scripting: avoid definitions discovery when compiling regular kotlin
If only regular kotlin .kt (and .java) files are compiled, do not
register file extensions that may come from discovered script
definitions. Since the discovery is lazy by itself, this should
skip jars processing for regular compilation scenarios without scripts.
#KT-47816 fixed
2022-06-16 21:28:07 +00:00
Ilya Chernikov 5caf2a2aca Scripting: refactor plugin command line processing
- process command line properly when plugin is autoloaded
- add and fix options to disable definitions autoloading and discovery
- cleanup unused code
(partial test is added to "avoid definitions discovery" commit)
2022-06-16 21:28:07 +00:00
Ilya Chernikov a8c4ea04c8 Scripting: add check for 'kotlin' package similar to the regular sources
#KT-52598 fixed
2022-06-16 21:28:06 +00:00
Ilya Chernikov 855059b93c Scripting: update scripts in source roots handling
#KT-52525 fixed
related to #KT-52735
2022-06-16 21:28:06 +00:00
Jinseong Jeon 2eab61d75f FIR CLI: remove redundant cast and run 2022-06-13 18:41:17 +02:00
Jinseong Jeon d2663cfb94 FIR CLI: fix typos in contentRootToVirtualFile util 2022-06-13 18:41:17 +02:00
Alexander Udalov ec9d929532 Remove dependency of fir2ir:jvm-backend on backend.jvm.entrypoint
Extract JvmIrDeserializer(Impl), similarly to the existing
JvmIrSerializer(Impl). Remove `allowErrorNodes` which is always false
anyway.
2022-06-13 12:35:51 +00:00
pyos 3840d09314 FIR: fix check for plugins that support K2 2022-06-10 09:47:35 +03:00
nataliya.valtman b19837aa02 Change log level for compiler performance metrics 2022-06-09 08:55:47 +00:00
Dmitriy Novozhilov 4003ca0691 [FE] Add ability to set compatibility of plugin with K2 in ComponentRegistrar 2022-06-07 14:12:14 +00:00
Mikhail Glukhikh 8baff4404d Partial rename of 'Experimentality' around K1 checkers 2022-06-02 15:36:56 +00:00
Alexander Udalov a7f4981fe5 Normalize virtual file paths to prevent duplicate sources
#KT-52465 Fixed
2022-05-27 23:40:57 +02:00
Alexander Udalov 70121f0c78 Report error on non-existent classpath in -Xplugin
#KT-52380 Fixed
2022-05-27 13:13:33 +02:00
Georgy Bronnikov e0c175bb50 Fir2Ir: remove symbolTable as separate component from FirResult
It's already in components.
2022-05-19 12:02:41 +02:00
Georgy Bronnikov 3f66b31a47 Fir2Ir: add irProviders to Fir2IrComponents
Removes the last use of DeclarationStubGenerator in the FIR pipeline.
2022-05-19 12:02:41 +02:00
Georgy Bronnikov 13d4d60afa Fir2Ir: pass Fir2IrExtensions to backend 2022-05-19 12:02:41 +02:00
Georgy Bronnikov 3c3c1be543 Fir2Ir: introduce Fir2IrExtensions
This allows us to remove DeclarationStubGenerator from Fir2IrConverter,
thus reducing dependency on descriptor-based code.
2022-05-19 12:02:41 +02:00
Vladimir Dolzhenko efd5beb49b IJ file type optimizations based on extension
#KTIJ-21668

Merge-request: KT-MR-6288
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2022-05-17 14:46:00 +00:00
Ilya Chernikov 6b09ace099 FIR LT: fix bootstrap compilation error
if the existing list in the FRIENDS_PATH config property created with
Arrays.asList, it contains non-extendable list, and attempt to use
addAll on it leads to an exception.
2022-05-12 08:45:40 +02:00
Mads Ager c6d7c23940 Always take java source before class files.
Also when searching for inner classes.

^Fixes KT-51025
2022-05-05 13:21:06 +02:00
Ilya Chernikov cdb5845693 [minor] fix double warning about FastJarFS 2022-04-29 11:03:13 +00:00
Simon Ogorodnik 58885a1b07 KT-52217 Rename 'use-fir' to 'use-k2', update message 2022-04-28 15:42:42 +00:00
Mikhail Glukhikh 08ba89b4ec CLI K2: report an error for JS/Native/Metadata #KT-52035 Fixed 2022-04-28 13:25:48 +00:00
Dmitriy Novozhilov 19f4c3edda [CLI] Report compilation error if compiler plugins are enabled alongside with K2 compiler
^KT-52037 Fixed
2022-04-26 21:03:04 +04:00
Alexander Udalov 2e515f3945 Prohibit JVM target 1.6
But still compile stdlib, reflect, kotlin.test and scripting runtimes
with JVM target 1.6 to simplify migration from Kotlin 1.6 to 1.7.

 #KT-45165 Fixed
2022-04-19 22:54:40 +02:00
Aleksei.Cherepanov 3d8f140d6b [JPS] Fix incremental build after changing Java enum used in Kotlin when
EnumWhenTracker implemented for tracking changed java enum class items, that used in kotlin when expression.

#KT-47824 Fixed
2022-04-19 18:39:41 +00:00
Ilya Kirillov 69a53bc742 [low level fir] use correct FirModuleData for declarations provided by FirJavaFacade 2022-04-13 12:53:23 +02:00
Alexander Udalov 6402c3908c Validate -Xbackend-threads CLI argument value
#KT-51846 Fixed
2022-04-08 14:01:21 +02:00
Ilya Chernikov 03cbfea737 FIR LT: Introduce source file abstraction, carry it from parsing to IR
along with source lines mapping, allows to "emulate" usage of the
PSI files which allows to extract source file and line mapping info
on every stage from source element.
It makes sense to use this mapping for the error reporting too.
2022-03-30 08:34:30 +00:00
Ilya Chernikov ae10346d75 Refactor FIR diagnostics: cleanup and extract position finder
for reusing the latter in the inliner for LT-based sources
2022-03-30 08:34:13 +00:00
Ilya Chernikov 25e9de286d Test infra: adapt blackbox test runner to work with non-psi sources 2022-03-30 08:34:06 +00: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
Ilya Chernikov 018782f0c7 FIR CLI: use VFS for LT files loading
may improve performance in some cases and is consistent with handling
of PSI files
2022-03-30 08:33:43 +00:00
Ilya Chernikov a08e70ae5c FIR CLI: fix java sources search scope usage 2022-03-30 08:33:27 +00:00
Ilya Chernikov 973273c6c6 FIR CLI: count lines/files and report events to perfman 2022-03-30 08:33:11 +00:00
Ilya Chernikov 090a451902 FIR: implement proper exit on errors in new cli pipeline 2022-03-30 08:33:03 +00:00
Ilya Chernikov f89765eb33 Make JDK classpath roots configuration explicit...
instead of relying on the "configuration files" parameter.
(in the process of migration from KotlinCoreEnvironment).
2022-03-30 08:32:56 +00:00
Ilya Chernikov a239f02a30 Add cli argumens for FIR "tight" IC and LightTree usage 2022-03-30 08:32:03 +00:00
Ilya Chernikov 9e32188938 FIR LT: add syntax error reporting to LT2Fir
use it in the new pipeline
2022-03-30 08:31:56 +00:00
Ilya Chernikov 275135a1b2 FIR: extend cli pipeline with incremental compilation logic
use it in the IncrementalCompilationRunner
2022-03-30 08:31:10 +00:00
Ilya Chernikov 12d49c2cd8 FIR: new cli pipeline with LightTree support 2022-03-30 08:29:47 +00:00
Mads Ager 0c4f2711d6 Avoid reading /tmp/build.txt in standalone compiler invocations.
^KT-51627 Fixed

kotlinc will currently read /tmp/build.txt in an attempt to
determine an IDEA version number for IDEA plugin compatibility
checking. If that file exists and does not match the expected
format kotlinc will fail.

Since standalone kotlinc is not IDEA, this change explicitly
sets the system property for the build number to a fallback
value. That avoids reading /tmp/build.txt.

closes https://github.com/JetBrains/kotlin/pull/4763
2022-03-15 18:37:01 +01:00
Jinseong Jeon a106ec6530 Do not create FastJarFileSystem when USE_PSI_CLASS_FILES_READING
because the intention of that configuration is to use "slower" class
reading.

In the near future, even though FIR is enabled, which uses experimental
faster jar file system, FIR clients (e.g., FIR UAST or Android Lint) may
still need to use slower class reading. So, we need to handle that
configuration before checking others.
2022-03-15 19:50:18 +03:00
Dmitriy Novozhilov faba9c4272 [CLI] Don't register classpath roots twice
There are two ways how content roots are registered in compiler configuration
  in JVM CLI compiler:
1. Directly from arguments
2. From Module, which build from arguments

And there was a problem that both ways used at the same time in some
  circumstances (regular compilation without .xml module file) which
  caused duplication of all content roots.

Ideal solution for this problem is removal of Module usages at all,
  because it looks like redundant abstraction which just complicate
  things, but it's too scary to remove it, because it hove some none
  trivial usages inside compiler. So to fix problem with duplicated
  roots this commit just removes registration of roots from arguments
  if Module is used
2022-02-23 19:33:51 +03:00
tdn120 8d1fb7bb5e Check analysis error before checking compiler args
ExperimentalUsageChecker.checkCompilerArguments() will crash if there was an error running analyze().
This checks for the error first so it can be properly reported.
2022-02-21 20:31:05 +01:00
Dmitriy Novozhilov 44bfb6fde8 [FIR] Don't register FirJavaElementFinder for common session 2022-02-18 17:44:40 +03:00
Victor Petukhov 5c8ca0ca9b [Compiler CLI] Use reading language version settings from environment only if the resource is presented or flag is set 2022-02-16 18:41:51 +03:00