Commit Graph

1316 Commits

Author SHA1 Message Date
Sergey Rostov 0a406e70eb JPS: code cleanup
Original commit: f1b97bb9be
2018-09-14 10:34:30 +03:00
Sergey Rostov 1424bd16d0 JPS: fix daemon RPC serialization
#KT-26809 Fixed

Original commit: 39c76c7b11
2018-09-14 10:34:30 +03:00
Ilya Chernikov cbc602a1f7 Implement support for non-kts scripts in gradle
#KT-26784 fixed

Original commit: a03bfb3561
2018-09-13 20:47:21 +02:00
Sergey Rostov 378cfbf442 JPS, Tests: migrate to master
Original commit: 9ae478e4fc
2018-09-13 20:40:21 +03:00
Sergey Rostov 3a7f2ff5c5 JPS, minor: rename KotlinModuleBuildTarget.updateSourcesList to computeSourcesList
Original commit: 81cf3fbc28
2018-09-13 20:30:35 +03:00
Sergey Rostov e47d796bd7 JPS, native: skip and report native modules as not supported
#KT-26648 Fixed

Original commit: 9e6d6ad9da
2018-09-13 20:30:35 +03:00
Dmitriy Dolovov bc766111a6 Move NativeIdePlatformKind to idea-jps-common
Issue #KT-26714 Fixed

Original commit: 0c94aefb87
2018-09-13 20:30:34 +03:00
Sergey Rostov 4cc52c1dff JPS, -Xcommon-sources: write tests
Original commit: c8351c3da0
2018-09-13 20:30:34 +03:00
Sergey Rostov ac5fbd4080 JPS tests: support _dependencies.txt and _steps.txt for better files sorting
Original commit: 313c27859a
2018-09-13 20:30:34 +03:00
Sergey Rostov 461df40078 JPS tests: support custom mpp multi module tests, rearrange test data files for more consistency, configure js modules with facet (not with stdlib dependency which should be deprecated), temporary mute some complex mpp tests
Original commit: 1b93f07a76
2018-09-13 20:30:33 +03:00
Sergey Rostov c85464d2ae JPS, -Xcommon-sources: don't iterate on all sources, use root info from DirtySourceFilesHolder. Cleanup code.
Also:
- Pass `-Xcommon-sources` argument to JS compiler.
- Calculate all sources list only when needed (after change it is not required to calculate common-sources)
- Remove `chunk: ModuleChunk` parameter from some `KotlinModuleBuildTarget` functions.

Original commit: 8cd3b46f05
2018-09-13 20:30:33 +03:00
Sergey Rostov d015b8b8a1 JPS MPP tests: Don't do anything for common modules, enable js ic, fix test data
Original commit: 359909dcff
2018-09-13 20:30:33 +03:00
Sergey Rostov 2b967e571c JPS tests: restore MPP tests runner, support new MPP model
Original commit: 4975ef7db5
2018-09-13 20:30:32 +03:00
Sergey Rostov 0eef15508f JPS tests: switch to new dependencies.txt parser
Order of modules changed because new parser preserve order, while previously modules are accidentally sorted by hashCode().

Original commit: 808e83a01e
2018-09-13 20:30:32 +03:00
Sergey Rostov d87777ae4d JPS tests: move MockJavaConstantSearch to separate file to got rid of AbstractIncrementalJpsTest.kt.173 bunch file
Original commit: 0b5a6f61bb
2018-09-13 20:30:32 +03:00
Sergey Rostov 22b71e0b8e JPS: support -Xcommon-sources for multiplatform projects
#KT-26489 Fixed

Original commit: b8c982bb72
2018-09-13 20:30:31 +03:00
Ilya Gorbunov 1d4ebded45 Add annotations-13.0 in classpath of those tests where the annotations from stdlib were used
Original commit: 3cc606577c
2018-09-13 02:41:19 +03:00
Ilya Gorbunov 3522140643 Remove projectDist dependency helper usages
Use default configuration dependencies instead of projectDist ones.

Original commit: a18770fbbb
2018-09-12 06:05:05 +03:00
Ilya Gorbunov 9cd0759e8d Update testData for incremental compilation tests
- enumMemberChanged, flagsAndMemberInSameClassChanged: added top level function results in a file class being generated
- companionObjectNameChanged: one more file is marked as dirty after the changes in build 1.2.70-dev-1439

Original commit: afb62ffc0c
2018-09-11 04:19:49 +03:00
Alexey Sedunov 8a5d392e8d MPP: Implement isTestModule flag (as required by JPS)
Original commit: 6206f1e419
2018-09-10 17:27:41 +03:00
Ilya Gorbunov 947a6399eb Replace hashCode usages in tests where it was supposed to fail on nullable receiver
Related to #KT-25039

Original commit: 903976d9af
2018-09-10 06:41:49 +03:00
Mikhail Glukhikh 8cf9c66b1b MPP: make platformByCompilerArguments a bit safer
Original commit: 5e3fd189a4
2018-09-07 20:55:30 +03:00
Dmitriy Dolovov 63b8d88249 MPP: extend IdePlatformKind EP & determine it by CommonCompilerArguments
Original commit: 5633d86cb2
2018-09-07 20:55:29 +03:00
Yan Zhulanow 57c71058b0 Use IdePlatform instead of IdePlatformKind in 'Kotlin Facet' project structure tab
Original commit: 2ec1a89fa1
2018-09-06 14:42:21 +03:00
Yan Zhulanow 438c370fec MPP: Fix compatibility issue with Android Studio 3.3 Canary 7
'TargetPlatformKind' is still used in AS 3.3 so we can't remove it entirely yet.

Original commit: f55a52b86e
2018-09-06 14:42:19 +03:00
Yan Zhulanow c5bce70edb Do not use ApplicationExtensionDescriptor in JPS (KT-26542)
The 'ExtensionPointName' class that ApplicationExtensionDescriptor uses is missing in the JPS classpath.
Now we don't use it unless the IDEA Application is properly initialized.

Original commit: 7398a8149d
2018-09-04 14:54:45 +03:00
Sergey Rostov aa1eb9795d JPS: Refactor cache compatibility checking and build targets loading/dependency analysis.
CacheVersion class refactoring:

Responsibilities of class CacheVersion are splitted into:
	- interface CacheAttributesManager<Attrs>, that should:
	    - load actual cache attribute values from FS
	    - provide expected attribute values (that is required for current build)
	    - checks when the existed cache (with actual attributes) values is suitable for current build (expected atribute values)
	    - write new values to FS for next build
	- CacheAttributesDiff is created by calling CacheAttributesManager.loadDiff extension method. This is just pair of actual and expected cache attributes values, with reference to manager. Result of loadDiff can be saved.

CacheAttributesDiff are designed to be used as facade of attributes operations: CacheAttributesDiff.status are calculated based on actual and expected attribute values. Based on that status system may perform required actions (i.e. rebuild something, clearing caches, etc...).

Methods of CacheAttributesManager other then loadDiff should be used only through CacheAttributesDiff.
Build system should work in this order:
    - get implementation of CacheAttributesManager for particular compiler and cache
    - call loadDiff __once__ and save it result
    - perform actions based on `diff.status`
    - save new cache attribute values by calling `diff.saveExpectedIfNeeded()`

There are 2 implementation of CacheAttributesManager:
    - CacheVersionManager that simple checks cache version number.
    - CompositeLookupsCacheAttributesManager - manager for global lookups cache that may contain lookups for several compilers (jvm, js).

Gradle:

Usages of CacheVersion in gradle are kept as is. For compatibility this methods are added: CacheAttributesManager.saveIfNeeded, CacheAttributesManager.clean. This methods should not be used in new code.

JPS:

All JPS logic that was responsible for cache version checking completely rewritten.

To write proper implementation for version checking, this things also changed:
	- KotlinCompileContext introduced. This context lives between first calling build of kotlin target until build finish. As of now all kotlin targets are loaded on KotlinCompileContext initialization. This is required to collect kotlin target types used in this build (jvm/js). Also all build-wide logic are moved from KotlinBuilder to KotlinCompileContext. Chunk dependency calculation also moved to build start which improves performance for big projects #KT-26113
	- Kotlin bindings to JPS build targets also stored in KotlinCompileContext, and binding is fixed. Previously it is stored in local Context and reacreated for each chunk, now they stored in KotlinCompileContext which is binded by GlobalContextKey with this exception: source roots are calculated for each round, since temporary source roots with groovy stubs are created at build time and visible only in local compile context.
	- KotlinChunk introduced. All chunk-wide logic are moved from KotlinModuleBuildTarget (i.e compiler, language, cache version checking and dependent cache loading)
	- Fix legacy MPP common dependent modules

Cache version checking logic now works as following:
- At first chunk building all targets are loaded and used platforms are collected. Lookups cache manger is created based on this set. Actual cache attributes are loaded from FS. Based on CacheAttributesDiff.status this actions are performed: if cache is invalid all kotlin will be rebuilt. If cache is not required anymore it will be cleaned.
- Before build of each chunk local chunk cache attributes will be checked. If cache is invalid, chunk will be rebuilt. If cache is not required anymore it will be cleaned.

#KT-26113 Fixed
#KT-26072 Fixed

Original commit: 437fc9d749
2018-08-31 11:13:18 +03:00
Yan Zhulanow dc022aef69 MPP: Refactoring, extract IDE platform kinds, allow to add custom platforms
Original commit: d00f5b335a
2018-08-31 05:14:15 +05:00
Dmitry Savvinov fd8083bb4b Always pass languageVersion explicitly to JPS compiler
When 'languageVersion' isn't passed explicitly, compiler will choose
'LATEST_STABLE'.

This may lead to spurious migration of a project to the next major
version after plugin update (e.g. when user had project of major
version X and then installed plugin of version X+1 -- in such case,
meaning of "no language version" suddenly changes).

So, we set it to RELEASED_VERSION, which is exactly the version
that is safe to use as the fallback.

Original commit: b23bf371cf
2018-08-30 16:21:43 +03:00
Alexander Podkhalyuzin f88c703b93 When version is not defined we need to fallback to released
There are few more such places. Better fix would be to avoid
situation, when we need to fallback. So in every project these
settings are defined. It means "Latest stable" setting is not good.

#KT-26364 Fixed

Original commit: 69a0fedd9f
2018-08-30 16:21:40 +03:00
Alexey Sedunov 63372baea9 Configuration: Do not auto-advance "Latest Stable" to pre-release version
#KT-25611 Fixed

Original commit: 5ac5a8d723
2018-08-30 14:57:39 +03:00
Alexey Sedunov b48d055334 Configuration: Drop coroutines for language >= 1.3
#KT-25681 Fixed

Original commit: a490781213
2018-08-30 14:57:37 +03:00
Ilmir Usmanov 1d1d959e27 Add warning on -Xcoroutines flag use
The only case when warning is not reported is -Xcoroutines=default.
But this is OK until the flag is removed completely.

Original commit: cf1f194f8b
2018-08-30 14:55:50 +03:00
Alexander Udalov 9c21dae5e2 Introduce -Xcommon-sources and pass it correctly from build tool plugins
#KT-25196 In Progress

Original commit: 0f003802fe
2018-08-21 12:49:10 +02:00
Alexey Tsvetkov bf4565259b Use same system property to avoid deleting module file in JPS and Gradle
Original commit: d09629972a
2018-08-20 23:41:11 +03:00
Alexey Tsvetkov 1ab98f5817 Add test for KT-26064
Original commit: 3b4a49eebf
2018-08-17 15:27:00 +03:00
Alexey Sedunov 135fcbcb58 MPP: Use new MPP model to find modules for 'expect'/'actual'
#KT-25955 Fixed

Original commit: 49b5695664
2018-08-13 19:03:03 +03:00
Sergey Rostov c475e35489 JPS: Support new MPP model.
Original commit: 839a6b5e60
2018-08-07 15:59:43 +03:00
Alexey Sedunov 5b1ea61cd1 Gradle: Implement new MPP model import
Original commit: ecf607d4fa
2018-08-07 15:59:41 +03:00
Vyacheslav Gerasimov 350e68b20f as33: Add AS 3.3 bunchset built with AS 3.3 C4
Original commit: 8fc0c1d7b0
2018-08-02 20:53:17 +03:00
Vyacheslav Gerasimov a15011db12 Remove 172 bunchset
Original commit: a2bf417d75
2018-08-02 19:32:18 +03:00
Alexey Tsvetkov dfcd4692ac Minor: fix 172 patchset
Original commit: 76b9b579bc
2018-07-23 23:10:14 +03:00
Alexey Tsvetkov a72d505153 Add test for KT-25540
Original commit: ff35d509e6
2018-07-23 15:43:17 +03:00
Alexey Tsvetkov 1602409341 Add multi-module JS IC tests with JPS
Original commit: 11977cc1c1
2018-07-23 15:43:17 +03:00
Alexey Tsvetkov 7a26158177 Minor: rename setIsEnabled->setIsEnabledForJvm
Original commit: 3227300f18
2018-07-23 15:43:17 +03:00
Alexey Tsvetkov 7f3cda4894 JS IC: track lookups from libraries
Otherwise we don't track lookups from other modules

    #KT-25540 fixed

Original commit: 8f002fdb43
2018-07-23 15:43:17 +03:00
Alexey Tsvetkov 35c62ecaec Report info message when JS IC is enabled in JPS
Original commit: c8c0c773fb
2018-07-23 15:43:17 +03:00
Alexey Tsvetkov ad7f554208 Use separate system properties to control IC for JVM and JS
Also this commit effectively disables JS IC by default

     #KT-25563 fixed

Original commit: 0b18380770
2018-07-23 15:43:16 +03:00
Alexander Udalov 0a50498536 Add BinaryVersion to DeserializationContext
This will be useful to implement version-dependent deserialization,
which is needed for gradual fixes of issues in metadata

 #KT-25120 In Progress

Original commit: 4122021090
2018-07-18 17:58:46 +02:00
Alexander Udalov fbe3053f88 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 d8e591f873, 930319281f, 5a048fea6b).

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)

Original commit: 1f0fb4823f
2018-07-16 13:45:11 +02:00