Commit Graph

1214 Commits

Author SHA1 Message Date
Sergey Mashkov dafe7e3539 KT-14003 kotlinc shebang should use env 2016-10-07 17:52:34 +03:00
Yan Zhulanow 34efaea6ea Increment PsiModificationTracker counter in a write action
(cherry picked from commit 73307a2)
2016-10-07 16:28:34 +03:00
Yan Zhulanow 0ae9a7a9d1 Add TransactionGuard application service to KotlinCoreEnvironment
(cherry picked from commit 3e0b79e)
2016-10-07 16:28:30 +03:00
Alexander Udalov 8ffe379c92 Use separate module analysis in CliReplAnalyzerEngine 2016-10-06 14:40:21 +03:00
Alexander Udalov 0905b361d0 Drop LazyTopDownAnalyzerForTopLevel
Replace it everywhere with LazyTopDownAnalyzer
2016-10-06 14:40:20 +03:00
Alexey Tsvetkov 0944e9076d Add 1.1 language version to kotlin options for Gradle 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov 892fc63fd1 Generate gradle options from compiler arguments
#KT-13633 fixed
2016-10-05 22:50:46 +03:00
Alexander Udalov 53b584f48c Simplify usages of IncrementalPackageFragment and related code
Since its scope is now empty, no descriptor now has a container that is an
instance of IncrementalPackageFragment -> a lot of code is not needed anymore
2016-10-05 11:24:30 +03:00
Michael Bogdanov dd4d5e3aa1 Generate 'DefaultImpls' for jvm 8 target only within compiler option 2016-10-03 14:05:59 +03:00
Alexander Udalov 45190d9453 Support separate modules in compiler
Unless the compatibility option "-Xsingle-module" is passed, the compiler will
create two modules instead of one now (see TopDownAnalyzerFacadeForJVM): the
main module contains Kotlin and Java sources and binaries from the previous
compilation of the given module chunk, the dependency module contains all other
Kotlin and Java binaries. This fixes some issues where the compiler couldn't
detect that the used symbol was from another module, and did not forbid some
usages which are only possible inside the module (see KT-10001).

The ideal way to deal with modules here would be to exactly recreate the
project structure, for example as it's done in JvmAnalyzerFacade and usages.
This is postponed until later

 #KT-10001 Fixed
 #KT-11840 In Progress
2016-10-02 21:15:47 +03:00
Alexander Udalov 3314725700 Pass GlobalSearchScope instance to JvmPackagePartProvider
Currently behavior is unchanged because the "all project" scope is passed,
however in the future this will allow to implement separate modules in the
compiler properly
2016-10-02 21:03:37 +03:00
Alexander Udalov 97f2051a03 Add debugName to ModuleMapping 2016-10-02 21:03:33 +03:00
Alexander Udalov 5d37fab4f5 Minor, add toString for debug 2016-10-02 21:03:29 +03:00
Alexander Udalov a5a874f23f Move module creation into TopDownAnalyzerFacadeForJVM#analyzeFilesWithJavaIntegration
The only place where the logic has changed is in AbstractDiagnosticsTest, where
modules are already created and sealed before the analysis. Copy-paste the
container creation logic there (it's almost fine because it's also present in a
bunch of other tests), and simplify it: get rid of incremental compilation and
other stuff irrelevant for diagnostic tests.

This is needed to make analyzeFilesWithJavaIntegration configure the module
properly before sealing it
2016-10-02 21:03:27 +03:00
Alexander Udalov 596fdab2f2 Extract container for single-module top-down analysis 2016-10-02 21:03:26 +03:00
Alexander Udalov 278941a8a1 Deduplicate code in container creation for JVM analysis 2016-10-02 21:03:24 +03:00
Alexander Udalov 0250ea861c Simplify return types of createContainer* functions 2016-10-02 21:03:23 +03:00
Alexander Udalov 87fe6c41df Drop ExternalDeclarationsProvider
It was added for Android extensions, but now another mechanism is used there
(PackageFragmentProviderExtension), and there were no other implementations of
ExternalDeclarationsProvider in the project
2016-10-02 21:03:19 +03:00
Pavel V. Talanov 32daf048c2 PlatformConfigurator: create container for each platform (it contains static services, mostly checkers) ahead of time 2016-09-26 14:42:57 +03:00
Denis Zharkov a7dedfab70 Move JvmBuiltIns initialization after container setup
It will be used in the further commits to initilize built-ins instance
with components as arguments
2016-09-22 15:40:37 +03:00
Mikhail Zarechenskiy 8a0107ea5f Move property with template to script definition interface 2016-09-20 16:23:42 +03:00
Nikolay Krasko a471d8907a Register TypeAnnotationModifier as extension point 2016-09-20 15:26:34 +03:00
Nikolay Krasko 99a75021e1 Problem: manually shutdown AppScheduledExecutorService to allow compiler stop properly
Without such shutdown console program that gets PSI file will hang forever.

Introduced in https://github.com/JetBrains/intellij-community/commit/446b80077aed71e2384301ae993cf44416bf9a83

Stack example:

 java.lang.Thread.State: RUNNABLE
	  at com.intellij.util.concurrency.AppDelayQueue.<init>(AppDelayQueue.java:37)
	  at com.intellij.util.concurrency.AppScheduledExecutorService.<init>(AppScheduledExecutorService.java:50)
	  at com.intellij.util.concurrency.AppScheduledExecutorService$Holder.<clinit>(AppScheduledExecutorService.java:41)
	  at com.intellij.util.concurrency.AppScheduledExecutorService.getInstance(AppScheduledExecutorService.java:46)
	  at com.intellij.util.concurrency.AppExecutorUtil.getAppScheduledExecutorService(AppExecutorUtil.java:39)
	  at com.intellij.concurrency.JobScheduler.getScheduler(JobScheduler.java:43)
	  at com.intellij.psi.impl.source.AstPathPsiMap.<clinit>(AstPathPsiMap.java:45)
	  at com.intellij.psi.impl.source.PsiFileImpl.<init>(PsiFileImpl.java:76)
	  at com.intellij.extapi.psi.PsiFileBase.<init>(PsiFileBase.java:39)
	  at org.jetbrains.kotlin.psi.KtFile.<init>(KtFile.java:48)
	  at org.jetbrains.kotlin.parsing.KotlinParserDefinition.createFile(KotlinParserDefinition.kt:73)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:407)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:348)
	  at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:326)
	  at com.intellij.psi.SingleRootFileViewProvider.getPsiInner(SingleRootFileViewProvider.java:171)
	  at com.intellij.psi.SingleRootFileViewProvider.getPsi(SingleRootFileViewProvider.java:155)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.trySetupPsiForFile(PsiFileFactoryImpl.java:121)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:100)
	  at com.intellij.psi.impl.PsiFileFactoryImpl.createFileFromText(PsiFileFactoryImpl.java:56)
	  at org.jetbrains.kotlin.psi.KtPsiFactory.doCreateFile(KtPsiFactory.kt:174)
	  at org.jetbrains.kotlin.psi.KtPsiFactory.createFile(KtPsiFactory.kt:178)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processFileSingleEvaluator(Preprocessor.kt:82)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processDirectorySingleEvaluator(Preprocessor.kt:105)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processDirectorySingleEvaluator(Preprocessor.kt:135)
	  at org.jetbrains.kotlin.preprocessor.Preprocessor.processSources(Preprocessor.kt:74)
	  at org.jetbrains.kotlin.preprocessor.PreprocessorCLI.main(PreprocessorCLI.kt:35)
2016-09-20 15:25:37 +03:00
Nikolay Krasko bfef8726bb Mock implementation for ExternalAnnotationsManager and InferredAnnotationsManager services 2016-09-20 15:10:56 +03:00
Nikolay Krasko b05105e849 Problem: define idea.plugins.compatible.build setting explicitly to avoid exception about bad idea home path 2016-09-20 15:10:49 +03:00
Alexander Udalov c91f77f2a4 Rename LanguageFeatureSettings -> LanguageVersionSettings 2016-09-19 15:21:24 +03:00
Alexander Udalov aec31bd88f Uninherit LanguageVersion from LanguageFeatureSettings
Introduce LanguageVersionSettingsImpl to store everything related to the
selected language version
2016-09-19 15:20:47 +03:00
Alexey Tsvetkov 6ebb50751c Remove source annotations when copy class with kapt2
Writing source annotations enables incremental compilation for kapt2.
However they are not needed in bytecode, so we remove them when
copying classes.

# Conflicts:
#	compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt
#	compiler/frontend.java/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java
2016-09-14 13:52:56 +03:00
Yan Zhulanow 015130832b Kapt: allow to use Kapt from compileBunchOfSources() 2016-09-10 17:36:53 +03:00
Yan Zhulanow 471ddc5a93 Kapt: Write annotations with the "SOURCE" retention if kapt2 is enabled
(cherry picked from commit 6177b2b)
2016-09-10 17:36:15 +03:00
Yan Zhulanow 824b778a7b Kapt: support multiple annotation processing steps (KT-13651)
(cherry picked from commit 880e183)
2016-09-10 17:36:15 +03:00
Yan Zhulanow 84d62f37eb Kapt: Analyze sources again if the received analysis result is 'RetryWithAdditionalJavaRoots'. ->
Add additional Java roots to Java source roots and clear diagnostic messages before the next analysis round.
(cherry picked from commit 17ad807)
2016-08-29 16:31:16 +03:00
Alexander Udalov 3298649bd7 Support "-no-reflect" in "kotlin" command
#KT-13491 Fixed
2016-08-26 15:17:00 +03:00
Ilya Chernikov 46a7c706e1 Fixes and refactorings after review 2016-08-11 09:11:11 +02:00
Ilya Chernikov 295f2fd40a Fix GeneratedClassloader creation in scripts compilation, fixes test 2016-08-11 09:11:11 +02:00
Ilya Chernikov 6c0b78fb01 Add script-templates option to compiler options, fix templates and definitions loading in compiler 2016-08-11 09:08:40 +02:00
Alexander Udalov 0d26087040 CLI, Ant: add kotlin-reflect.jar to classpath by default, support "-no-reflect"
Note that now "-no-stdlib" implies "-no-reflect".

 #KT-13237 Fixed
2016-08-09 11:24:24 +03:00
Ilya Chernikov f73b8e80be Fixes after review 2016-08-03 09:51:40 +02:00
Ilya Chernikov 59712d4bf8 Implement updatable dependencies index with usage API in the environment for using in REPL 2016-08-03 09:51:40 +02:00
Pavel V. Talanov 999c8e7486 Refactor: rename KtLightClassForExplicitDeclaration -> KtLightClassForSourceDeclaration 2016-07-28 18:00:50 +03:00
Pavel V. Talanov cdbd7fbab0 Refactor: split classes in 'asJava' package into several subpackages to reflect their structure 2016-07-28 18:00:47 +03:00
Alexander Udalov 2c08796c45 Report ABI version incompatibility error always, not only if there are other errors
This is a radical but likely temporary measure to forbid the current compiler
from compiling code against binaries compiled by newer compilers

Cherry picked from commit 149a4eddff0106bbe91c9a6b51a26c12c242d14f and commit
285b20e3ff387eb3d2ee33ceaa376ed8eba90857
2016-07-21 15:03:52 +03:00
Alexander Udalov a533f8597d Fix debug names for some slices
Also move RUNTIME_ASSERTION_INFO and LOAD_FROM_JAVA_SIGNATURE_ERRORS to a
single class for simplicity
2016-07-05 18:18:26 +03:00
Alexey Andreev 33248e7721 KT-3008: minor code style fixes 2016-06-27 15:33:31 +03:00
Alexey Andreev 97605a97da KT-3008: multiple minor fixes after code review 2016-06-27 15:33:28 +03:00
Alexey Andreev 64cd0b70d7 KT-3008 Minor refactoring and clean up 2016-06-27 15:33:27 +03:00
Alexey Andreev b090b79d92 KT-3008 Add UI that allows to change module kind in IDEA Kotlin configurator 2016-06-27 15:33:26 +03:00
Alexey Andreev 848d7f92fa KT-3008 Implement AMD, CommonJS and UMD wrappers. Compile stdlib and builtins modules into separate JS files and wrap them in UMD. 2016-06-27 15:33:24 +03:00
Alexey Andreev 95b78e18df KT-3008 Change the way how modules are referenced in JS 2016-06-27 15:33:23 +03:00
Ilya Chernikov 8dac72f465 Add support for script classfiles caching 2016-06-25 22:24:34 +03:00