Commit Graph

406 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
Ilya Chernikov
5e33612238 Extract interface from CompilerMessageLocation to ease extension
The CompilerMessageLocation is an implicit part of the binary daemon
protocol so changing it breaks compatibility with older daemons.
This change allows to extend location for non-daemon uses without
breaking the binary protocol.
2020-06-05 21:58:27 +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
Yaroslav Chernyshev
0b8c497d2e [Import] Downgrade jvmTarget & move Models and ModelBuilderServices
Fixed KT-35921
Fixed KT-36673
2020-05-12 16:52:01 +03:00
Ilya Chernikov
1fb325d56e Fix generateTests task
adding TestMessageCollector that was moved with daemon tests back
2020-04-21 18:04:22 +02: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
Alexander Udalov
8e2b76698a Remove -Xno-use-ir from modules where JVM IR problems are fixed
The problems in JVM IR backend in these modules are fixed by:
* kapt3-cli -- 1c527fc1
* frontend -- 174b3db7
* daemon-common-new -- 6fe214d8 & d17afdda
2020-01-21 15:09:29 +01: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
c3d5a88e52 Add -Xno-use-ir to compiler modules where JVM IR currently fails
This option has no effect on the production code. But in a custom
scenario of a local bootstrap, where the compiler is replaced with the
one where JVM IR backend is enabled by default, this option allows to
switch back to the old backend.

All of these arguments (except the one for compiling experimental
coroutines) are supposed to go away as soon as we fix related problems
in the JVM IR backend.
2020-01-16 12:21:47 +01: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
Michael Kuzmin
254dc8f71c Build: Drop IntelliJ 2018.3 and Android Studio 3.4 support
Delete *.183 and *.as34 bunch-files
2019-12-19 18:31:07 +03: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
Ivan Gavrilovic
d269c194c7 Fix java version parsing in KAPT
Handle case when "java.version" returns
"11" or "12". Previously, we expected it to
contain at least one dot in the version string.
2019-11-22 16:06:35 +09:00
Ivan Gavrilovic
f4c6f57354 KT-34194: Pass error/NonExistentClass for incremental KAPT run
When running KAPT incrementally, make sure to pass error/NonExistentClass.java
when there is at least one source file to process. This is to make sure
APs that must resolve all types are able to do so.

Test: updated KaptIncrementalWithAggregating/WithIsolating
2019-11-22 16:06:34 +09: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
Vyacheslav Gerasimov
3b088818a5 Build: Add sources and javadocs to Kotlin Plugin publication 2019-11-01 16:22:42 +03:00
Vyacheslav Gerasimov
38ea5a85a3 Build: Add maven publication for Kotlin plugin artifacts 2019-10-24 17:06:19 +03:00
Ivan Gavrilovic
68723125f2 Clean up KAPT incremental tests
Remove redundant class to invalidate sources, because it is already
handled in the KaptContext constructor.
2019-10-24 21:33:01 +09: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
Yan Zhulanow
f93549748a Fix a number of compiler/IDE warnings in IDE and kapt modules 2019-10-24 21:32:57 +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
Ivan Gavrilovic
8f94a71de7 KT-33617: Handle non-hierarchical URIs for incremental annotation processing
JDK9 may decide to load .java files from jar when resolving a type, even
when .class file exists in the same jar. Further on, these files will be
parsed and analyzed, which triggers the listener used by incremental
annotation processing. This commit avoids analyzing those files, and
makes sure URI passed from the compiler are such that a File instance
can be created.

Test: KaptIncrementalWithIsolatingApt.testSourcesInCompileClasspathJars
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
Vyacheslav Gerasimov
c1e1dbd83e Build: Fix usages of "java.home" for tools.jar dependency
#KT-33984
2019-09-25 17:54:18 +03:00
Ivan Gavrilovic
4da6675640 Do not depend on BaseFileObject type for incremental KAPT
This class does not exist in JDK9, so running incremental KAPT on
JDK9 fails. Because it is used only to get the name of the file,
this has been replaced with usage of the public JavaFileObject API.
2019-09-25 19:21:10 +09:00
Ivan Gavrilovic
aaa00b0f6f KT-33889: Do not use private non-API methods from JavacProcessingEnvironment
Avoid using JavacProcessingEnvironment.validImportStringToPattern method
because it has been removed in JDK9. This commit changes how we compute
pattern to match the class names, and it create instances of Pattern
manually by following spec for Processor.getSupportedAnnotationTypes().
Support for module prefix is not added yet.
2019-09-25 19:21:10 +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