Commit Graph

124 Commits

Author SHA1 Message Date
Ilya Chernikov b4c9422376 Rearrange and rename idea-plugin related and annotation-processing modules 2017-09-19 23:58:37 +02:00
Alexander Podkhalyuzin 3f8170d369 Clean idea files generated on the gradle import, add them to .gitignore 2017-09-19 23:58:27 +02:00
Ilya Chernikov deda50dbbb Continue switching projects to improved dsl: sourceSets and test running 2017-09-19 21:37:26 +02:00
Ilya Chernikov 61dfb75e0e Implement Gradle Kotlin DSL build 2017-09-19 21:37:06 +02:00
Yan Zhulanow 4ac8a98050 Kapt: Hide fake "Error while annotation processing" error in Android Studio build console 2017-09-14 19:16:54 +03:00
Nikolay Krasko 6b14d15374 Clean state in AbstractKotlinKapt3IntegrationTest 2017-09-08 12:56:28 +03:00
Yan Zhulanow cea891c754 Kapt: Do not replace '/' with dots before converting to fqName (KT-19680)
getQualifiedName() converts slashes by itself, and it causes the internal name equality check (it.name == classFromSources.name) to fail.
This reproduces only for the pure synthetic classes (for which we don't generate Java light classes).
2017-09-06 17:40:19 +03:00
Yan Zhulanow 04c2e28341 Kapt: Do not use awkward ('$' -> '/') logic for KAPT3 class builder mode
So (for the most often reproduction case) #KT-19433 Fixed

Before this commit, internal names for nested classes were written as test/Foo/Bar (comparing to test/Foo$Bar in the normal mode), as getting qualified names from such internal names was trivial. But, because of IC, we needed to write class files to the disk, so our decompiler could find such "broken" classes and read it in a wrong way.
2017-09-06 17:40:18 +03:00
Yan Zhulanow 84e59601c1 Kapt: Generic arguments in anonymous type should always be mapped to boxed types (KT-19750) 2017-09-06 17:40:17 +03:00
Yan Zhulanow 4d9a612a64 Kapt: Substitute type parameters from the actual type, not from the anonymous one (KT-19700) 2017-09-06 17:40:16 +03:00
Yan Zhulanow 57d209f599 Kapt: Do not use awkward ('$' -> '/') logic for KAPT3 class builder mode
So (for the most often reproduction case) #KT-19433 Fixed

Before this commit, internal names for nested classes were written as test/Foo/Bar (comparing to test/Foo$Bar in the normal mode), as getting qualified names from such internal names was trivial. But, because of IC, we needed to write class files to the disk, so our decompiler could find such "broken" classes and read it in a wrong way.
2017-08-15 17:48:51 +03:00
Yan Zhulanow 4dddb00aca Kapt: Fix "Anonymous class types are not rendered properly in stubs" (KT-18682) 2017-08-02 03:21:14 +03:00
Alexander Udalov 46a01ec131 J2K PathUtil: convert and prettify 2017-07-28 14:11:35 +03:00
Yan Zhulanow 92558ad183 Minor: Clarify module name in warning message about empty output classpath/output directories 2017-07-26 20:19:31 +03:00
Yan Zhulanow a983137978 Kapt: Handle parameter with Java names clashing with Java keywords properly (KT-18377) 2017-07-12 00:17:23 +03:00
Yan Zhulanow e7e0032cc8 Kapt3, minor, tests: Weaken regular expression for Metadata shrinking 2017-06-28 10:25:08 +03:00
Alexander Udalov 2ed027219c Remove dependency of module 'frontend' on 'plugin-api'
This breaks the circular dependency between them
2017-06-06 14:29:25 +03:00
Yan Zhulanow 4f132f6d40 Kapt: Fix output file reporting in IC
Fix REPORT_OUTPUT_FILES option passing to GenerationState created in kapt.

This fixes these tests:
Kapt3Incremental.testChangeAnnotatedPropertyType()
Kapt3Incremental.testRemoveAnnotations()
Kapt3Incremental.testRemoveSourceFile()
2017-05-30 22:09:20 +03:00
Yan Zhulanow 7220183912 Kapt: Write @kotlin.Metadata annotation to Java stubs #KT-17937 2017-05-25 21:28:47 +03:00
Yan Zhulanow 141f12e71b Minor: Commit forgotten kapt test data 2017-05-25 21:28:40 +03:00
Yan Zhulanow 87f3b574aa Kapt: Filter the content root items for the compile classpath properly 2017-05-23 16:45:40 +03:00
Yan Zhulanow 5ec16167bc Kapt: Preserve parameter names for abstract methods 2017-05-23 16:45:29 +03:00
Yan Zhulanow 1a342faf38 Kapt3: Ignore packages with Java keywords inside (KT-17184) 2017-05-23 16:45:19 +03:00
Yan Zhulanow 1c5765628e Kapt3: Fix flaky integration tests on Windows agents 2017-05-23 16:45:14 +03:00
Yan Zhulanow 7bbf9861d0 Kapt3: Simplify handling of annotation processing exceptions
The previous handling method was unreliable ("Don't know how to render diagnostic of type KAPT3_PROCESSING_ERROR", exceptions being lost).
2017-05-04 19:59:30 +03:00
Yan Zhulanow 3bf534b392 Kapt3: Support apt modes
Allow to run kapt in "annotation processing only" and "stub generation only" modes in order to support incremental compilation in Gradle.
Unfortunately, annotation processing can't be done incrementally cause it uses all module files, but the stub generation can be done incrementally.
2017-05-04 19:00:41 +03:00
Yan Zhulanow 99a05f5d61 Kapt3: Convert reference to KMutableMap.Entry correctly (KT-17567) 2017-05-04 18:46:43 +03:00
Alexander Udalov d8d3bafbe9 Introduce "-Xreport-output-files" to report source-output mapping for JPS
This makes "-verbose" not required for JPS to run correctly and
therefore allows to print more useful debugging stuff in the compiler
and read them in CLI, for example. The output will also be more readable
because there'll be no "output" messages
2017-04-28 20:49:28 +03:00
Alexander Udalov 7f5d87ea17 Rename PathUtil.getJdkClassesRoots to avoid confusion
Two of these methods return roots given a path to the JRE, and the third
one returns roots given a path to the _JDK_.
2017-04-27 20:35:14 +03:00
Yan Zhulanow 63243b99fa Kapt3: Check if the 'tools.jar' is present in the plugin classpath (KT-17456)
Kapt3 won't work without the 'tools.jar' file provided, but we shouldn't throw an exception in this case.
This commit adds the warning message (and disables Kapt if it can't be used).
2017-04-27 18:52:10 +03:00
Yan Zhulanow 20e362e363 Kapt3: Do not generate "options not recognized" for "kapt.kotlin.generated" option (KT-17418)
"kapt.kotlin.generated" AP option is always present (and it's the way to say the arbitrary processors about the target directory for generated Kotlin source files).
In this commit, the "fake" empty annotation processor is added to consume the option if no other processor does it.
2017-04-27 18:52:09 +03:00
Alexander Udalov 38ea9986ab Make KotlinType.isError extension instead of member 2017-04-26 18:10:49 +03:00
Alexander Udalov c2f275faec Refactor codegen test utilities
Use GenerationUtils.compileFiles instead of
CodegenTestUtil.generateFiles
2017-04-13 19:04:43 +02:00
Alexander Udalov 861d9a1620 Use null instead of CompilerMessageLocation.NO_LOCATION in MessageCollector 2017-04-11 12:08:31 +03:00
Yan Zhulanow 3ee65ac499 Kapt: Support specifying javac options (KT-17245) 2017-04-10 22:48:17 +03:00
Dmitry Jemerov f9495aa0d7 Introduce and use KotlinPaths.getStdlibPath()
Also support renaming .jar file when updating an existing library
2017-04-04 11:21:06 +02:00
Yan Zhulanow f1e303e18d Minor: Update kapt tests for Kotlin 1.1 2017-03-22 22:03:21 +03:00
Yan Zhulanow e93bc4c00d Kapt3, minor: Enable parameter name saving in javac ClassReader 2017-03-22 22:03:19 +03:00
Yan Zhulanow bb0a46ac17 Kapt3: Ignore inner classes with clashing names (KT-16458)
Ignore classes (and references to such classes in declaration signatures) if one of the containing classes has the same simple name. This is forbidden in Java, thus should not be present in kapt source stubs.
2017-03-22 22:02:30 +03:00
Yan Zhulanow 47ab47d6d1 Kapt3: Support 'processors' option in the compiler plugin (KT-8558)
Support specifying qualified names of annotation processors in the kapt3 compiler plugin (feature-parity with javac).
2017-03-22 22:02:27 +03:00
Mikhail Glukhikh b121bf8802 Cleanup: fix some compiler warnings (mostly deprecations, javaClass) 2017-03-15 17:35:31 +03:00
Yan Zhulanow 131570080d Kapt3: Generate import statements in stubs 2017-02-08 19:01:17 +03:00
Yan Zhulanow 69a063b0b2 Kapt3: Serialize annotation processor options to base64 to support spaces in option values 2017-02-08 19:01:16 +03:00
Yan Zhulanow 8479618632 Kapt3: Invoke integration tests with the Kotlin runtime in the compile classpath (this fixes integration tests, nullability annotations from org.jetbrains were not found) 2017-02-08 19:01:15 +03:00
Yan Zhulanow 823781ea6c Kapt3: "$annotations" are not always ACC_PRIVATE now (see also KT-15993) 2017-02-08 19:01:14 +03:00
Yan Zhulanow 2553513205 Kapt3: Allow users to disable error type correction (and now it's disabled by default) 2017-02-08 19:01:13 +03:00
Yan Zhulanow 297f8d4161 Kapt3: Use the javac's finalCompiler log to determine if there were any annotation processing errors (KT-16176) 2017-02-08 19:01:13 +03:00
Yan Zhulanow 62092f31cc Minor: Update test data because of KT-15697 2017-02-08 19:01:12 +03:00
Yan Zhulanow de3cb4567f Minor: Remove obsolete JAVA_FILE_PARSING_ERROR constant, fix corresponding test 2017-02-08 19:01:11 +03:00
Yan Zhulanow 08b98f7133 Kapt3: Ignore declarations with illegal Java identifiers (KT-16153) 2017-02-08 19:01:10 +03:00