Commit Graph

55360 Commits

Author SHA1 Message Date
Alexander Udalov c666b60ca3 Support arrays of class literals in AnnotationDeserializer
#KT-28927 Fixed
2019-06-05 14:44:14 +02:00
Dmitry Gridin 52ec9e0fa8 Extract resolve from write action & cleanup AddOperatorModifierInspection
Relates to #KT-31533
2019-06-05 19:27:52 +07:00
Toshiaki Kameyama 4c62788c3e Make "Add operator modifier" an inspection instead of intention
#KT-31533 Fixed
2019-06-05 19:27:52 +07:00
Mikhael Bogdanov 5123e1f078 Add project property for workers count 2019-06-05 14:24:26 +02:00
Ivan Gavrilovic 7a2332fe36 KT-31714: Close files after analysis in incremental KAPT
Artifact transform used to analyze classpath was not closing files, which
caused java.nio.file.FileSystemException. This commit fixes that, and all
input streams are closed after use.

Fixes: KT-31714
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic 695f202e46 KT-31127: add only generated Java sources to JavaCompile inputs
This commit changes how generated sources are added to the Gradle JavaCompile
task. Previously, directory was added to sources which caused issues with
annotation processors that only generate Kotlin sources. I.e. JavaCompile task
was executed but no java sources existed.

Now, only generated Java sources are added to the JavaCompile task. This
means that if only Kotlin sources are generated JavaCompile task will be
skipped.

Fixes: KT-31127
Test: Kapt3IT.testKotlinProcessorUsingFiler
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic 55ba985cd2 KAPT: do not discover incremental APs only if cache is not set
KaptFlag.INCREMENTAL_APT is used to indicate that KAPT run
should try to be incremental because changes to input files and
classpath have been detected. However, first run of the Gradle
task will set this flag to false, which means that all APs will be
detected as non-incremental in the first run. Further on, this means
that the dependency caches will be invalid, and all subsequent runs
will be non-incremental as well.

This commit uses existence of dependency cache to determine if incremental
APs should be discovered. The regression was introduced in
72fdc648ff.

Test: ./gradlew :kotlin-gradle-plugin-integration-tests:testAdvanceGradleVersion --tests *KaptIncrementalWith*\
 && ./gradlew :kotlin-gradle-plugin-integration-tests:test --tests *KaptIncrementalWith*
2019-06-05 18:19:50 +09:00
Ivan Gavrilovic 1fa990b063 Support isolating APs that report multiple originating elements from the same file
It is possible for isolating annotation processor to report two or more
originating elements from the same source file when generating
sources/classes/resources. This commit makes sure the source file are
de-duped, so assertion that there is a single source file does not fail.

Test: IsolatingIncrementalProcessorsTest.testIsolatingWithMultipleOriginatingElements

This is improvement to https://youtrack.jetbrains.com/issue/KT-23880
2019-06-05 18:19:49 +09:00
Ivan Gavrilovic 76f62da6ae Improve constants analysis in KAPT
When analyzing source files in KAPT for incremental annotation processing,
avoid creating TreePath instances for initializers that are literals. E.g.
if it is just a boolean/int literal, we do not need to visit the tree nor
create expensive TreePath instance.

For classes that contain only constants (such as R.java for Android projects)
this is a significant improvement. Class that contains 16000 constants took
more than 10 seconds to analyze, now it is 70ms.
2019-06-05 18:19:49 +09:00
Yan Zhulanow 84c048ca81 Do not run task verification in NMPP tests on 183 platform as well 2019-06-05 18:17:45 +09:00
Ting-Yuan Huang 1b4d26e490 psi2ir: keep the type of when when possible
Ideally, the type of `IrWhen` should be provided by type inference for
a consistent behavior. `USED_AS_EXPRESSION` from CFG isn't always
consistent with type inference, unfortunately.

The behavior is now aligned with `if`. The type of `when` is kept when
it *can* be an expression, instead of whether it is used or not.
2019-06-05 10:23:44 +02:00
Svyatoslav Kuzmich cd651be461 [JS IR BE] Migrate JS BE to common klib utils 2019-06-05 11:15:45 +03:00
Mads Ager 0c586ef5c1 JVM_IR: Maintain annotations in SAM conversion.
Copy method and parameter annotations to the generated SAM
implementation method.
2019-06-05 08:21:59 +02:00
Dmitry Gridin bf9dde5c32 Fix assert from createExpression in RemoveRedundantQualifierNameInspection 2019-06-05 13:17:12 +07:00
Yan Zhulanow 09ff9a65a5 Fix 182 bunch tests, do not perform task tests on older platform versions 2019-06-05 13:27:38 +09:00
Yan Zhulanow a575c7e5b5 Minor: Fix NPE in BinaryModuleInfo, handle empty scopes 2019-06-05 13:27:38 +09:00
Mikhail Glukhikh 71590b6735 Introduce Kotlin language substitutor to fix exceptions in velocity files
Related to KT-31470 (should fix the problem or at least soften it)
May be related also to KT-30977
#KT-30886 Fixed
2019-06-04 23:30:02 +03:00
Abduqodiri Qurbonzoda 37dfbb3eba Workaround unpaired surrogates replacement with ? (KT-31614) 2019-06-04 21:25:41 +03:00
Sergey Rostov 1c0519b0a2 Gradle, js, npm: fix resolving transitive npm dependencies using yarn.lock
- already visited transitive npm dependencies should be stored in parent dependencies
- child NpmDependency should search resolved project data in parent NpmDependencies
2019-06-04 19:32:10 +03:00
Sergey Rostov 465a47a194 Gradle, js, npm: fix idea gradle sync for multiproject builds
npm resolver ProjectData stored per project (not in root project)
2019-06-04 19:32:10 +03:00
Sergey Rostov b5080bda75 Gradle, js, npm: fix reading package.json files
#KT-31788 Fixed
2019-06-04 19:32:10 +03:00
Sergey Rostov 32a0bb9f0e Gradle, js, npm: fix npm aggregated configuration attributes
#KT-31788 Fixed
2019-06-04 19:32:10 +03:00
ilgonmic 16200181cc KT-31645 Fix yarn downloading on Windows 2019-06-04 17:38:24 +03:00
Vyacheslav Gerasimov 7d38977f5e 192: Update since & until versions for 192 plugin 2019-06-04 16:34:33 +03:00
Mikhael Bogdanov 79074a7650 Specify JVM target for inline tests 2019-06-04 14:56:14 +02:00
Mikhael Bogdanov 81e6416bfe Support bound callable reference inlining in IR 2019-06-04 14:56:13 +02:00
Mikhael Bogdanov 3c093f321d Support unbound callable function references in inliner 2019-06-04 14:56:12 +02:00
Sergey Igushkin 0b59d0b416 Fix testAndroidMppProductionDependenciesInTests Gradle version too low
The required Gradle version for AGP 3.3 is 4.10.1+. Use 5.0.
2019-06-04 15:36:22 +03:00
Dmitriy Dolovov ef680cf332 KLIB reader: Add missed JARs to IDEA plugin 2019-06-04 12:40:56 +03:00
Yan Zhulanow bc6f01805e Fix JVM test running in MPP projects (KT-30814) 2019-06-04 17:56:05 +09:00
Mikhail Zarechenskiy 6d3a7102d5 Fix evaluation of local functions for new-inference
Plus, additionally fix evaluation of generic local functions everywhere

 The problem was that in new-inference we create more substituted
 descriptors while old inference tries to preserve original ones.
 Later, backend fails to retrieve those descriptors as it uses originals.
 But, again, this worked only for simple functions, for generic functions
 debugger with new and old inference worked incorrectly

 #KT-31785 Fixed
2019-06-04 11:07:50 +03:00
Sergey Rostov 8dabf24b41 Gradle: provide descriptions for JS tasks
#KT-31560 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov fbefa17337 Gradle, NPM, windows: creating symlink without administrator privilege
#KT-31694 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov 85adee9804 Gradle, js, npm: resolve and warn about clashes in packages_imported
#KT-31697 Fixed
2019-06-04 10:00:59 +03:00
Sergey Rostov 46a1ec28bf Gradle, npm: implement semver comparision 2019-06-04 10:00:58 +03:00
Sergey Rostov 619ee8717b Gradle, npm: extract semver utils to separate file 2019-06-04 10:00:58 +03:00
Sergey Rostov 42bcb81c08 Gradle, npm, imported packages: import multiple version to different dirs 2019-06-04 10:00:58 +03:00
Sergey Rostov e557a3c3f2 Gradle, ProcessedFilesCache: delete everything on version change 2019-06-04 10:00:57 +03:00
Sergey Rostov 5b6c467e22 Gradle, ProcessedFilesCache: report target values clash 2019-06-04 10:00:57 +03:00
Sergey Rostov 5b21c935a4 Gradle, JS, NpmResolver: save imported packages cache state before calling npm 2019-06-04 10:00:56 +03:00
Sergey Rostov fdbee7a99a Gradle, js, NPM: select one version between tools and all of compile configurations
#KT-31696 Fixed
2019-06-04 10:00:56 +03:00
Sergey Rostov a37b38e891 Gradle, minor: remove unused import 2019-06-04 10:00:56 +03:00
Mikhael Bogdanov bce774eda5 Jvm Ir. IrIntrinsicMethods.kt optimization: avoid 'IrClass.functions' call if it not necessary 2019-06-04 08:45:46 +02:00
Mikhael Bogdanov 30ab11575d Jvm Ir. Optimization: avoid 'IrClass.functions' call if it not necessary 2019-06-04 08:45:45 +02:00
Dmitriy Dolovov 171e226d58 Move 'cidrPluginsEnabled' Gradle flag to local.properties 2019-06-04 08:42:47 +03:00
Dmitriy Dolovov bbdb5e5f0f Reworked joint build (kotlin + kotlin-ultimate)
- Root buildscript classpath no more depends on buildSrc.jar from kotlin-ultimate. This allows to have stable joint builds - w/o occasional "Unresolved reference" errors in buildscripts.
- kotlin-ultimate modules are now included into Kotlin project when two conditions are met: 1) Gradle parameter 'cidrPluginsEnabled' is turned on; 2) kotlin-ultimate Git repo is checked out right to the Kotlin project root (assuming there is 'kotlin-ultimate' directory inside the project root).
2019-06-04 08:42:22 +03:00
Igor Yakovlev db4ba238eb Avoid to call delegate from isInheritorDeep in UL-class
(plus small refacrotoring)
2019-06-03 17:23:41 +03:00
Igor Yakovlev eaa36d4d27 Fix kotlin.Deprecated annotation for UL-classes 2019-06-03 17:23:41 +03:00
Igor Yakovlev 2a729082a0 Add UltraLightFacadeClassTest 2019-06-03 17:23:41 +03:00
Igor Yakovlev 8707edfaa3 Disable to mangling facade functions + refactoring 2019-06-03 17:23:40 +03:00