Commit Graph

39805 Commits

Author SHA1 Message Date
Sergey Igushkin c4e7f1aa97 Fix parsing Gradle version with zero
(cherry picked from commit 732972c)
2017-06-30 20:44:59 +03:00
Sergey Igushkin 40a8bbf24d Fix friend paths not configured correctly with separate classes dirs
(cherry picked from commit d5ee659)
2017-06-30 20:44:49 +03:00
Alexey Sedunov 9ba868a903 Minor: Fix test data 2017-06-30 13:53:09 +03:00
Valentin Kipyatkov 6df0c28119 Correction after code review 2017-06-30 11:21:16 +03:00
Valentin Kipyatkov 8fabb6945e Allow slice rewrite in trace when in IDE 2017-06-30 11:21:16 +03:00
Valentin Kipyatkov 61d9a6b9cd Use the same way to check for ProcessCanceledException everywhere 2017-06-30 11:21:16 +03:00
Valentin Kipyatkov eb4f322c77 Do not store ProcessCanceledException as result for cached value 2017-06-30 11:21:15 +03:00
Valentin Kipyatkov 09dbb07fb8 Optimization to reuse BindingContext in completion 2017-06-30 11:21:15 +03:00
Sergey Igushkin 1174c7bdd9 Add sourcesJar and javadocJar to artifacts of gradle-tools projects.
(cherry picked from commit 450345b)
2017-06-29 20:59:36 +03:00
Sergey Igushkin a4be282074 Add Gradle Plugin Portal publication to the buildscripts
Add option to disable signing (-PnoSign), to be used when publishing
pre-built artifacts

Add option to define specific version for publishing, to be used when
publishing test versions

(cherry picked from commit dcd55e9)
2017-06-29 20:59:36 +03:00
Dmitry Jemerov 4497874f31 Remove unnecessary saveAll() 2017-06-29 17:56:59 +02:00
Sergey Igushkin d1bddb6250 Fix disabling IC not applied to kapgGenerateStubsKotlin tasks
Issue #KT-18647 Fixed

(cherry picked from commit ffb656a)
2017-06-29 18:44:00 +03:00
Sergey Igushkin a9cad7f112 Add a test for project.buildDir lazy evaluation
(cherry picked from commit ab0f9cd)
2017-06-29 18:42:50 +03:00
Nikita Skvortsov b2cdb0d63d evaluate and use buildDir as late as possible
(cherry picked from commit a2c7f80)

(cherry picked from commit 5643fa1)
2017-06-29 18:41:53 +03:00
Sergey Igushkin 351f810797 Add tests for separate classes dirs
(cherry picked from commit b07d79b)
2017-06-29 18:31:53 +03:00
Sergey Igushkin 700b162233 Implemented separate classes dirs support in the Gradle plugins.
Issue #KT-18495 Fixed
Issue #KT-18544 Fixed

(cherry picked from commit e25f0fd)
2017-06-29 18:31:23 +03:00
Sergey Igushkin ae47c59dc9 Pass freeCompilerArgs unchanged to the compiler, without parsing them
with the compiler loaded along the Gradle plugin.

Issues: #KT-17618 Fixed

(cherry picked from commit 44f7428)
2017-06-29 18:27:18 +03:00
Alexey Sedunov 88968807b2 Generate equals/hashCode(): Swap class literals in comparison 2017-06-29 17:42:20 +03:00
Alexey Sedunov e3e4c447fa Generate equals/hashCode(): Use class literals when possible
#KT-18683 Fixed
2017-06-29 17:42:18 +03:00
Alexey Sedunov 50a38df8b1 Remove Parentheses: Forbid on call inside a call without argument list
#KT-18699 Fixed
2017-06-29 17:42:17 +03:00
Alexey Sedunov 20969f161c Introduce Parameter: Fix NPE on invalid parameter name or type
EA-95189 Fixed
2017-06-29 17:42:16 +03:00
Alexey Sedunov 2e8b374ce8 Move: Use KtNamedDeclaration as referrer when reporting a conflict
EA-103817 Fixed
2017-06-29 17:42:15 +03:00
Alexey Sedunov 58addf72ff New File Action: Do not start under write action
EA-102468 Fixed
2017-06-29 17:42:14 +03:00
Alexey Sedunov b1637df8df Misc: Format generated members under write action
EA-87901 Fixed
2017-06-29 17:42:13 +03:00
Alexey Sedunov 392370bb23 Extract Interface: Fix NPE
EA-90440 Fixed
2017-06-29 17:42:11 +03:00
Alexey Sedunov dd0f8e98e8 Create Type Alias From Usage: Disable on PsiPackage
EA-92625 Fixed
2017-06-29 17:42:10 +03:00
Alexey Sedunov 6060a39494 Change Signature: Use correct index in getOriginalParameter()
#KT-18642 Fixed
 #KT-18606 Fixed
2017-06-29 17:42:09 +03:00
Nikolay Krasko 9122f58d5d Re-enable optimize on the fly activation when unused imports found
Remove deprecated usages
2017-06-29 16:56:15 +03:00
Nikolay Krasko 6a5d6854bb Refactoring: inline implementation into KotlinStdJSProjectDescriptor 2017-06-29 16:56:15 +03:00
Nikolay Krasko df393e18fe Configure AbstractInspectionTest with project descriptors
Previous implements produced flaky tests when non-js tests were
executed after js.
2017-06-29 16:56:15 +03:00
Nikolay Krasko be28c4a48f Remove unused configuration of runtime library
The project descriptor used in the test already has the configuration.
Also directive is not used in tests.
2017-06-29 16:56:15 +03:00
Mikhail Glukhikh c8a9b5f67a Restrict range of "simplifiable call chain" inspection 2017-06-29 16:25:58 +03:00
Mikhail Glukhikh 840847e47c Code cleanup: several inspections applied 2017-06-29 16:25:57 +03:00
Mikhail Glukhikh fdca96634e Add restrictions for "simplifiable call chain" inspection
Do not use on maps; do not suggest for lambdas with return inside
Related to KT-18274
2017-06-29 16:25:55 +03:00
Mikhail Glukhikh 2f0159a7ab Minor fix: useless call on collection type 2017-06-29 16:25:54 +03:00
Mikhail Glukhikh 36be1fdaef Introduce "simplifiable call chain on collection" inspection
Related to KT-12165
So #KT-18274 Fixed
So #KT-17198 Fixed
2017-06-29 16:25:52 +03:00
Mikhail Glukhikh bdb9f00c75 Introduce "Useless call on collection type" inspection
Related to KT-12165
Supported functions: filterNotNull, filterIsInstance,
mapNotNull, mapNotNullTo, mapIndexedNotNull, mapIndexedNotNullTo

Also, "Useless cal on not-null" improved a bit
2017-06-29 16:25:50 +03:00
Mikhail Glukhikh f80f41d254 Introduce "redundant explicit type" inspection #KT-18517 Fixed
Reported cases: constants, constructors, object references
2017-06-29 16:25:47 +03:00
Mikhail Glukhikh 0f4ae3b727 Introduce "Useless call on not-null type" inspection #KT-18386 Fixed
Supported functions: orEmpty(), isNullOrEmpty(), isNullOrBlank()
2017-06-29 16:25:45 +03:00
Alexander Udalov 8c21ff66a4 Always treat all sources as parts of the module being compiled
If a path to the module-info.java file is passed as an argument, we
should treat all other source files passed as arguments (either as
individual source files or inside a source directory) as members of that
module. Previously we treated other source files as members of the
unnamed module, and this resulted in incorrect errors when using a
member exported with a qualification from another named module, for
example

 #KT-18598 In Fixed
2017-06-29 15:59:57 +03:00
Alexander Udalov 5192f946c5 Fix depth-first search for Java 9 modules
To compute modules to be added to compilation roots in
JavaModuleGraph.getAllDependencies, we should look not only for
transitive requirements of root modules, but for transitive requirements
of _root modules' requirements_. The same logic applies to
JavaModuleGraph.reads. In other words, when looking for a path in the
module graph between two modules, the first edge's transitiveness
doesn't matter, but all other edges after the first must be transitive.

There was also a stupid bug in dfs in
JavaModuleGraph.getAllDependencies: we continued the DFS only if the
module _was not_ added to the "visited" set ("add" returns true if the
element was added successfully)

 #KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov 72f37a278c Do not add all modules from module path when compiling unnamed module
Note that javac reports a nice error in this case ("package foo is
declared in module lib, which is not in the module graph"), but we only
report "unresolved reference" because the corresponding modules are not
added to classpath roots. We should improve this in the future

 #KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov f8346d21c2 Check type alias expansion for Java 9 module accessibility
#KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov 8768500844 Fix incorrect behavior and refactor JvmModuleAccessibilityChecker
Previously we assumed that a symbol is accessible if its containing
package is exported by module-info.java. Which was obviously wrong and
could lead to a situation where a symbol would be incorrectly accessible
if a usage module has a dependency on the symbol's module in IDEA
project terms, but does not require it in its module-info.java

 #KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov 2d3888c710 Do not add JDK .jar roots if the JDK is modular (9+)
Files like ant-javafx.jar, deploy.jar, java.jnlp.jar, javafx-swt.jar etc
should not be added to the classpath if JDK home points to a JDK 9
distribution
2017-06-29 15:59:57 +03:00
Alexander Udalov 9274d963aa Create KotlinCoreEnvironment a bit later in tests
Before this change, diagnostic tests with Java source files failed
because KotlinCoreEnvironment was being created in the test's setUp,
even before the test data file has been split into .java/.kt and the
resulting .java files have been copied to a temporary directory. In
KotlinCoreEnvironment's constructor, we now inspect all roots for
module-info files, which involves calling VirtualFile.getChildren on all
roots in the configuration. CoreLocalVirtualFile.getChildren is
cached on the first access, and so because the temporary directory with
.java files was empty at this point, the VirtualFile for that directory
returned empty array in getChildren later in the test, resulting in
unresolved reference errors.

This is fixed by creating the environment _after_ the .java files have
been copied to a temporary directory. Note that slow assertions for
flexible types are now enabled in KtUsefulTestCase instead of
KotlinTestWithEnvironmentManagement, because BaseDiagnosticsTest no
longer inherits from the latter
2017-06-29 15:59:56 +03:00
Alexander Udalov 03d83db660 Support -Xmodule-path and -Xadd-modules command line arguments
#KT-18598 In Progress
 #KT-18599 Fixed
2017-06-29 15:59:56 +03:00
Alexander Udalov e32880d9a3 Implement Java 9 module visibility checks
In this commit, only IDE tests are added, because we look for module
declarations in the IDE across the whole project, whereas in the
compiler we should do this on the module path only and that requires
separate work (KT-18599) which is done in the following commits.

(The change in Cache.kt is needed so that
JvmModuleAccessibilityChecker.ClassifierUsage, which is an inner class,
would be injected properly.)

 #KT-18598 In Progress
 #KT-18599 In Progress
2017-06-29 15:59:56 +03:00
Alexander Udalov 2275068c94 Introduce JavaModule, refactor module graph construction
#KT-18598 In Progress
 #KT-18599 In Progress
2017-06-29 15:59:56 +03:00
Mikhael Bogdanov 4f914fafca Calculate default mask shift properly
#KT-18689 Fixed
2017-06-29 14:57:42 +02:00