Commit Graph

1892 Commits

Author SHA1 Message Date
Alexander Udalov 05c25342ad Make CommonToolArguments.nullable
#KT-28974 Fixed
2019-01-15 17:21:43 +01:00
Vyacheslav Gerasimov 818910267e Remove 173 bunch files 2019-01-14 21:29:02 +03:00
Yan Zhulanow 7d660834e1 Fix 'CommandLineProcessor' extension point calling, switch it to using ServiceLoaderLite 2019-01-09 21:54:52 +03:00
Nicolay Mitropolsky 55404ea00d 191: Making MockExternalAnnotationsManager not throwing exceptions in non action-required cases 2018-12-28 11:56:08 +03:00
Sergey Rostov 883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Ilya Chernikov 44ea2bf1d4 Introduce script names and location ids, use them in diagnostics and...
for virtual file names. Also fix compiled script serialization.
2018-12-20 17:09:23 +01:00
Ilya Chernikov c165666d94 Refactor core env: extract script compilation dependencies collection 2018-12-20 17:09:20 +01:00
Ilya Chernikov 1e74ab5a62 Implement import test, fix import support in compiler and evaluator 2018-12-20 17:09:19 +01:00
Ilya Chernikov fce68102bd Implement imported scripts evaluation and construction 2018-12-20 17:09:18 +01:00
Ilya Chernikov 729ebcac9b Implement simple "add to compilation" functionality for scripts
(incomplete import - scripts added to the compilation but not yet
imported into scope)
Base functionality needed for #KT-27960
2018-12-20 17:09:16 +01:00
Denis Zharkov f153d97f40 Avoid multiple subsequent reading of the same class-file in front-end
^KT-23466 Fixed
2018-12-13 20:38:24 +03:00
Ivan Gavrilovic 6b20ef0208 Complete Java usage tracker if analysis extension finishes (KT-27487)
In cases when kapt compiler plugin runs in stubs generation mode,
Java usage tracker was not completed. This caused issues with
the incremental compilation if Java files changed.

E.g. if a constant defined in Java source file changed, stubs
would not be recompiled because the Java usage tracker would
not report changed type. This commit fixes that issue.
2018-12-13 17:12:08 +03:00
Andrey Uskov 595e75e059 Fix build in bunch 191 2018-12-12 19:04:15 +03:00
Yan Zhulanow 9a98a4525b ServiceLoaderLite: Support paths with spaces (KT-28527) 2018-12-11 17:45:46 +09:00
Vyacheslav Gerasimov d84c5b1608 Switch to 183 platform 2018-12-06 20:16:58 +03:00
vitaly.khudobakhshov 396ba6cdd5 Display function value properly 2018-12-05 16:02:29 +01:00
vitaly.khudobakhshov c901d6cebc Implement support for "resX" result fields in REPL 2018-12-05 16:01:32 +01:00
Georgy Bronnikov f4aad70b36 Fix KotlinFrameworkSupportProviderTest 2018-11-30 18:00:27 +03:00
Sergey Rostov 5623c74543 Move resources: fix pill 2018-11-30 15:01:02 +03:00
Sergey Rostov df2e4524d7 Move resources from /src to separate /resources directory.
Previously this files was stored in /src directory and was included in
resources mainly by SourceSet.projectDefault from sourceSets.kt:

val processResources = tasks.getByName(processResourcesTaskName) as ProcessResources
processResources.from("resources") { include("**") }
processResources.from("src") { include("META-INF/**", "**/*.properties") }

Also there are some custom rules like this:

resources.srcDir("../idea-analysis/src").apply { include("**/*.properties") }
resources.srcDirs("idea-repl/src").apply { include("META-INF/**") }

All this rules are synthesized in script
https://github.com/snrostov/kotlin-migrate-resources/blob/master/src/main/kotlin/main.kt

This commit created using that script. See README.md for more details on
 script.
2018-11-30 15:01:01 +03:00
Alexander Podkhalyuzin c416b192ef Cleanup, all bunches are completely the same... 2018-11-30 14:30:43 +03:00
Alexander Podkhalyuzin e044ec78a1 Do not duplicate build number of IDEA in code 2018-11-29 16:37:33 +03:00
Georgy Bronnikov 32640750ee Add CompilerPhase and corresponding compiler keys 2018-11-29 12:48:52 +03:00
Yan Zhulanow 0ffa901859 Switch plugin and annotation processor loading to the own implementation of ServiceLoader
'ServiceLoader' in JDK8 leaks file handles (https://bugs.openjdk.java.net/browse/JDK-8156014).
New implementation uses the ZipFile API, it also doesn't operate on the whole classpath which is not often needed.
2018-11-27 22:21:24 +09:00
Yan Zhulanow 11e23ecc70 Kapt: Fix 'apt+compile' mode, clear package caches directly 2018-11-27 22:21:23 +09:00
Yan Zhulanow 69ec958aab Kapt: Add tests for the command-line 'kapt' tool 2018-11-27 22:21:23 +09:00
Yan Zhulanow 6e5eb0fdd4 Kapt: Implement 'kapt' command-line tool (KT-24998, KT-24997) 2018-11-27 22:21:23 +09:00
Yan Zhulanow b6aecf3933 Remove hacky PluginURLClassLoader
It was once needed for the compiler plugins bundled straight into the compiler (read: kapt1). Since there are no bundled plugins anymore, the parent-last plugin classloader itself is not needed anymore.
2018-11-27 22:21:22 +09:00
Yan Zhulanow 02340a4fe3 Removed obsolete 'BundledCompilerPlugins' class
It was used once in kapt1, but since it's gone, there is no need in this anymore.
2018-11-27 22:21:22 +09:00
Yan Zhulanow 49941339a3 Introduce AbstractCliOption, rewrite all possible kapt options as enum values 2018-11-27 22:21:22 +09:00
Alexander Udalov 9b07bbdf56 Do not use backslash for escaping outside of string literals in argfiles
This fixes CLI tests testArgfileWithEscaping and
testApiVersionLessThanLanguageUsingArgfile on Windows

 #KT-28180 Fixed
2018-11-14 12:53:24 +01:00
Natalia Selezneva e48fbe4aa3 Do not insert additional new lines in REPL 2018-11-01 15:00:41 +03:00
Natalia Selezneva 468404c6c3 Repl: refactoring, move common parts to utils 2018-11-01 15:00:41 +03:00
Alexander Udalov d28c6559b8 Fix support of directories as sources in build files (-Xbuild-file)
#KT-27775 Fixed
2018-10-29 11:36:29 +01:00
Alexander Udalov 9df02b2366 Support Groovy $Trait$FieldHelper classes in new class file reader
Preface: for Groovy traits with fields, the Groovy compiler generates
synthetic "$Trait$FieldHelper" classes which posed several problems to
our class file reader, caused by the fact that the contents of the
InnerClasses attribute broke some assumptions about how names on the JVM
are formed and used.

For a trait named `A`, the Groovy compiler will additionally generate a
synthetic class file `A$Trait$FieldHelper` with the following in the
InnerClasses attribute:

InnerClasses:
     public static #15= #2 of #14; //FieldHelper=class A$Trait$FieldHelper of class A

i.e. the simple name of the class is `FieldHelper`, the name of its
outer class is `A`, but the full internal name is `A$Trait$FieldHelper`,
which is surprising considering that the names are usually obtained by
separating the outer and inner names via the dollar sign.

Another detail is that in some usages of this synthetic class, the
InnerClasses attribute was missing at all. For example, if an empty
class `B` extends `A`, then there's no InnerClasses attribute in `B`'s
class file, which is surprising because we might decode the same name
differently depending on the class file we encounter it in.

In this change, we attempt to treat these synthetic classes as top-level
by refusing to read "invalid" InnerClasses attribute values (they are
not technically invalid because they still conform to JVMS), fixing the
problem of "unresolved supertypes" error which occurred when these
classes were used as supertypes in a class file in a dependency.

1) In ClassifierResolutionContext.mapInternalNameToClassId, do not use
   the ad-hoc logic (copy-pasted from intellij-core) to determine class
   id heuristically from the internal name. For $Trait$FieldHelper
   classes this logic attempted to replace all dollar signs with dots,
   which was semantically incorrect: dollars there were used as
   synthetic characters, not as a separator between outer and inner
   classes.
2) In isNotTopLevelClass (Other.kt), only consider "valid" InnerClasses
   attribute values, where the full name of the class is obtained by
   separating the outer name and the inner name with a dollar character.
   This way, we'll be able to treat class files with invalid attribute
   values as top-level and avoid breaking any other assumptions in the
   class file loader.
3) In BinaryJavaClass.visitInnerClass, record all valid InnerClasses
   attribute values present in the class file, not just those related to
   the class in question itself. This is needed now because previously,
   the removed heuristics (see p.1) transformed mentioned inner class
   names to class ids correctly >99% of the time. Now that the
   heuristics are gone, we'll use the information present in the class
   file to map names correctly and predictably. According to JVMS, this
   attribute should contain information about all inner classes
   mentioned in the class file, and this is true at least for class
   files produced by javac.

 #KT-18592 Fixed
2018-10-25 22:15:22 +02:00
peter ebc998d710 add ultra-light classes/members that work without backend in simple cases 2018-10-25 18:22:33 +02:00
Alexander Udalov e3a332c393 Configure Java module path when compiler is invoked in -Xbuild-file mode
#KT-27626 Fixed
2018-10-17 18:39:50 +02:00
Alexander Udalov 9dc53c38f3 Remove deprecated CompilerJarLocator 2018-10-17 18:39:49 +02:00
Alexander Udalov 009f18f1f4 Split AnalysisFlag values to AnalysisFlags and JvmAnalysisFlags
Declare AnalysisFlags in module 'frontend', and JvmAnalysisFlags in
module 'frontend.java', to avoid leaking Java-related logic to common
compiler code
2018-10-01 13:31:00 +02:00
Alexey Sedunov c59779f5b9 MPP: Retain KotlinSourceSetInfo for Android in data nodes
User data is not serialized which leads to broken import on reopening

 #KT-27213 Fixed
2018-10-01 13:55:35 +03:00
Dmitry Petrov 729da29e49 Update command-line options help for '-Xnormalize-constructor-calls'
Default value depends on language version.
2018-10-01 09:42:13 +03:00
Alexander Udalov 088cd4b5e3 Stop parsing argument in argfile when quote ends
There are two visible effects of this change:
1) If an empty argument is passed in quotes, it will be parsed as an
   empty string and handled by the compiler, which will report an error
   later. The specific error is not very important because it's an edge
   case anyway; at the moment, "source file or directory not found:" is
   reported which is no better than the "invalid flag:" error reported
   by javac in the similar case
2) It's no longer possible to split an argument into several parts and
   quote them separately, such as:

       "-langu"ag"e-"ver'sio'n 1.2

   No test added for this change in behavior since it's an even edgier
   case. Note that javac also prohibits this.

 #KT-27226 Fixed
2018-09-28 16:02:40 +02:00
Alexander Udalov 16dd6ebe61 Handle whitespaces in argfiles correctly
#KT-27218 Fixed
2018-09-28 16:02:40 +02:00
Mikhail Glukhikh 64b23812c0 Move CliArgumentStringBuilder: cli -> idea-jvm 2018-09-25 19:14:12 +03:00
Mikhail Glukhikh f6b805a973 Add enable / disable feature in JPS
#KT-26775 Fixed
#KT-26774 Fixed
2018-09-20 15:56:37 +03:00
Mikhail Glukhikh 8a7ff4cd24 Add enable / disable feature in Maven project
Part of KT-26775
2018-09-20 15:56:32 +03:00
Denis Zharkov 38be1f6947 Minor. Parametrize MainFunctionDetector with LanguageVersionSettings 2018-09-12 09:49:25 +03:00
Ilya Gorbunov a18770fbbb Remove projectDist dependency helper usages
Use default configuration dependencies instead of projectDist ones.
2018-09-12 06:05:05 +03:00
Mikhail Zarechenskiy 169599abcc Add flag to allow using kotlin.Result as a return type
#KT-26659 Fixed
2018-09-11 10:39:11 +03:00
Alexander Udalov c4be039cd1 Support argfiles in CLI with "@argfile"
#KT-24613 Fixed
2018-09-10 14:12:32 +03:00