Commit Graph

4027 Commits

Author SHA1 Message Date
Nikolay Chashnikov
dbe582ee4c [jps model] cache contents of loaded files when using the new implementation (IJPL-409)
Unlike the old implementation, the new one may call JpsComponentLoader.loadComponent multiple times for the same file, so it's better to cache content to speed up loading.

GitOrigin-RevId: 4c3630f24bdcb8740ef5cd3ba6d414febb0f9d77
2024-06-28 17:05:01 +00:00
Nikolay Chashnikov
55fb09873d [jps model] refactoring: extract and reuse JpsComponentLoader.loadComponent method
GitOrigin-RevId: 907421fa095075d727feb207538340cf41e4dcd6
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
c0393d751a [jps model] support loading project and module components in the new implementation (IJPL-409)
Data which is present in the workspace model is taken from it, other components are loaded from xml files as before.

GitOrigin-RevId: 368e2b15aa055bc3489fb944c334379f10f2725e
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
c6681283f6 [jps model tests] add runtime dependency on 'intellij.platform.workspace.jps' module in jps tests
This is needed to allow checking the new implementation (IJPL-409) using the old tests.

GitOrigin-RevId: c276d565e0d944a0d2f376db9178200b5add679a
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
ac5b260e40 [jps model tests] adapt test for invalid project configurations to the new implementation (IJPL-409)
The new implementation based on the workspace model behaves slightly differently for some projects with invalid configurations, tests should tolerate this.

GitOrigin-RevId: fa5a7c888aa60ff27507bff3b9a05fc3d68ececc
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
be1e0dfa61 [jps model] fix loading run configurations in the new implementation (IJPL-409)
GitOrigin-RevId: 27cdf2778e54cb115731f143f900c5d8f977d3cc
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
bafd0db912 [jps model tests] add tests on module paths in JpsProjectSerializationTest
GitOrigin-RevId: e889e6cffc4f00b0655e01c33a317724ff170298
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
bdcbfa2f00 [jps model tests] sort modules in testModuleProperties.ipr
Production code sorts modules before saving. Also, this is needed to simplify testing loading in the new implementation of JPS model (IJPL-409).

GitOrigin-RevId: f540342b831bf73cb0e717d51b92da323201edaf
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
a6554884e9 [jps model serialization] refactoring: pass externalConfigurationPath explicitly and use Path instead of String
This is needed to test loading external configuration in the new implementation of JPS model (IJPL-409) and to avoid conversions between Path and String.

JpsCompilerConfigurationTest changed to load the project configuration using JpsSerializationManager API and migrated to JUnit5.

GitOrigin-RevId: a9d85b2b8797cdecbc43c07339ad89511823d758
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
5730a1a367 [jps model] refactoring: extract code from JpsProjectLoader to JpsProjectConfigurationLoading
This is needed to reuse it for the new implementation of JPS model (IJPL-409).

GitOrigin-RevId: 510c9f53ac73ad2212de8af069a1e7bae299624f
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
1f2aea5493 [jps model] support TestModuleProperties and production-on-test dependencies in JpsModelBridge (IJPL-409)
GitOrigin-RevId: 0d4ba9e02e1880873fa6ffdca2b3a84b8935a962
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
fbcba43905 [jps tests] refactoring: rework jps serialization tests to use JpsSerializationManager API
JpsModelFromTestData utility is added which uses JpsSerializationManager instead of creating JpsModel and calling JpsProjectLoader directly. Tests are migrated to use it instead of extending JpsSerializationTestCase. This is needed to use these tests to verify the new implementation of JPS model serialization (IJPL-409). Also, the tests are migrated to JUnit 5.

GitOrigin-RevId: 874f0b01ea6ae5d31666b2dafb843052cc017024
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
c0bc5811fb [jps model] refactoring: replace inheritance from JpsLoaderBase by delegation and rename it to JpsComponentLoader
This is needed to refactor simplify JpsProjectLoader to allow reusing its code in the new implementation of the JPS model (IJPL-409).

GitOrigin-RevId: b88fb246454601489e7133df4b078e5e52f6da58
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
395c030d98 [jps model] refactoring: move code which reads external data for compiler configuration to the corresponding serializer
JpsProjectExtensionWithExternalDataSerializer is introduced to support project components which may have data in the external storage. Code related to loading the compiler configuration is moved from JpsProjectLoader to JpsJavaCompilerConfigurationSerializer. This is needed to refactor JpsProjectLoader to allow reusing its code in the new implementation of the JPS model (IJPL-409).

GitOrigin-RevId: c0e64c02c49e4a451da9b9743c240227bd6465a4
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
1d2b8c2b86 [jps model] refactoring: pass the path to the external project configuration explicitly and write tests
This is needed to provide a new implementation of the JPS model (IJPL-409).

GitOrigin-RevId: 3f47fa027e5d36be36d97d99eecc60ee750dde15
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
45e78213a5 [project model] cleanup: delete unused UnloadedModuleDescriptionImpl class
GitOrigin-RevId: 37e2cdc8e6d5ca01a624b8d24772d3b3732f671c
2024-06-28 17:05:00 +00:00
Eugene Zhuravlev
9918b9e892 JPS: support java17 sealed classes in incremental analysis
GitOrigin-RevId: b444675d623ff5138bf596225d642d80f0244cbf
2024-06-28 16:57:48 +00:00
Andrei.Kuznetsov
ffd202ba96 IJPL-157271: performance experiment: avoid synchronized in c.i.o.fileTypes.WildcardFileNameMatcher.RegexpMatcher
This will produce more very short-living garbage which looks harmless. Matcher class has about 20 fields inside. Keep aside that some of them are arrays, Matcher probably occupies 100-150 bytes in the memory. I.e. there will be 150-225MB of garbage for mid-size project like idea ultimate (~1.5M files). Looks acceptable, because preliminary experiments showed that this will decrease 2nd scanning by ~10% (10sec -> 9sec) because of better parallelization when indexing on 19 threads. More parallel environments (like dev pods) should probably show even better parallelization.

GitOrigin-RevId: 450ccf3105d31be2703e4da859a59f1ee6351b8e
2024-06-28 12:26:24 +00:00
Eugene Zhuravlev
d557c0611b temporarily expose constructor with the old signature to make kotlin jps tests run
GitOrigin-RevId: cbb453022f7bd8b404d8b3617f09a10bee57f359
2024-06-25 16:22:55 +00:00
Eugene Zhuravlev
eda69e546f IJPL-797 intellij.platform.jps.build review internal API
GitOrigin-RevId: 427a8ed45317296f90062605c81fa17bcc5c5288
2024-06-25 16:22:48 +00:00
Nikolay Chashnikov
a53b4de5f8 [jps model] initial prototype of a new JPS model's implementation which delegates to the workspace model (IJPL-409)
Implementations for the following elements are provided for now:
 * modules: content, source and excluded roots, custom properties of modules and source roots, dependencies;
 * libraries: roots and custom properties;
 * SDKs: roots and custom properties;
 * java: custom properties of modules and dependencies.

GitOrigin-RevId: 1829d8defa1b36148abfbd063264defdd6c16014
2024-06-24 23:52:58 +00:00
Eugene Zhuravlev
9d7db9822d IJPL-797 intellij.platform.jps.build.javac.rt review internal API
GitOrigin-RevId: 946f83227ef510e0b8e0eeb53f821480c6aa4595
2024-06-24 19:49:46 +00:00
Nikolay Chashnikov
9db2a6ec5c [jps model] refactoring: extract common code in intellij.platform.jps.model.serialization module
This is needed to reuse it in the new implementation based on the workspace model (IJPL-409).

GitOrigin-RevId: a749b014ea5d28a574c3b1999f23d4376ed27c4c
2024-06-24 19:27:40 +00:00
Nikolay Chashnikov
bca2fb2a6a [jps model] refactoring: extract JpsJavaAwareProject interface
This is needed to provide a new way to compute Java-specific properties in the new implementation based on the workspace model (IJPL-409).

GitOrigin-RevId: 6c70ab849acee3da22448400a6b6d08662dcab69
2024-06-24 19:27:40 +00:00
Nikolay Chashnikov
2544fb2116 [jps model] refactoring: extract base classes from JpsProjectImpl and JpsGlobalImpl
This is needed to reuse the common logic in the new implementation based on the workspace model (IJPL-409).

GitOrigin-RevId: 6082830eea7b13a6bae8545ae03286cba6df97c8
2024-06-24 19:27:40 +00:00
Eugene Zhuravlev
f2ff6d070b IJPL-797 intellij.platform.jps.build.launcher review internal API
GitOrigin-RevId: 0db8021fd1a1d42c58108d17833bedda6f656a19
2024-06-24 13:10:49 +00:00
Nikolay Chashnikov
1050a70ab8 [jps model] API cleanup: provide default implementation for deprecated 'asExternal' methods
This way we won't need to implement them in the new implementation of JPS model (IJPL-409).

GitOrigin-RevId: 699fb4f745d80c64671e1dbcea6dd6cee5a6d571
2024-06-21 16:10:29 +00:00
Nikolay Chashnikov
32c4bab1fe IJPL-797 intellij.platform.jps.model review internal API
Review is completed.

GitOrigin-RevId: 4829437e7f686bb209122930bfa5819f09854298
2024-06-20 18:28:24 +00:00
Nikolay Chashnikov
c95f84df0e IJPL-797 intellij.platform.jps.model review internal API
Mark as internal members which aren't supposed to be used by plugins. In particular, methods which modify the project model are excluded from API because they are supposed to be called from the implementation code when loading the project configuration from disk. Also, their presense would complicate migration of the JPS model's implementation to the workspace model (IJPL-409).

GitOrigin-RevId: fa717a689aba627a0a4e5bd768413447b8fc574b
2024-06-20 18:28:24 +00:00
Nikolay Chashnikov
99eb3105bc IJPL-797 intellij.platform.jps.model.serialization review internal API
Review is complete.

GitOrigin-RevId: 1a817bf29c1c8618879c3aa1cf0d6f7e97c2e8e4
2024-06-20 18:28:24 +00:00
Nikolay Chashnikov
c0e79911d1 IJPL-797 intellij.platform.jps.model.serialization review internal API
GitOrigin-RevId: d36211e54eb45a92e09366ca89d2657ef8dada95
2024-06-20 18:28:24 +00:00
Nikolay Chashnikov
1bfb6b0a41 IJPL-797 intellij.platform.jps.model.impl review internal API
Review is finished.

GitOrigin-RevId: 0bb2175340102e63cdb1d9f2f52126a0b08b8fbd
2024-06-20 18:28:24 +00:00
Nikolay Chashnikov
dc0da42c82 IJPL-797 intellij.platform.jps.model.impl review internal API
Extract CompilerConfiguration.addNewProcessorProfile method to allow plugins adding new profiles without using ProcessorConfigProfileImpl directly. For now, constructors of the latter are not marked as internal, but all other methods are.

GitOrigin-RevId: 7724f865866598daf8ca4b4f6ce48283c203feb1
2024-06-20 18:28:24 +00:00
Nikolay Chashnikov
50b5977130 IJPL-797 intellij.platform.jps.model.serialization review internal API
Hide some code from JPS Model to simplify migration to the new implementation (IJPL-409).

GitOrigin-RevId: 99397680db06fa27c3215aa5e164e983189f7fab
2024-06-18 07:31:44 +00:00
Nikolay Chashnikov
02e4e8e0e2 IJPL-797 intellij.platform.jps.model review internal API
Hide some code from JPS Model to simplify migration to the new implementation (IJPL-409).

GitOrigin-RevId: f8aa89460b37ee5115b9a30ed101bbe90b5757e2
2024-06-18 07:31:44 +00:00
Nikolay Chashnikov
2a7eebe190 [jps model] cleanup: fix visibility of the field type
GitOrigin-RevId: 729b663b4fbf22b0a1ffa008d9982665d9305be2
2024-06-18 07:31:44 +00:00
Nikolay Chashnikov
56ad91f12e [jps model] refactoring: extract code from JpsLibraryImpl to a separate class
This is needed to reuse it in the new implementation of JPS model (IJPL-409).

GitOrigin-RevId: 564c61143df84fc282132677ea4c86d223b2b850
2024-06-18 07:31:44 +00:00
Nikolay Chashnikov
4bcadeb074 [jps model] API: deprecate methods which mark references to JpsElement as external
This is needed to simplify the creation of JPS model's new implementation (IJPL-409). It seems that currently in ultimate monorepo these methods are used in tests only.

GitOrigin-RevId: b4b8f2f13b6e15c26488f2c6060558cfbfbae862
2024-06-18 07:31:44 +00:00
Nikolay Chashnikov
829ca1cf70 IJPL-797 intellij.platform.jps.model.impl review internal API
Reduce visibility and mark as internal elements which aren't supposed to be used from plugins. This is also needed to migrate the JPS model to delegate to the workspace model (IJPL-409).

GitOrigin-RevId: 8e2db16140a23f4ba073235f46f48a338a6c2292
2024-06-14 17:41:44 +00:00
Eugene Zhuravlev
2b6f628504 delete previous dependency cache data when switching "unified IC" on/off
GitOrigin-RevId: bce32dfbb3e543884dae82b5a159a29100ad9eb2
2024-06-13 13:24:28 +00:00
Eugene Zhuravlev
b5a68d54ec JPS mappings for incremental compilation refactoring: apply sealed classes invariant to both base and just affected sources
GitOrigin-RevId: 6cb4c7d318117e6ffb104ff213fe32c8f4e1a53d
2024-06-10 19:58:25 +00:00
Eugene Zhuravlev
a81152ec89 JPS mappings for incremental compilation refactoring: honor deleted sources when traversing; ensure affectSources won't affect a deleted source
GitOrigin-RevId: 29a99c4bfb7109548d4f33de6e1bca1cff34a5a4
2024-06-10 12:21:27 +00:00
Eugene Zhuravlev
542cb88aa2 JPS mappings for incremental compilation refactoring: some simplifications, better naming
GitOrigin-RevId: ec425888751ad78cc407acde02f755be8a6699a3
2024-06-08 11:12:41 +00:00
Eugene Zhuravlev
3c51ce3f64 JPS mappings for incremental compilation refactoring: ensure recursive sealed classes markup on the source-only differentiate stage; apply source-only differentiate rules for resulting affected files
GitOrigin-RevId: 6930f6611d0ff870db5d956f0d4b38535b2f6dc8
2024-06-07 22:00:11 +00:00
Nikolay Chashnikov
110ac6816a [jps model] API: deprecate methods which calls deprecated JpsElement.BulkModificationSupport.createCopy
This is needed to get rid of createCopy method to simplify the creation of new implementation of JPS model (IJPL-409).

GitOrigin-RevId: 241fc9b4740d19d8c1dbf979bebb62687492dde1
2024-06-07 19:46:32 +00:00
Nikolay Chashnikov
29dc7b0426 [jps] refactoring: introduce JpsPackagingElement.createElementCopy and use it instead of deprecated JpsElement.BulkModificationSupport.createCopy
This is needed to simplify the creation of new implementation of JPS model (IJPL-409).

GitOrigin-RevId: 0aceb48ec236972a71c51b79bbd4ff0d9c0f56cb
2024-06-07 17:22:19 +00:00
Nikolay Chashnikov
88be72e89c IJPL-797 intellij.platform.jps.model.impl review internal API
Visibility of classes changed to package private where possible, other classes without external usages are marked as @Internal. This is also needed to migrate JPS model to delegate to workspace model (IJPL-409).

GitOrigin-RevId: 05670d940d1fe5abb20a02d6f6659863ffc89d1f
2024-06-07 11:33:05 +00:00
Nikolay Chashnikov
fa55f843f7 [jps model] mark JpsModelSerializerExtension::saveExtension for removal and update javadoc
This is needed to make it easier to provide a new implementation of JpsModel delegating to Workspace Model (IJPL-409).

GitOrigin-RevId: 16e3a57ebccd561a3fc9cbbf54b1ed474563cf5f
2024-06-07 11:33:02 +00:00
Nikolay Chashnikov
3e4e0aa4f1 [jps model] javadoc: fix references to EntityStorage
GitOrigin-RevId: 6e7603eaa9d5aad8ae5ae3283e9f2fc1aec31f77
2024-06-07 11:32:58 +00:00
Eugene Zhuravlev
2c0ec37263 JPS mappings for incremental compilation refactoring: track kotlin metadata KmClass modality changes and sealed subclasses list changes
GitOrigin-RevId: ae24bea813ff0c424ee28fedae9ebb16ca2eef33
2024-06-05 22:46:01 +00:00