Commit Graph

47655 Commits

Author SHA1 Message Date
Sergey Igushkin 209d0cf6a1 Add a few integration tests for the new MPP plugin 2018-08-07 15:55:45 +03:00
Sergey Igushkin 1e95e4d427 Allow resolution for compileOnly and compileClasspath configurations
This is required by the old IDE importer, which needs to resolve these configurations, and there seems to be no easy way to prevent that.
2018-08-07 15:55:44 +03:00
Sergey Igushkin 19fd706d98 Fixes for Android single-target projects
1. Kapt resolves runtime classpath during configuration, and because of
that we are unable to setup configurations that already took part in
dependency resolution. To fix that, run Kapt configuration as a separate
step out of the main loop over the variants

2. Old Android projects (< 3.0.0) don't have `api` and `implementation`
configurations. To stay compatible with those, ignore these
configurations being absent during configurations hierarchy setup.
2018-08-07 15:55:44 +03:00
Sergey Igushkin 7b6764c9ae Add test tasks to targets configured with KotlinTargetConfigurator 2018-08-07 15:55:44 +03:00
Sergey Igushkin cb99f43033 Implement new MPP plugin 2018-08-07 15:55:44 +03:00
Sergey Igushkin dc7d488deb Update existing plugin implementations to use KotlinCompilation
Add default implementations for KotlinTarget and KotlinCompilation
(some of them are used in code added by further commits).

Refactor AbstractKotlinPlugin so that parts of its logic can be easily
applied outside the plugin (needed for MPP plugin later).

The single platform Kotlin plugins having Kotlin compiled along with
Java will now create a KotlinCompilation and a KotlinSourceSet per Java
source set or per Android variant.
The build configuration logic will use KotlinCompilation
objects rather than Java or Android plugin entities.

Subplugins API and implementations are updated to use KotlinCompilation.
2018-08-07 15:55:44 +03:00
Sergey Igushkin 25eb93b136 (partial) Replace the KotlinSourceSet implementation and its factory
(Note: this commit leaves the repository in a non-compilable state as it
leaves some of the old API usages unchanged; they are replaced with new
implementations in further commits where more appropriate)

The new implementation covers the wider interface, and the factory
should now be used not on its own but in a named domain object container
(the API for creating a source set is now provided through the
source sets container rather than the factory, so that source sets are
also properly registered).
2018-08-07 15:55:43 +03:00
Sergey Igushkin 3828c26fa9 Introduce new API
These interfaces are needed for both new MPP design and getting rid of
the Java plugin source sets in favor of Kotlin source sets
2018-08-07 15:55:43 +03:00
Svyatoslav Kuzmich a1c10956cb [JS IR BE] Support super calls for methods of Any 2018-08-07 14:41:50 +03:00
Svyatoslav Kuzmich 439350d41a [JS IR BE] Cast types in bridges 2018-08-07 14:41:50 +03:00
Alexander Udalov 97faff246d Compile kotlinx-metadata-jvm with JVM target 1.6 instead of 1.8
#KT-25920 Fixed
2018-08-07 13:38:47 +02:00
Alexander Udalov 1582354077 Refactor CompileEnvironmentUtil.getKtFiles, move to KotlinCoreEnvironment
Do not call this method the second time in KotlinToJVMBytecodeCompiler
where all KtFile instances are already created; just get only those
files that are in the needed module, which can be determined solely by
the file path.

Also "kotlinize" getKtFiles and rename to createKtFiles
2018-08-07 13:38:30 +02:00
Alexander Udalov fe829add44 Minor, use TEMP_DIR/TESTDATA_DIR in CLI tests on xml build files
Otherwise the "outputDir" in these tests was treated as relative to the
project root, and starting from 63b4302cea, running these tests resulted
in the "whatever" directory being created in the project root
2018-08-07 13:38:30 +02:00
Alexander Udalov 19feacb96b Minor, expand TESTDATA_DIR with absolute path in CLI tests
To be able to use it correctly inside an xml build file where, if the
path is not absolute, it's treated as relative to the build file path
(which is TMP_DIR in several tests of the subsequent commit)
2018-08-07 13:38:30 +02:00
Alexander Udalov f9ed8e7aaf Minor, make org.jetbrains.kotlin.fileClasses.LOG private
To prevent it from being suggested in auto-import
2018-08-07 13:38:30 +02:00
Alexander Udalov 5da8ce844a Minor, move ContentRoot and KotlinSourceRoot to module 'cli'
Also move CONTENT_ROOTS from JVMConfigurationKeys to
CLIConfigurationKeys since it's used on all platforms, not just JVM
2018-08-07 13:38:30 +02:00
Alexander Udalov 14b8f4b52b Minor, change package of outputUtils.kt 2018-08-07 13:38:30 +02:00
Alexander Udalov 2d875a9cb4 Reformat module 'cli', fix warnings/inspections 2018-08-07 13:38:29 +02:00
Nikolay Krasko 21a7561271 Fix small gap for install message 2018-08-07 14:08:09 +03:00
Nikolay Krasko cb925375ed Not enough padding/white space for current version in update form (KT-25562)
#KT-25562 Fixed
2018-08-07 14:07:03 +03:00
Mikhael Bogdanov 5169cfba8f Use lazy symbol table in symbols 2018-08-07 12:42:05 +03:00
Nikolay Krasko 8e7d114850 Merge pull request #1795 from belovrv/patch-2
Delete the SlackIn badge
2018-08-07 12:28:00 +03:00
Nicolay Mitropolsky bbf2af1004 IdeaExtensionPoints.IDEA_COMPATIBLE_BUILD_NUMBER = "182.3040"
Otherwise Kotlin plugin is not loaded in some tests (`org.jetbrains.uast.test.kotlin.KotlinDetachedUastTest` for instance)
2018-08-07 12:26:30 +03:00
belovrv c17a9e10b5 Delete the SlackIn bage 2018-08-07 12:21:56 +03:00
Mikhail Zarechenskiy 1497c19dc9 Do not generate useless methods inside wrapper for inline class
Fix for test data (inlineFunctionInsideInlineClassesBox.kt) is needed
 to avoid check about "no inline functions".

 This check has two steps: first, names of inline functions from
 the metadata are loaded, then these names are checked that they are
 presented for physical methods in the classfile.

 Because now there are no physical methods in the classfile, we can't pass
 the second check, therefore this fix is needed.

 #KT-24872 Fixed
2018-08-07 12:15:46 +03:00
Yan Zhulanow fcbcabd3a2 Pill: Generate iml files more consistently with IDEA 2018-08-07 11:55:24 +03:00
Yan Zhulanow 014b812a31 Pill: Remove -SNAPSHOT suffixes for artifact JAR file names 2018-08-07 11:55:24 +03:00
Yan Zhulanow 42d00c144b Pill: Fix compilation, forcibly move the annotations-13 dependency to the end of classpath 2018-08-07 11:55:24 +03:00
Yan Zhulanow 769a0d7701 Pill: Add extra stdlib jars as dist libraries 2018-08-07 11:55:23 +03:00
Yan Zhulanow 54470fe2b7 Pill: Remove source dependencies to 'tests-common'
'tests-common' module does only have a test source set so the dependency is redundant.
2018-08-07 11:55:23 +03:00
Mikhail Glukhikh 09766ae2ae Reformat: AddNameToArgumentFix 2018-08-07 11:30:31 +03:00
Mikhail Glukhikh 06d339639f Fix "Add name to argument" (disable reformatting in quick-fix text)
Four relevant quick-fix tests should be fixed after it
2018-08-07 11:30:31 +03:00
Mikhail Glukhikh 28484f31e7 Fix "Remove @ from annotation argument" (make consistent PSI)
Three relevant quick-fix tests should be fixed after it
2018-08-07 11:30:31 +03:00
Dmitry Savvinov 9ad2edbe85 Bump stubs versions after 5ab79a111d 2018-08-07 10:22:46 +03:00
Dmitry Savvinov bd9254597d Fix testdata after switching idea version to 182
The source of testdata change is following commit from the
intellij-community repo:

d2bfe3d14bfa48af585f1faddc9a0c37dc05e724

It changes how Java-resolution resolves constructors:
- before, *any* PsiMethod without type reference was treated as
constructor
- now, PsiMethod without type reference is treated as constructor
only if their *names also match*

In particular, in this test, 'void () {}', surprisingly, doesn't have a
type reference ('void' is parsed as PsiErrorElement:Identifier
expected), its name is '<unnamed>', and its visibility is
'package-private' (!)

Therefore, previously we thought that 'Nameless' has package-private
constructor and were reporting INVISIBLE_MEMBER.
Now we don't see any constructor so we add default constructor, which has
public-visibility -> error is gone.

Note that this change affects behavior only when "red" code is already
present in the project (for "green" code, assumption "method without type
reference is a constructor" is indeed correct).
2018-08-07 10:18:25 +03:00
Dmitry Savvinov a71f09022c Fix testdata after switching idea version to 182
The source of changes is commit the following commit in
intelllij-community repo:

b2b723fa449b16bb1da8102a5efdc219977fefe0 speedup java class resolve a bit

Eseentially, it makes Java resolve (which Kotlin reuses) accept first
matching candidate from explicit named import, instead of continuing
search.

Hence, behavior in cases where several conflicting imports are present,
has changed: before, reference to such names were unresolved, now it's
candidate from first import (see also test UsageMixed.java in the
intellij-community repo).

Therefore, previously we saw such types as undeclared and reported
MISSING_DEPENDENCY_CLASS on them (assuming they are not present in
classpath); now we see such types as properly resolved, so error is
gone.

Because behavior has changed only in case there already was "red" code,
it is not a BC and we can just accept changes.
2018-08-07 10:18:25 +03:00
Alexey Sedunov ed5709afdb Misc: Fix compatibility issues with AS3.3C4 2018-08-06 21:39:17 +03:00
Vyacheslav Gerasimov 8231f5b259 Make handleElementRename overrides compatible with 183 platform 2018-08-06 20:24:46 +03:00
Mikhail Glukhikh d7317c58e9 Move "Add test library to classpath" to irrelevant action list
This prevents inconsistencies like "Add JUnit 5.0" / "Add JUnit 5.2"
Should fix one relevant test
2018-08-06 19:04:12 +03:00
Mikhail Glukhikh 21be8d118d Fix "ReplaceInfixOrOperatorCallFix" (make consistent PSI)
One relevant quick-fix test should be fixed after it
2018-08-06 19:04:11 +03:00
Mikhail Glukhikh 247bb912ba Fix refactoring test (bunch file -> original file) 2018-08-06 19:04:09 +03:00
Mikhail Glukhikh e15fc7da15 Fix two inspection tests (bunch file -> original file) 2018-08-06 19:04:07 +03:00
Mikhail Glukhikh 90245659ff Fix testOptionalParameterAndLambdaComplex (related to KT-24694) 2018-08-06 19:04:05 +03:00
Mikhail Glukhikh 07ff2bff33 Reformat & cleanup: psiModificationUtils, especially PsiElement.replaced 2018-08-06 19:04:04 +03:00
Mikhail Glukhikh 1d2438e04e Report SUPERTYPE_NOT_INITIALIZED even if no constructors in superclass
Before this commit, expect super-class without constructors did not
provoke SUPERTYPE_NOT_INITIALIZED. However, it should, but only
if sub-type is normal class (not an expect one).

So #KT-24597 Fixed
2018-08-06 19:02:24 +03:00
Vyacheslav Gerasimov 6db2037440 Make JavaToKotlinAction.convertFiles compatible with AS 3.3 2018-08-06 18:39:00 +03:00
Mikhail Zarechenskiy 1972387022 Fix test data after 6d4d244c28 2018-08-06 17:45:24 +03:00
Mikhail Zarechenskiy 659289b41a Report diagnostics about experimentality on unsigned literals
#KT-25580 Fixed
2018-08-06 17:45:22 +03:00
Mikhail Zarechenskiy 55e7def3c1 Fix coercion for stack value property in case of inline classes
#KT-25771 Fixed
2018-08-06 17:45:20 +03:00
Bloder f89803fe8f Create samples for String.toLowerCase/toUpperCase
* Create toLowerCase method sample
* Create toUpperCase method sample
* Create toUpperCase sample reference in StringsJVM
* Create sample ref and doc of js impl toUpperCase
* Create sample ref and docs of js toLowerCase
* Add sample ref in toLowerCase expect fun
* Add sample ref in toUpperCase expect fun
2018-08-06 15:34:57 +03:00