Commit Graph

55400 Commits

Author SHA1 Message Date
Dmitry Gridin 8b0b135112 Add new line after modifier list if last child is comment
#KT-30804 Fixed
2019-06-07 12:23:06 +07:00
Alexander Udalov fec9ee6408 Minor, add kdoc for typeOf 2019-06-07 00:29:35 +02:00
Mikhail Zarechenskiy 42b7552d17 Fix exception on attempt to map inner non-fixed type variable
#KT-31842 Fixed
2019-06-07 01:18:47 +03:00
Ilya Chernikov e542c9ea84 Refactor script definitions and resolving/refining infrastructure:
- implement wrappers to wrap old and new API providers and resolvers
- make old API deprecated (with error where possible)
- drop old internal classes related to the old API
- refactor usages accordingly
- fix and add missing features to the scripting API where necessary
2019-06-06 17:21:00 +02:00
Ilya Chernikov e5054f9648 Refactoring scripting infrastructure:
- add a helper for new constructing Compilation Configuration only when necessary
- add more converters for legacy diagnostics
- add helpers for simpler creating of failure results
2019-06-06 17:21:00 +02:00
Ilya Chernikov b7fd898bb8 Add explicit return types to helpers
also workarounds a problem (KT-30297) with new inference
2019-06-06 17:21:00 +02:00
Ilya Chernikov 4fb2f81134 Refactor scripting - prepare utilities for refactoring of the script definitions handling 2019-06-06 17:20:59 +02:00
Andrey Uskov 5efd55f530 Fix memory leak on project reimport
#KT-31843 Fixed
2019-06-06 17:11:07 +03:00
Ting-Yuan Huang a447c748bc JVM_IR: support @JvmDefaults in compatibility mode. 2019-06-06 14:10:28 +02:00
Toshiaki Kameyama 1c32941949 Use property access syntax: don't report when setter argument is lambda
#KT-30627 Fixed
2019-06-06 18:53:15 +07:00
Sergey Rostov a3f8987255 JPS Build: fix importing artifacts
For some reason, gradle.projectsEvaluated callback evaluates after IDEA
import script gathers all project models. So, all jps related project
settings (including artifacts configurations) won't be imported.

We need only :prepare:idea-plugin evaluated. So replacing
gradle.projectsEvaluated to root Project.afterEvaluate and
 forcing evaluation of :prepare:idea-plugin fixes the problem.
2019-06-06 11:00:58 +03:00
Sergey Rostov 8995d89599 Gradle, js, karma: don't run karma if no browsers configured
#KT-31662 Fixed
2019-06-06 09:15:40 +03:00
Sergey Rostov 97fc3fe989 Gradle, js, karma: use ^4.0.0-rc.6 to use webpack 3, require webpack
#KT-31564 Fixed
2019-06-06 09:15:40 +03:00
Sergey Rostov eab577001b Gradle, js, npm simple linker: fix creating junction on windows 2019-06-06 09:15:40 +03:00
Sergey Rostov 96fc06c7fb Gradle, js, tests: use compilation runtime classpath as input
#KT-31814 Fixed
2019-06-06 09:15:39 +03:00
Ilya Matveev f32d48c66d Gradle, tests: Fix native interop test for Win x86 2019-06-06 12:53:02 +07:00
Ilya Matveev dd941ffa93 Project wizard tests: Bump Gradle plugin version to use test binaries 2019-06-06 12:53:01 +07:00
Ilya Matveev e8e2a5654e IDEA plugin: Use new test binary getter in project templates
Issue #KT-31724 fixed
2019-06-06 12:53:01 +07:00
Ilya Matveev 2ab0760e35 Gradle, native: Fix creating test binaries for non-host platforms
Issue #KT-31725 fixed
2019-06-06 12:53:01 +07:00
Dmitry Gridin afa9a80b3a Fix multi module tests for AddOperatorModifierInspection 2019-06-06 12:09:28 +07:00
Ilya Kirillov 201bf328ca New J2K: print new line before init section because of bad formatting 2019-06-05 23:41:49 +03:00
Ilya Kirillov ca23eb44a1 New J2K: add type star projections for converted classes raw references
#KT-31818 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov 845cde2d23 New J2K: do not add star projection type for raw class literal expression
#KT-15791 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov f75a7cbfc9 New J2K: fix test data for java8MapForEachWithFullJdk test 2019-06-05 23:33:12 +03:00
Ilya Kirillov a56155ca73 New J2K: correctly handle vararg annotation parameter of external Java class
#KT-31726 fixed
2019-06-05 23:33:12 +03:00
Ilya Kirillov 58611ec417 New J2K: add test data for #KT-16662, #KT-15991, #KT-12050 2019-06-05 23:33:12 +03:00
Ilya Kirillov c1e24d818b New J2K: fix NPEs in nullability analysis
#KT-31817 fixed
2019-06-05 23:33:11 +03:00
Ilya Kirillov 1a9deed5d8 New J2K: add conversion progress bar
Relates to #KT-31812
2019-06-05 23:33:11 +03:00
Ilya Kirillov f51e28ea68 New J2K: commit file after each post-processing
#KT-31809 fixed
2019-06-05 23:33:11 +03:00
Ilya Kirillov 0623fa4349 New J2K: reformat JavaToKotlinAction.kt 2019-06-05 23:33:11 +03:00
Ilya Kirillov aaab1fe134 New J2K: suggest user to configure Kotlin in a project before nj2k conversion 2019-06-05 23:33:11 +03:00
Leonid Startsev 3792c44378 Make short path for non-serializable classes and other improvements:
Adjust some error messages
Add 'fallbackElement' to report on when property is implicitly typed
Split findTypeSerializerOrContext into checked and unchecked versions
2019-06-05 19:13:03 +03:00
Leonid Startsev dc79b99dd2 Implement inspection about no-arg constructor in non-serializable supertype 2019-06-05 19:11:18 +03:00
Leonid Startsev 8f77b55ada Retrieve serializable properties from binding context in most of the places
Remove unused record 'SERIALIZER_FOR_PROPERTY'
2019-06-05 19:11:18 +03:00
Leonid Startsev fe1f36bc02 Report an error on @Serializable inline classes and missing @Transient initializers 2019-06-05 19:12:34 +03:00
Leonid Startsev e6d96f1de9 Implement diagnostic about nullable serializer for non-nullable type 2019-06-05 19:12:00 +03:00
Leonid Startsev 6895184b84 Implement basics diagnostics reporting from the serialization plugin similarly to noArg and allOpen plugins 2019-06-05 19:11:20 +03:00
Leonid Startsev d3a596e3c2 Correctly copy init blocks code to deserialization constructor
Fixes https://github.com/JetBrains/kotlin-native/issues/3019

Workaround problem with proguard and inline reified functions
2019-06-05 17:44:34 +03:00
Leonid Startsev 6370f0b3be Correctly reference deserialization constructor added by plugin
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/472
2019-06-05 17:43:46 +03:00
Alexander Udalov 43cb17cdd5 Check expected type of annotation parameter correctly in AnnotationDeserializer
The main idea of this refactoring is to separate two usages of
`AnnotationDeserializer.resolveValue`: the one where we load annotation
argument values, and the one where we load constant values of properties
for JS/Native/Common
(`AnnotationAndConstantLoaderImpl.loadPropertyConstant`).

In the latter case, `expectedType` is the type of the property and it
can be a supertype of the actual value (e.g. see `arrayConst` in
compiler/testData/serialization/builtinsSerializer/compileTimeConstants.kt).
But in the former case, we need to check that the value conforms to the
expected type and disregard it if it's not the case, which is possible
if the annotation was recompiled separately.

 #KT-28927
2019-06-05 14:44:15 +02:00
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