Commit Graph

423 Commits

Author SHA1 Message Date
Alexey Tsvetkov 3b4a49eebf Add test for KT-26064 2018-08-17 15:27:00 +03:00
Alexey Tsvetkov ff35d509e6 Add test for KT-25540 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov 11977cc1c1 Add multi-module JS IC tests with JPS 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov 8f002fdb43 JS IC: track lookups from libraries
Otherwise we don't track lookups from other modules

    #KT-25540 fixed
2018-07-23 15:43:17 +03:00
Alexander Udalov 1f0fb4823f Simplify DefaultImportProvider, introduce "low priority imports"
Previously, packages `java.lang` and `kotlin.jvm` were imported on JVM
by default on the same rights, causing problems when the same classifier
existed both in `java.lang` and `kotlin.jvm`. Since the only known case
of such conflict were type aliases to JVM classes, the corresponding
classes (expansions of those type aliases) were manually excluded from
default imports. This made the code in DefaultImportProvider complicated
and resulted in multiple problems, regarding both correctness and
performance (see 82364ad3e5, a9f2f5c7d0, dd3dbda719).

This change adds a new concept, a "low priority import", and treats
`java.lang` as such. Since these imports are now separated from the rest
of default imports in LazyImportScope via secondaryClassImportResolver,
conflicts between classifiers are handled naturally: the one from
`kotlin.jvm` always wins (unless the one from `java.lang` is imported
explicitly, of course). This approach is simpler, safer and does not
require any memory to cache anything.

Skip ResolveToJava.kt test for javac-based resolve; it now fails because
of a weird issue which I didn't have time to investigate (this is OK
because it's a corner case of an experimental functionality)
2018-07-16 13:45:11 +02:00
Alexey Tsvetkov 5760b8cf8b Register kotlin_module as output of all files
Previously kotlin_module was registered as output
only for files containing top-level declarations
2018-07-09 15:48:11 +03:00
Sergey Rostov b2f58ad9c3 jps, mpp: temporary disable mpp tests 2018-06-08 09:46:38 +03:00
Sergey Rostov 0eee2729cd jps: support multiplatform incremental compilation for jvm and js
- support common modules metadata compilation under flag (it is not required since all common source roots are included transitively for now)
- introduce expect actual tracker in jps: move implementation from gradle to build-common
- support js incremental compilation: move implementation from gradle to build-common
2018-06-08 09:46:37 +03:00
Sergey Rostov ec5110e1f4 jps: support dev kit module types (and all other ModuleBasedBuildTargetType)
#KT-24500 fixed
2018-05-24 11:12:01 +03:00
Alexey Tsvetkov 3eb968807e Invalidate usages of removed classes before round
#KT-23165 fixed
2018-04-03 21:11:12 +03:00
Alexey Sedunov ae37cc30a1 JS: Use the same output paths for JPS and Maven-based builds
#KT-22586 Fixed
2018-04-02 15:28:35 +03:00
Anton Bannykh 7b860eab36 Merge kotlin-experimental into kotlin standard library (KT-23055 fixed)
* kotlin-experimental.js has been already merged into kotlin.js
* change library name to kotlin in kotlin-experimental.meta.js in order to produce correct require calls
* concatenate kotlin-experimental.meta.js with kotlin.meta.js
* suppress multiple module declaration warning for such use case
2018-03-26 23:13:28 +03:00
Mikhail Zarechenskiy 4ebd11a7ae Refactoring: rename parameter to argument for annotation diagnostics 2018-03-22 03:59:55 +03:00
Alexey Tsvetkov 605bcc66a1 IC: add destination dir to start of classpath instead of end
Otherwise IC fails when a project declares a class with the same name
as in one of its dependencies.
The issue is relevant only for non-JPS IC (Gradle, Maven, etc.),
but I added the test for JPS too.

  #KT-20516 fixed
2018-03-21 18:44:42 +03:00
Alexey Tsvetkov 7881a305d9 Compare JS output files against file instead of hardcoded set
A difference is not obvious when two sets are compared:
there might be just one different element, but
sets would be printed in one line in iteration order
(which is non-fixed for hashsets).

Also the properties:
  EXPECTED_JS_FILES_IN_OUTPUT_FOR_STDLIB_ONLY,
  EXPECTED_JS_FILES_IN_OUTPUT_FOR_MODULE_STDLIB_ONLY,
  EXPECTED_JS_FILES_IN_OUTPUT_NO_COPY,
  EXPECTED_JS_FILES_IN_OUTPUT_WITH_ADDITIONAL_LIB_AND_DEFAULT_DIR,
  EXPECTED_JS_FILES_IN_OUTPUT_WITH_ADDITIONAL_LIB_AND_CUSTOM_DIR
are hard to distinguish in code and are not convenient to edit.
2018-02-22 01:13:09 +03:00
Alexey Tsvetkov 67a5cab343 Fix IC test data
Test data was broken starting from 0954d1ab1b
2018-02-14 16:09:07 +03:00
Nikolay Krasko f05e926670 Update idea to 173.3.4 (173.4548.28) 2018-02-03 00:15:45 +03:00
Alexey Tsvetkov 220fab0d3f Test JPS with Daemon and IC 2018-01-16 21:09:57 +03:00
Alexey Tsvetkov d7edbb8dfc Track changes in inline function when friend paths are disabled in JS 2017-12-22 16:12:20 +03:00
Alexey Tsvetkov a4d122478b Replace testCancelLongKotlinCompilation with less flaky test 2017-12-22 16:12:20 +03:00
Alexey Tsvetkov ee94a64718 Explicitly request rebuild when untracked java file is removed
Previously a rebuild was happenning because FileNotFoundException
was thrown when getting psiFile of removed file.
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov 50bf74b909 Turn off class redeclaration test for JS IC temporarily
So the tests could be run on TC.
Turn on after KT-19846 is fixed.
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov 0fee7883ed Recompile only files from last iteration after compile error 2017-12-22 16:12:20 +03:00
Alexey Tsvetkov ff2e3ecfc4 Add JS specific IC build log in test
JS IC compares proto using a source file path as a key,
so moving file causes recompilation of its usages
unlike JVM IC that uses a class file path as a key.
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov 7712044146 Fix IC test build log diverged from JPS
JPS marks dirty direct usages of removed classes since 172.* before a build.
Generic IC also marks dirty all subclasses and their usages.
That is necessary because a method from a removed class could be used
through a subclass.
JPS and generic IC logs diverged in 172 branch, but non-JPS tests
were not run on CI.
2017-12-22 16:12:20 +03:00
Alexey Tsvetkov a31f503fa5 Recompile all subclasses of removed classes 2017-12-22 16:12:19 +03:00
Alexey Tsvetkov fec2d08d22 Compile actual and expected declarations together
#KT-20840 fixed
2017-12-22 16:12:19 +03:00
Alexey Tsvetkov 3f082346ae Do not set api version to language version when language version is null
#KT-21852 fixed
    #KT-21574 fixed
2017-12-18 16:22:07 +03:00
Denis Zharkov df533053f9 Record special name lookup when trying use interface as a SAM
It was already working in JPS, because it see our synthetic classes
as subclasses for SAM's, but with non-JPS build we have to manually
tracking places that should be recompiled after SAM members are changed
2017-12-12 16:17:58 +03:00
Denis Zharkov ae6421476d Refine dirty files computation in case of Java source changes
#KT-17621 In Progress
2017-12-12 16:17:58 +03:00
Nikolay Krasko f46a8e0b16 Restore iml files for jps tests 2017-11-30 13:24:08 +03:00
Alexey Tsvetkov 913a997f24 Rebuild when language/api version is changed (JPS)
#KT-20757 fixed
2017-11-23 14:46:23 +03:00
Alexey Tsvetkov 18261838b6 Avoid deserializing .kotlin_module as class proto
#KT-20184 fixed
2017-11-16 14:47:59 +03:00
Alexey Andreev 2fbecfdd9c Support generation of relative path in JS source maps in JPS builder
See KT-20820
2017-10-23 17:19:50 +03:00
Anton Bannykh b2e53644a5 JPS JS: fix friend path detection in projects imported from Gradle (KT-18963 fixed) 2017-10-20 19:16:14 +03:00
Denis Zharkov b77cc54122 Update lookupTracker testData
Just the order of lookups has been changed
2017-09-28 14:01:30 +03:00
Alexey Tsvetkov 1c7b8ec938 Change test data so IC and non IC warnings count match
When IC is on and new Kotlin class is referencing
new Java class, new Kotlin file is compiled twice,
because JPS thinks new Kotlin class is affected by
new Java class (see https://youtrack.jetbrains.com/issue/KT-20318).

This does not happen when IC is off, and KotlinBuilder
requests chunk rebuild (see previous commit).

I decided to remove the reference, because the issue
is now known, and the reference is non critical for the test.
2017-09-26 16:35:24 +03:00
Alexey Tsvetkov 7a5e0e1107 Request CHUNK_REBUILD when IC is off and there are dirty Kotlin files
Otherwise unexpected compile error might happen,
when there are Groovy files, but they are not dirty,
so Groovy builder does not generate source stubs,
and Kotlin builder is filtering out output directory
from classpath (because it may contain outdated Java classes).

Previously the issue was not detected,
because it was not possible to turn off the IC completely (in JPS),
only switch to the legacy IC.

    #KT-20138
2017-09-26 16:35:24 +03:00
Alexey Tsvetkov cb1ffdccd7 Add test where unused file is removed 2017-08-29 04:28:10 +03:00
Alexey Tsvetkov cf72b14b34 Fix typo in test name 2017-08-29 04:28:08 +03:00
Alexey Tsvetkov 141c889a84 Make test case more useful 2017-08-29 04:28:08 +03:00
Alexey Tsvetkov 5f9bad5905 Add JS specific build logs to inline properties IC tests
Unlike the JVM target platform, the JS back-end does
not track getters' and setters' usages separately,
so when either accessor of some property is changed,
all usages of that property will be rebuilt.
2017-08-29 04:28:07 +03:00
Alexey Tsvetkov 73b63bb343 Refactor inline properties tests 2017-08-29 04:28:07 +03:00
Alexey Tsvetkov b73d5cbe1f Mock constant search in JPS tests 2017-08-29 04:28:06 +03:00
Alexey Tsvetkov 2312013c41 Move JVM specific IC tests to separate dir 2017-08-29 04:28:06 +03:00
Alexey Tsvetkov 556c43ae00 Update lookup tracker test "classifierMembers"
Before the change, the initial build has been failing,
so lookups from deserialized descriptors were not tested.
2017-08-29 04:28:06 +03:00
Alexey Tsvetkov 1c4ada2008 Fix searching serialized classes package contains multiple fragments 2017-08-29 04:28:03 +03:00
Alexey Tsvetkov 0a5fe3ef7c Move JVM specific IC tests with class hierarchy changes 2017-08-29 02:24:38 +03:00
Alexey Tsvetkov e16c5ddb97 Avoid using JVM only APIs in IC tests to reuse with JS 2017-08-29 02:24:38 +03:00
Alexey Tsvetkov 23bc907d3f Move multi-module IC tests to separate dir
At the moment they are used only with JPS
2017-08-29 02:24:37 +03:00