Commit Graph

4038 Commits

Author SHA1 Message Date
Eugene Zhuravlev
1af4f1f880 process 'directSubclasses' instead of 'allSubclasses' when checking permitted implementations of a sealed class (IJPL-158065)
GitOrigin-RevId: 9b52fe2351f2560780d09f5a4b150fddee6e3c54
2024-07-11 15:43:30 +00:00
Eugene Zhuravlev
40bbc9947b JPS: support java16 instanceof pattern matching
GitOrigin-RevId: 5a2777c4234e63621c1daf4bc11da402edaae8f5
2024-07-05 17:52:09 +00:00
Eugene Zhuravlev
7ffc3f8f8b JPS: generalize support for java17 sealed classes; supported case when permitted list gets reduced
GitOrigin-RevId: 9be5ef80b3dd00509cbe9e5dce2f9f00c4b6557a
2024-07-05 17:52:09 +00:00
Mikhail Mazurkevich
f633af3bc6 [xxh3] IJPL-157789 Fix incorrect implementation of InputStreamAccess for Xxh3 hashing algorithm
The problem may occur when the algorithm is trying to hash the latest stripe. For the latest stripe it can request the bytes from the latest and penultimate chunks. As a solution, it was decided to read the stream until the end if we are at the penultimate block.

GitOrigin-RevId: da68cd5e81f6aa7ed8d51b1bcad1dee983034e8f
2024-07-04 11:24:02 +00:00
Nikolay Chashnikov
80ab1eb4f1 [jps model] javadoc: add clarifying javadoc to JpsPluginManager
GitOrigin-RevId: 26cae2828af63c9f9ebbeae49edc2a120d0ae9ec
2024-07-04 10:11:28 +00:00
Louis Vignier
e5e01dbdae [jdk] Add Homebrew OpenJDK variant
#IDEA-327641

GitOrigin-RevId: eca9f777c82cbbb745fca267e50dd94f6fc82021
2024-07-03 15:56:40 +00:00
Nikolay Chashnikov
402b82fe0e [jps model] create correct references to modules and libraries if the new implementation of JpsModel is used (IJPL-409)
JpsModuleReferenceImpl and JpsLibraryReferenceImpl won't resolve if the new implementation is used, so parts of JpsModel which aren't converted to use the workspace model, also need to use *Bridge implementations.

GitOrigin-RevId: 25eb3336d29457ae0c735d74e42960e87cc89b49
2024-07-03 13:23:43 +00:00
Nikolay Chashnikov
b79f0b54e9 [jps model] load generic facets in the implementation of JpsModel based on the workspace model (IJPL-409)
JpsModuleExtensionBridge API is introduced which allows converting child entities of ModuleEntity in the workspace model to child elements of JpsModule in the build process.

GitOrigin-RevId: 86277abed01980441b40f7eec3bcd16ca57e040f
2024-07-03 13:23:43 +00:00
Nikolay Chashnikov
a58a3ce331 [jps model tests] use 'loadModel' in JpsProjectSerializationTest.loadProject
This allows using this test for checking loading from caches (IJPL-409).

GitOrigin-RevId: 4bda1c8166722ed860607517e1925ffaff60aabe
2024-07-03 13:23:43 +00:00
Bas Leijdekkers
14315c7ca4 [java] introduce language level for Java 23
GitOrigin-RevId: d64d154c243f5c1810bf08790a1df44a6ac948cb
2024-07-03 10:13:47 +00:00
Nikolay Chashnikov
a084afb985 [jps build] provide a way to load the project model from workspace model cache files (IJPL-409)
GitOrigin-RevId: 2d76047ec29c4ae555f67171e725867046b4eaaa
2024-07-01 14:04:06 +00:00
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