Commit Graph

201 Commits

Author SHA1 Message Date
Mikhail Bogdanov 929bb0e8d1 Move common logic from CodegenTestCase to KotlinBaseTest 2020-06-19 11:57:36 +02:00
Alexander Udalov 6e67e1e78d Replace appendln with appendLine in project 2020-06-11 13:01:30 +02:00
Yan Zhulanow 2044ece335 Kapt: Add DUMP_DEFAULT_PARAMETER_VALUES flag (KT-29355)
Put initializers on fields when corresponding primary constructor
  parameters have a default value specified. The new behavior
  is available under the new 'DUMP_DEFAULT_PARAMETER_VALUES' flag.

Note that this doesn't affect regular functions with default parameter
  values, as well as primary constructor parameters without a
  'val' or 'var' keyword.
2020-05-27 02:38:42 +09:00
Yan Zhulanow 60aa47553d Kapt, minor: Move test logic for KaptFlags to the new base class 2020-05-27 02:38:42 +09:00
Dmitry Petrov b89878a509 Update testData for KAPT tests for new inline class ABI
Since class member functions returning inline class values are now
mangled, they are not visible from Java.
2020-05-21 13:56:57 +03:00
Ilya Gorbunov 5eabc1117f Generate constant expression initializers for special fp values in kapt
Update new constant values propagated in kapt class-to-stub test
2020-04-01 08:06:57 +03:00
Vyacheslav Gerasimov f735396ffb Build: Make toolsJarApi() helper for JPS build 2020-03-10 17:24:21 +03:00
Vyacheslav Gerasimov ef169aa12b Build: Use preprocessed tools.jar for compilation
tools.jar from JDK has different public api on different platforms which
makes impossible to reuse caches for tasks which depend on it. Since we
can't compile against those classes & stay cross-platform anyway, we
may just exclude them from compile classpath. This should make tools.jar
compatible at least within one build of JDK for different platforms
2020-03-10 17:24:21 +03:00
Mikhael Bogdanov a795c38eb7 Introduce base class for codegen and diagnostic tests
Extract base TestFile and TestModule classes.
 Move coroutinePackage related logic to base class
2020-03-04 14:51:10 +01:00
Vyacheslav Gerasimov 0db69cadb6 Build: Make all compile dependencies on toolsJar compileOnly
tools.jar differs between different versions of JDK reducing cache reuse
so better to not leak it to other modules
2020-02-29 16:35:54 +03:00
Nikolay Krasko 162c2f3dc9 201: openapi.jar is removed 2020-02-11 20:27:59 +03:00
Yan Zhulanow 36a6eedd9c Minor: Update generated tests for KT-34569 2020-02-10 21:25:01 +09:00
Yan Zhulanow 9bf63f5399 Kapt, minor: Add extra case for property initializers 2020-01-24 18:12:21 +09:00
Kevin Bierhoff 6d32b3256b suppress duplicate @Override annotations 2020-01-24 18:12:21 +09:00
Yan Zhulanow 520f9a6da5 Kapt: Support all kinds of constant types (KT-35536) 2020-01-20 17:39:22 +09:00
Dmitriy Novozhilov 76b3964e96 Update testdata according to change compiler version to 1.4 2020-01-17 10:33:50 +03:00
Alexander Udalov 8a4510c21b Regenerate tests 2020-01-02 10:31:00 +01:00
Ivan Gavrilovic eab6864269 KT-35536: Fix enum constants in KAPT
Enum constants are Pair, so make sure to unpack them correctly.
2019-12-24 15:14:47 +09:00
Dmitriy Novozhilov e7f8c8e155 [TEST] Regenerate tests after previous commit 2019-12-12 16:11:45 +03:00
Mikhael Bogdanov 8225c5a9ce Remove obsolete logic to IS_BUILT_WITH_ASM6 2019-12-11 13:49:34 +01:00
Alexander Udalov fd627603a0 Refactor CompilationErrorHandler
It only had one implementation THROW_EXCEPTION, inline it everywhere
with a call to a static method
2019-12-03 10:48:34 +01:00
Alexander Udalov ce09be3f59 Add TargetBackend.isIR, simplify JVM IR test configuration 2019-11-11 12:10:29 +01:00
Georgy Bronnikov 688a2185fa Tests for Kapt3 with JVM_IR backend 2019-11-07 13:28:09 +03:00
Georgy Bronnikov 51459adb8c Add integration test for Kapt3+IR 2019-11-04 11:26:45 +03:00
Georgy Bronnikov 195f225e36 Run Kapt3 with old backend, even if IR is specified in configuration
Kapt does not currently work with IR backend. Temporarily switch to the
old JVM backend when running it.
2019-11-04 11:26:45 +03:00
Yan Zhulanow 6bf15b6d37 Kapt: Generate constant value initializers for mutable properties (KT-30164, KT-29355) 2019-10-24 21:33:01 +09:00
Yan Zhulanow 9edd4554a9 Kapt: Support @Deprecated annotations (KT-30368) 2019-10-24 21:33:01 +09:00
Nikolay Krasko 4ed64b0283 Regenerate tests with TargetBackend.ANY remove and using runTest with this 2019-10-23 12:49:48 +03:00
Ivan Gavrilovic 4e807692e5 KT-34167: Warn when incremental AP does not follow the contract
Isolating incremental AP must report exactly one originating source file.
This commit logs a warning when this constraint is violated.

Test: AnnotationProcessorDependencyCollectorTest.testIsolatingWithoutOrigin
2019-10-16 16:33:00 +09:00
Yan Zhulanow a4c8ccee06 kapt: Fix compilation in 'compile' running mode (KT-33800) 2019-10-08 19:13:57 +09:00
Ivan Gavrilovic 573e7f2eee Run JDK11 tests for KAPT only if JDK11 is available
Otherwise, just skip running them.
2019-09-23 17:32:37 +09:00
Ivan Gavrilovic 0cdfe89a26 KT-33052: Fix KAPT stub generation for enums on JDK11
When using JDK11, generating stubs for enums is broken.
This commit handles the faulty generation by JDK11 by
fully printing enums in custom implementation of tree
printing.

Test: added JDK11 tests for KAPT stub  generation
2019-09-20 00:04:27 +09:00
Ivan Gavrilovic 60fa632d02 KT-33515: Remove Kotlin sources generated by KAPT
When KAPT is unable to run incrementally make sure to
clean directory that contains generated Kotlin sources.
This location is specified using '-Akapt.kotlin.generated'
option.
2019-09-20 00:04:27 +09:00
Nikolay Krasko 8ae4293a0f Remove 181 branch from build scripts
#KT-33536 Fixed
2019-08-30 12:14:54 +03:00
Alexander Udalov 01ddac58e1 Add language feature for changed name of property annotations method
#KT-31352 Fixed
2019-08-12 16:48:26 +02:00
Alexander Udalov ea0142da60 Use JVM name of getter in synthetic method for property annotations
#KT-31352 In Progress
2019-08-12 16:48:25 +02:00
Yan Zhulanow ccff347ffc Kapt: Attach generated Kotlin sources in 'compilation' mode (KT-32535) 2019-07-26 02:40:32 +09:00
Ivan Gavrilovic 1c63d3aa2f KT-32210: Handle long compiler plugin options
Some of the KAPT compiler plugin options were longer than 0xFFFF bytes in
UTF-8 encoding, causing UTFDataFormatException when serializing them. This
commit avoids that issue by encoding changed files and changed classpath types
one by one instead of joining them to a single string.
2019-07-26 02:40:32 +09:00
Alexander Udalov c27d9c4546 Use TypeSystemCommonBackendContext in KotlinTypeMapper.writeGenericArguments 2019-07-17 13:55:36 +02:00
Vyacheslav Gerasimov db3b01d2d4 Build: Centralize compiler dist build logic in :kotlin-compiler project 2019-06-27 17:56:48 +03:00
Nikolay Krasko b7c12014ee Modify dependencies for 192 branch: more dependencies to full java plugin 2019-06-26 14:11:23 +03:00
Nikolay Krasko beb1bc09d4 Update to 192.5118.30 2019-06-25 11:48:59 +03: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
Yan Zhulanow a0778ad703 Revert "Kapt: Always use raw types for annotation parameter types (KT-30346)"
This reverts commit 66754e62
2019-05-23 19:09:27 +09:00
Alexander Udalov b602c08773 Remove javaFilesDir parameter of CodegenTestCase.doMultiFileTest
Create TestFile instances for .java sources similarly to .kt sources,
and write them to a temporary directory via writeJavaFiles in each test
where this is needed
2019-05-15 13:25:14 +02:00
Mikhael Bogdanov d1b5c76f09 Reuse KtUsefulTest case temporary files infrastructure 2019-04-25 08:09:26 +02:00
nikita.movshin 65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Dmitry Gridin 3bed360c98 Fix "Should be replaced with Kotlin function" warnings 2019-04-18 15:28:52 +07:00
Mikhael Bogdanov 0d3f03a15a Support parallelization in another IDE tests 2019-04-17 11:22:18 +02:00