Commit Graph

1764 Commits

Author SHA1 Message Date
Ilya Chernikov a96a938f87 Fix creating of the script definition from legacy template
adding classpath needed to load template and related class to the
appropriate host configuration
fixes tests
2019-07-08 13:20:06 +02:00
Leonid Startsev 4379780ff8 Fixed extra argument in function call after rebase 2019-07-05 18:48:51 +03:00
Leonid Startsev 80ddac64e0 Add serializers for primitive arrays to default types list 2019-07-05 18:14:34 +03:00
Ilya Chernikov 4940f64265 Refactor scripting infrastructure - convert usages to the new entities 2019-07-05 17:02:10 +02:00
Nicolay Mitropolsky 5d081efe60 Uast: tests for no implicit returns in lambdas (KT-32370) 2019-07-04 10:53:48 +03:00
Nicolay Mitropolsky a180d78eaf Uast: implicit returns for local function bodies (KT-32370) 2019-07-04 10:53:48 +03:00
Nicolay Mitropolsky f85ebe7f43 Uast: implicit returns for lambda expressions (KT-32370) 2019-07-04 10:53:48 +03:00
Nikolay Krasko 8b05d4df46 More NoClassDefFoundError fixes in tests after 192 update 2019-07-02 16:45:42 +03:00
Leonid Startsev 7ef9fb5511 Export deserialization constructor from JS module
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/443
2019-07-01 14:56:10 +03:00
Vyacheslav Gerasimov db3b01d2d4 Build: Centralize compiler dist build logic in :kotlin-compiler project 2019-06-27 17:56:48 +03:00
Vyacheslav Gerasimov 6cf5514f6e Build: Fix jps import for jvm-abi-gen plugin 2019-06-27 17:56:47 +03:00
Leonid Startsev a3218da1c3 Add IDE diagnostic on @Serializable classes for non-applied serialization plugin 2019-06-27 15:55:38 +03:00
Nikolay Krasko b7c12014ee Modify dependencies for 192 branch: more dependencies to full java plugin 2019-06-26 14:11:23 +03:00
Ilya Chernikov 432d500c40 Fix custom script definition cashing and script validity check:
- reorder initialization logic, so that script definitions are
  requested only after plugins loading
- clear definitions cache after adding explicit definitions or sources

#KT-32206 fixed
#KT-32169 fixed

Note: any of these modification fix the problem alone, but the second
may prevent other similar problems, while the first fixes actual logic
of the script validity checks as well.
2019-06-26 13:01:39 +02:00
Nikolay Krasko beb1bc09d4 Update to 192.5118.30 2019-06-25 11:48:59 +03:00
Vyacheslav Gerasimov 55f86af67f Build: Fix test runtime for source-sections-compiler-plugin tests 2019-06-14 19:42:28 +03:00
Vyacheslav Gerasimov 986e1ceefb Build: Fix test runtime for sam-with-receiver-compiler-plugin tests 2019-06-14 19:38:13 +03:00
Vyacheslav Gerasimov e32bbcecc2 Build: Fix test runtime for kotlinx-serialization-compiler-plugin tests 2019-06-14 18:18:08 +03:00
Vyacheslav Gerasimov 5a664a86a8 Build: Fix test runtime for kotlin-scripting-compiler tests 2019-06-14 18:10:24 +03:00
Vyacheslav Gerasimov e8e457a16c Build: Fix uast compilation against 192 platform 2019-06-13 21:57:57 +03:00
Vyacheslav Gerasimov 0514437fba Build: Workaround scripting dependencies on full Idea 2019-06-13 21:03:55 +03:00
Vyacheslav Gerasimov 5a39c637c2 Build: Fix intellij dependency leak from ir tree module 2019-06-13 21:03:55 +03:00
Yan Zhulanow bd342e765d SamWithReceiver: Fix IDE plugin JAR name 2019-06-13 17:33:24 +09:00
Yan Zhulanow bc0f10449a Kapt: Fix source root importing in MPP projects 2019-06-13 17:33:24 +09:00
Yan Zhulanow 9eab9f386d Activate Kapt importer only for JVM compilations (KT-30578) 2019-06-13 17:33:24 +09:00
Leonid Startsev b78d84c120 Add some tests for kotlinx.serialization plugin:
- declaration checker
- bytecode listings
- JVM IR

Improve @Transient redundant reporting
2019-06-11 19:32:40 +03:00
Leonid Startsev 414c116d93 Fix too strict serializer lookup for generic type parameters 2019-06-10 16:49:19 +03:00
Vyacheslav Gerasimov 5bde9720b7 Build: Fix dependencies on :kotlin-compiler project
Dependencies on :kotlin-compiler should never be used in configurations
which are imported transitively because ide fails to import it as
project dependency. When :kotlin-compiler dependency is imported as
kotlin-compiler.jar dependency ide re-indexes it on every change. This
behaviour is super annoying.

 #KT-31120 Fixed
2019-06-08 19:36:28 +03: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
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
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
Mikhail Zarechenskiy e15cb67e29 Fix exception from UAST on attempt to map non-fixed type variable
#KT-31723 Fixed
 #EA-126269 Fixed
 #EA-143705 Fixed
 #EA-143703 Fixed
 #EA-143694 Fixed
2019-06-03 02:04:56 +03:00
Mikhail Zarechenskiy 91bd11a6db Fix UAST tests for new-inference: adapt SAM-converted descriptors 2019-06-03 02:04:55 +03:00
Mikhail Zarechenskiy 010ac50243 Enable new type inference for UAST tests as for IDE tests 2019-06-03 02:04:53 +03:00
Vyacheslav Gerasimov cf3a98123f 192: Fix uast tests compilation for 192 platform 2019-05-31 16:32:10 +03:00
Vyacheslav Gerasimov 979df225a7 192: Fix uast-kotlin for 192 platform 2019-05-31 16:32:09 +03:00
Ilya Chernikov e95569a273 Report definition-related error diagnostic on the whole script file
#KT-31452 fixed
2019-05-31 13:34:17 +02:00
Alexander Udalov ceecbfdcea Minor, fix kapt test data on comments
ClassFileToSourceStubConverter relies on JvmDeclarationOrigin which is
used in the codegen, and that origin has slightly changed for the
synthetic '$annotations' method (see
`MemberCodegen.generateSyntheticAnnotationsMethod`) in e9b50157
2019-05-30 19:30:46 +02:00
Dmitry Savvinov d5fbe59a3e [Platform API] Introduce fundamental abstraction of Platform
This is a large commit, which introduces general API for working with
abstraction of Platform.

- Add new abstraction to 'core' - SimplePlatform - which represents
exactly one platform
  - Clients are strongly prohibited to create instances of SimplePlatform
  by hand, instead, corresponding *Platforms abstraction should be used
  (e.g. JvmPlatforms, JsPlatforms, KonanPlatforms)

- Move TargetPlatform to 'core', it represents now a collection of
SimplePlatforms
  - Clients are strongly encouraged to use TargetPlatform
    (not SimplePlatform) in API, to enforce checks for multiplatform

- Provide a helper-extensions to work with TargetPlatform
(in particular, for getting a specific component platform)

- Remove MultiTargetPlatform in favour of TargetPlatform
  - Notably, this commit leaves another widely used duplicated abstraction,
    namely, IdePlatform. For the sake sanity, removal of IdePlatform is
    extracted in the separate commit.
2019-05-28 13:08:07 +03:00
Ilya Chernikov e7c99cd494 Fix scripting-compiler tests, add them to the global scriptingTest task 2019-05-25 10:10:34 +02:00