383 Commits

Author SHA1 Message Date
Sergey Rostov 51ec98794b JPS, Tests: Encapsulate libraries root paths used in JPS tests
Original commit: 5fc2267665
2018-09-14 10:34:30 +03:00
Sergey Rostov 0a406e70eb JPS: code cleanup
Original commit: f1b97bb9be
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 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
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 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
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
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
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 1ab98f5817 Add test for KT-26064
Original commit: 3b4a49eebf
2018-08-17 15:27:00 +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 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
Alexey Tsvetkov 3ccf89be00 Register kotlin_module as output of all files
Previously kotlin_module was registered as output
only for files containing top-level declarations

Original commit: 5760b8cf8b
2018-07-09 15:48:11 +03:00
Alexey Tsvetkov 20a147e476 Fix compilation of plugin projects in JPS
#KT-25218 fixed

Original commit: f438b7501c
2018-07-04 14:54:07 +03:00
Sergey Rostov 2725c7b9ae 173: jps, mpp: fix AbstractIncrementalJpsTest.kt.173
Original commit: c71357dd76
2018-06-08 13:50:05 +03:00
Sergey Rostov 661f974e99 jps: checkCachesVersions for js and common (BuildMetaInfo save/check)
Original commit: 5a2ed364fe
2018-06-08 09:46:49 +03:00
Sergey Rostov c01e0935ba jps: improve KotlinDirtySourceFilesHolder
Original commit: 3cfb200e07
2018-06-08 09:46:48 +03:00
Sergey Rostov 8b4813c014 jps: Don't create cache for common modules (KOTLIN-CR-2028)
Original commit: d75a2be31b
2018-06-08 09:46:45 +03:00
Sergey Rostov 60494f27c6 jps, mpp: temporary disable mpp tests
Original commit: b2f58ad9c3
2018-06-08 09:46:38 +03:00
Sergey Rostov 5f818789cf 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

Original commit: 0eee2729cd
2018-06-08 09:46:37 +03:00
Sergey Rostov a64a2f694f jps: support dev kit module types (and all other ModuleBasedBuildTargetType). fix brunch 172
Original commit: 098e51d104
2018-05-24 14:59:46 +03:00
Sergey Rostov 79bf8f7c98 jps: support dev kit module types (and all other ModuleBasedBuildTargetType)
#KT-24500 fixed

Original commit: ec5110e1f4
2018-05-24 11:12:01 +03:00
Alexey Tsvetkov bc37e46187 Improve JPS progress messages
#KT-9218 fixed

Original commit: 7f865565a6
2018-05-18 23:50:08 +03:00
Sergey Rostov e4d51df269 jps (refactor): reimplement KotlinModuleBuildTarget data binding using CompileContext
Original commit: 9fafe0473c
2018-05-04 11:14:45 +03:00
Sergey Rostov 96725b1e36 jps: common modules metadata compiler
(cherry picked from commit cde333d)

Original commit: 91b703d529
2018-05-04 11:05:13 +03:00
Sergey Rostov ffd77601ca jps: minor: refine kotlin.jps.model package
(cherry picked from commit 2a31e78)

Original commit: 41dcc9ad4d
2018-05-04 11:05:12 +03:00
Sergey Rostov ef5d8435b6 jps(refactor): Extract platform related code
#KT-23656 Fixed

(cherry picked from commit 18a751d)

Original commit: 75e6be7802
2018-05-04 11:05:12 +03:00
Vyacheslav Gerasimov e50fca68fb Cleanup .181 bunch files
Original commit: 8c88ac69df
2018-04-27 18:25:21 +03:00
Vyacheslav Gerasimov 440d218436 Switch to 181 platform
Original commit: bc403ce744
2018-04-27 18:25:17 +03:00
Alexey Tsvetkov bdd795200c Make assertion message more readable in JPS test
The test was failing recently on CI, but assertion message
does not give enough info: arrays' sizes are not equal,
so there were extra warnings, but what they were?

Original commit: adc3e61742
2018-04-22 23:05:59 +03:00
Zalim Bashorov 1ad96a7db9 Regenerate tests
Original commit: ab03ab84bb
2018-04-19 13:17:27 +03:00
Alexey Tsvetkov ca18e9871a 181: Reimplement constant search in JPS
The API in Intellij have been changed after the PR was merged
(see https://github.com/JetBrains/intellij-community/commit/8227d8e2dd4d98d2ff248a1b193ba31831ddef50)

This commit implements new API.
Also mocked Kotlin constant search is removed from JPS tests.
Mocked Java search is in place, but now
it is does not use hardcoded file and constant names.

   #KT-16091 fixed

Original commit: 39f7ecc9a3
2018-04-11 16:28:38 +03:00
Nikolay Krasko 0e3c3859e9 172: [Tests] Revert "Modify incremental test in 173 branch - files are not create anymore"
This reverts commit 0cc5d163d7d620565a28681dab31f3d3061a1324.

Original commit: 4c8f366e46
2018-04-11 16:27:56 +03:00
Alexander Udalov 1fa4171942 Enable all Java 9 tests
Original commit: d2ed73eb78
2018-04-05 12:38:48 +02:00
Alexey Tsvetkov 88c4f73e3c Invalidate usages of removed classes before round
#KT-23165 fixed

Original commit: 3eb968807e
2018-04-03 21:11:12 +03:00
Alexey Tsvetkov a4a45b59df Remove usages of deprecated API
Original commit: bd779cb26e
2018-04-03 21:11:11 +03:00
Alexey Sedunov 78ee6ba693 JS: Use the same output paths for JPS and Maven-based builds
#KT-22586 Fixed

Original commit: ae37cc30a1
2018-04-02 15:28:35 +03:00
Alexey Tsvetkov 9a0b91ef31 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

Original commit: 605bcc66a1
2018-03-21 18:44:42 +03:00