Commit Graph

1268 Commits

Author SHA1 Message Date
Sergey Rostov dfe662364d JPS, minor: remove unused parameter 2018-11-22 08:40:32 +03:00
Sergey Rostov f70d01f657 Fix updating complementary files map in case of compilation errors
#KT-27868 Fixed

Previously given dirtyFiles was removed from complementaryFilesMap
exactly on call of clearComplementaryFilesMapping. This causes fail
of next build in case of compilation error of previous build on JPS
(since complementary files not known on second build). The right way
to do it is removing (replacing) them only after successful
build.

This was working on Gradle since Gradle rebuilds whole module (project)
in case of build error.
2018-11-22 08:40:32 +03:00
Sergey Rostov cc9892a27d JPS: Add tests for mpp complementary files tracking after build error (KT-27868) 2018-11-22 08:40:32 +03:00
Sergey Rostov 84d6c1df5a Add assertion for overwriting common sources flag
Wrong flag state causes compilation errors for optional expectation
(this flag is used to pass -Xcommon-sources)
2018-11-22 08:40:32 +03:00
Sergey Rostov 5a25d3ef58 Workaround for KT-28099 Duplicated dependency to common module
Duplicated dependencies causes duplicated source roots which in turns
causes duplicated files dirty state tracking.
2018-11-22 08:40:31 +03:00
Alexey Tsvetkov a41c2d759a Avoid catching exceptions from workers in GradleKotlinCompilerRunner
Exceptions were catched in `KotlinCompilerRunner.runCompiler`.
When the method from superclass is not used in
`GradleKotlinCompilerRunner`, the superclass does not make much sense
anymore, so I turned it into util object.
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov 37dfe2b608 Use Workers API for NMPP tasks
This change enables parallel execution of compile tasks in NMPP projects
within a subproject.

    #KT-28155 In Progress
2018-11-14 11:41:43 +03:00
Anton Bannykh 59009430e5 JS: report inline suspend functions to IC
* Also inline suspend lambda'a
* Also use correct JsName's in exported suspend inline fun's
* Also use less unused imports
2018-11-07 12:11:01 +03:00
Sergey Rostov cce125b982 JPS: Don't catch BuildDataCorruptedException as internal error.
BuildDataCorruptedException should be thrown up to `IncProjectBuilder`
to be handled by TeamCity.

#KT-27037 Fixed
2018-10-27 16:08:38 +03:00
Sergey Rostov 0b8d94a6b1 JPS: Fix initialization order for case when all kotlin rebuild.
#KT-27792 Fixed
2018-10-27 16:08:16 +03:00
Vyacheslav Gerasimov 4076923a26 as34: Apply changes from AS 3.3 2018-10-26 18:25:20 +03:00
Nikolay Krasko 17421ed14d 191: asm-all has 7.0-beta version in Intellij 191
Pass project to fetch extra parameters for asm-all work
2018-10-19 19:16:21 +03:00
Sergey Rostov bde6d841c1 IC: move CacheVersionManager from build_common to jps plugin, tests 2018-10-16 13:33:24 +03:00
Sergey Rostov 0d1f7965d4 JPS, CacheAttributesManager: remove unused methods 2018-10-16 12:29:58 +03:00
Sergey Rostov d91f6f8c43 IC: move CacheVersionManager from build_common to jps plugin 2018-10-16 12:29:58 +03:00
Sergey Rostov 5232f080d6 JPS: Fix updating cache format version for rebuilt targets by removing i/o optimization
Problem: previously, format-version.txt file was deleted while cleaning
target output on rebuild. Since directory was deleted, cache
attributesDiff stored in memory was not updated. This causes that on
saveExpectedStateIfNeeded does nothing.

The right way to fix it is move cache version format diff into
AbstractIncrementalCache, and override `clean()` method. But this is
hard to do for lookup storage, since used compilers set (jvm/js) will
known only after context init. This can be done by moving `expected`
attributes out of manager, but this is huge change for small benefit.

So, the optimal way for now is to write version for each build, even if
it is not changed.

#KT-27044 Fixed
2018-10-16 12:29:58 +03:00
Nikolay Krasko 07e305e5f4 Update dictionary: +infos, -kompiler 2018-09-25 15:52:21 +03:00
Sergey Rostov 5fc2267665 JPS, Tests: Encapsulate libraries root paths used in JPS tests 2018-09-14 10:34:30 +03:00
Sergey Rostov f1b97bb9be JPS: code cleanup 2018-09-14 10:34:30 +03:00
Sergey Rostov 39c76c7b11 JPS: fix daemon RPC serialization
#KT-26809 Fixed
2018-09-14 10:34:30 +03:00
Ilya Chernikov a03bfb3561 Implement support for non-kts scripts in gradle
#KT-26784 fixed
2018-09-13 20:47:21 +02:00
Sergey Rostov 9ae478e4fc JPS, Tests: migrate to master 2018-09-13 20:40:21 +03:00
Sergey Rostov 81cf3fbc28 JPS, minor: rename KotlinModuleBuildTarget.updateSourcesList to computeSourcesList 2018-09-13 20:30:35 +03:00
Sergey Rostov 9e6d6ad9da JPS, native: skip and report native modules as not supported
#KT-26648 Fixed
2018-09-13 20:30:35 +03:00
Sergey Rostov c8351c3da0 JPS, -Xcommon-sources: write tests 2018-09-13 20:30:34 +03:00
Sergey Rostov 313c27859a JPS tests: support _dependencies.txt and _steps.txt for better files sorting 2018-09-13 20:30:34 +03:00
Sergey Rostov 1b93f07a76 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 2018-09-13 20:30:33 +03:00
Sergey Rostov 8cd3b46f05 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.
2018-09-13 20:30:33 +03:00
Sergey Rostov 359909dcff JPS MPP tests: Don't do anything for common modules, enable js ic, fix test data 2018-09-13 20:30:33 +03:00
Sergey Rostov 4975ef7db5 JPS tests: restore MPP tests runner, support new MPP model 2018-09-13 20:30:32 +03:00
Sergey Rostov 808e83a01e 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().
2018-09-13 20:30:32 +03:00
Sergey Rostov 0b5a6f61bb JPS tests: move MockJavaConstantSearch to separate file to got rid of AbstractIncrementalJpsTest.kt.173 bunch file 2018-09-13 20:30:32 +03:00
Sergey Rostov b8c982bb72 JPS: support -Xcommon-sources for multiplatform projects
#KT-26489 Fixed
2018-09-13 20:30:31 +03:00
Ilya Gorbunov 3cc606577c Add annotations-13.0 in classpath of those tests where the annotations from stdlib were used 2018-09-13 02:41:19 +03:00
Ilya Gorbunov a18770fbbb Remove projectDist dependency helper usages
Use default configuration dependencies instead of projectDist ones.
2018-09-12 06:05:05 +03:00
Ilya Gorbunov afb62ffc0c 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
2018-09-11 04:19:49 +03:00
Alexey Sedunov 6206f1e419 MPP: Implement isTestModule flag (as required by JPS) 2018-09-10 17:27:41 +03:00
Ilya Gorbunov 903976d9af Replace hashCode usages in tests where it was supposed to fail on nullable receiver
Related to #KT-25039
2018-09-10 06:41:49 +03:00
Sergey Rostov 437fc9d749 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
2018-08-31 11:13:18 +03:00
Yan Zhulanow d00f5b335a MPP: Refactoring, extract IDE platform kinds, allow to add custom platforms 2018-08-31 05:14:15 +05:00
Dmitry Savvinov b23bf371cf 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.
2018-08-30 16:21:43 +03:00
Alexander Podkhalyuzin 69a0fedd9f 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
2018-08-30 16:21:40 +03:00
Alexander Udalov 0f003802fe Introduce -Xcommon-sources and pass it correctly from build tool plugins
#KT-25196 In Progress
2018-08-21 12:49:10 +02:00
Alexey Tsvetkov d09629972a Use same system property to avoid deleting module file in JPS and Gradle 2018-08-20 23:41:11 +03:00
Alexey Tsvetkov 3b4a49eebf Add test for KT-26064 2018-08-17 15:27:00 +03:00
Sergey Rostov 839a6b5e60 JPS: Support new MPP model. 2018-08-07 15:59:43 +03:00
Vyacheslav Gerasimov 8fc0c1d7b0 as33: Add AS 3.3 bunchset built with AS 3.3 C4 2018-08-02 20:53:17 +03:00
Vyacheslav Gerasimov a2bf417d75 Remove 172 bunchset 2018-08-02 19:32:18 +03:00
Alexey Tsvetkov 76b9b579bc Minor: fix 172 patchset 2018-07-23 23:10:14 +03:00
Alexey Tsvetkov ff35d509e6 Add test for KT-25540 2018-07-23 15:43:17 +03:00