Commit Graph

646 Commits

Author SHA1 Message Date
Ilya Chernikov 731dcf5d6f minor: fix after faulty rebase 2017-04-19 15:22:15 +02:00
Ilya Chernikov c91a3f8bf0 Add sam-with-receiver and source-sections compiler plugins to maven
rename source-sections compiler plugin jar in the dist (add kotlin- prefix),
according to the agreed naming scheme for the artefacts. (The renaming of the
other plugins should follow.)
in addition configure proguard to retain VirtualFile members, since they
are used in the source-sections plugin
2017-04-19 15:22:15 +02:00
Dmitry Jemerov 03cef30717 Correctly honor expected type when converting string templates to UAST
#KT-17315 Fixed
 #KT-17316 Fixed
2017-04-19 11:46:13 +02:00
Vyacheslav Gerasimov 5b58a6f9e8 Add intentions Add/Remove/Redo parcelable implementation
#KT-17465 Fixed
#KT-12049 Fixed
2017-04-18 19:04:14 +03:00
Dmitry Jemerov dd4a5944f1 Delegate getContaingFile() for UAST declarations to Kotlin origin
This is required to be able to report inspection problems on such
elements.
2017-04-18 15:13:34 +02:00
Zalim Bashorov 9783a31779 Remove kotlin-reflect.jar dependency from util module and move reflectionUtil.kt closer to "clients"
Main goal is get rid of kotlin-reflect.jar from modules what required for minimal compiler.jar which can compile Kotlin only to JS to make it smaller.
2017-04-17 18:18:38 +03:00
Zalim Bashorov 51e84f7ce4 Move some script related part of frontend to separate module to avoid using kotlin-reflect.jar in frontend module
Main goal is get rid of kotlin-reflect.jar from modules what required for minimal compiler.jar which can compile Kotlin only to JS to make it smaller.
2017-04-17 18:18:35 +03:00
Alexander Udalov f4b6db4dc0 Change format of -X arguments to require value after '='
Report a warning when an argument is passed in the old form (with the
whitespace)

 #KT-17264 Fixed
2017-04-14 20:07:54 +03:00
Mikhael Bogdanov 3df32ad425 Add flag for dex verification 2017-04-13 19:04:45 +02:00
Mikhael Bogdanov df65b3f6b3 Refactor test framework to process directives in one place
Perform directive processing in base test class
2017-04-13 19:04:44 +02:00
Alexander Udalov c2f275faec Refactor codegen test utilities
Use GenerationUtils.compileFiles instead of
CodegenTestUtil.generateFiles
2017-04-13 19:04:43 +02:00
Vyacheslav Gerasimov d8fdd04e7f Remove custom lint detectors registration from kotlin lint
#KT-14970 Fixed
2017-04-12 19:23:43 +03: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
Vyacheslav Gerasimov 107879a78a Implement getTypeElement for UastKotlinPsiVariable
#KT-16849 Fixed
2017-04-10 12:40:33 +03:00
Vyacheslav Gerasimov 1d134ffc72 Register Android api quickfixes for inlined api inspection
#KT-14857 Fixed
2017-04-10 12:39:40 +03:00
Pavel V. Talanov 4f701285b1 Light class builder: do not generate methods delegating to DefaultImpls in kotlin classes
Class APIs from java point of view stays the same so we can avoid generating those methods
Otherwise we have to calculate all supertypes when getMethods() is called,
    which imposes severe performance penalties
We have to pretend these methods are not 'abstract' (also we consider them 'default' for safety)
    so java highlighting does not report "class should be abstract" for all inheritors
We have to manually report "class should be abstract" on some of the java inheritors,
    specifically those that are implementing interfaces directly
	    as opposed to extending kotlin classes implementing those interfaces
2017-04-09 15:09:01 +03:00
Ilya Chernikov 30048f8f49 Fix CRLF handling in source-sections plugin 2017-04-06 10:02:49 +02:00
Ilya Chernikov 88652154c9 Port compiler to the script-runtime with script base classes 2017-04-06 10:02:45 +02:00
Yan Zhulanow 21da11fe18 Fix 'kotlin-spring' and 'kotlin-noarg' Gradle plugin importing (KT-17049)
Allopen and Noarg plugins now use 'presets' that should be handled in the Gradle importer as well.
2017-04-05 18:13:14 +03:00
Mikhail Glukhikh 7a53b2f4c8 Introduce UNUSED_ANONYMOUS_PARAMETER for anonymous functions
It is not reported for 1.0 language version because
renaming to _ is not possible. It has weak warning severity

So #KT-8813 Fixed
So #KT-16875 Fixed
2017-04-04 14:23:30 +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
Vyacheslav Gerasimov ba5e78a917 Replace deprecated Iterators.emptyIterator() in JavaContext.java
with ContainerUtil.emptyIterator()
2017-03-27 21:35:11 +03:00
Alexey Tsvetkov 9d95c841a6 Use connect-and-lease when using daemon in JPS & Gradle
Relates to KT-15562 "Service is dying".

This commit includes multiple changes:
 1. JPS & Gradle daemon clients are refactored to use `connectAndLease` from `KotlinCompilerClient`.
 `connectAndLease` was introduced in previous commits
 2. `withKotlin` was removed because `connectAndLease` already covers retrying on connection error
 3. Gradle flag files creation is changed:
   * client-alive flag file lives as long as Gradle instance lives,
   * session-alive flag file lives until the end of a build.
2017-03-24 19:03:36 +03:00
Ilya Chernikov 8eaeadddfa Disable flaky statistical benchmark tests for source sections plugin and JSR 223 2017-03-23 18:11:36 +01:00
Yan Zhulanow cba523958e Android Extensions: Support Dialog classes (KT-16957) 2017-03-22 22:03:22 +03: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 7535778ed4 AllOpen, NoArg: Check for the Gradle plugin in the classpath properly
Path segments in the plugin classpath entries are separated by the system file separator, not by '/'.

This fixes KT-16901
2017-03-22 22:03:19 +03:00
Yan Zhulanow 8ac14ab930 Android Extensions: Allow to disable IDE support (KT-12741)
Enable IDE plugin only if it is enabled in the build.gradle file.
2017-03-22 22:03:17 +03:00
Yan Zhulanow 5d4cefcc30 AllOpen: Do not make private members open (KT-16627) 2017-03-22 22:03:00 +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
Yan Zhulanow d30dbf25b5 Kapt1: Allow to use spaces in the collected identifiers (KT-12769) 2017-03-22 22:02:26 +03:00
Yan Zhulanow 948207be30 AllOpen, NoArg: Use the bundled plugins in Maven projects
Use the bundled compiler plugins for Maven projects (as we do for Gradle projects already) because the plugin provided as a dependency in the POM file may have an incompatible version.
2017-03-22 22:02:25 +03:00
Alexey Sedunov bab762b761 Implement post-refactoring optimization of unused imports
#KT-15822 Fixed
 #KT-13755 Fixed
2017-03-22 13:36:11 +03:00
Ilya Chernikov 08f6b6c93c minor: get rid of the compiler-test dependency in source-sections test 2017-03-21 16:30:50 +01:00
Ilya Chernikov 4043f491da minor: replace Pair with data class in daemon client connectAndLease call
backport from 1.0.7
2017-03-21 16:30:47 +01:00
Ilya Chernikov 4b430b49a7 Implement source sections compiler plugin
allows to compile only parts of the source files, denoted by top-level
"sections" (function with lambda param calls), but preserving original
file line/column numbers for easier diagnostics. Allow e.g. to compile
gradle "buildscript" section without preprocessing original file in
advance. See tests for examples.
2017-03-21 16:30:46 +01:00
Alexey Tsvetkov 40574d31ac JPS tests: avoid using deprecated API 2017-03-20 18:46:00 +01:00
Nikolay Krasko 82a2a705fb Do not wrap analyze into write action priority in tests
In tests the code is executed in EDT and runInReadActionWithWriteActionPriority fails

See: MergingUpdateQueue.setPassThrough() and ExternalToolPassFactory() constructor
2017-03-20 18:45:36 +01:00
Nikolay Krasko 2eb6c393a4 Move android modules to Java 8 SDK 2017-03-20 18:45:29 +01:00
Dmitry Jemerov b10073465c fix compilation of new lint checks against IDEA 163 2017-03-20 18:45:22 +01:00
Dmitry Jemerov a2b0b3d6eb fix compilation against branch 163 2017-03-20 18:45:15 +01:00
Yan Zhulanow 24c9b6e171 Migrate IDEA plugin code to Android Studio 2.2 (br 145) 2017-03-20 18:45:15 +01:00
Pavel V. Talanov daef8a0eed Light classes in IDE: Make light class delegate construction a two step process
Step 0: Light class object is created, no delegates are computed
Step 1: constructs dummy delegate which can not be relied upon to know signature of any member
		It can be used to construct light field and light method objects
		(which can correctly respond to some queries) before constructing real delegate
Step 2:
		Construct real delegate if dummy delegate is not enough to respond to a query

This speeds up multiple scenarios where getMethods() and getFields() are called on numerous classes

Dummy delegate's faster consruction is achieved by using specially setup dumb analysis instead of ide analysis

Introduce LazyLightClassDataHolder: which manages creation of Step 1 and Step 2 delegates
Introduce MemberIndex: keeping track of member creation order, helps matching light class delegates created in different contexts
KtLightMethod and Field: make use of dummy delegate
KtLightMethod no longer extends LightMethod since it requires eager delegate construction
KtLightMethod now implements PsiAnnotationMethod for convenience (ClsMethodImpl implements PsiAnnotationMethod)
2017-03-15 20:54:55 +03:00
Mikhail Glukhikh 045a23ae10 Cleanup: apply "Convert lambda to reference" 2017-03-15 17:36:02 +03:00
Mikhail Glukhikh b121bf8802 Cleanup: fix some compiler warnings (mostly deprecations, javaClass) 2017-03-15 17:35:31 +03:00
Mikhail Glukhikh d0cc1635db Cleanup: apply "Use synthetic property access syntax" 2017-03-15 16:13:40 +03:00
Vyacheslav Gerasimov b8563f7fcf Fix KotlinUastTypesTest.testCycleInTypeParameters 2017-03-15 00:20:40 +03:00