Commit Graph

289 Commits

Author SHA1 Message Date
Mikhail Filippov
bf43f2fc01 IJPL-150165 bump Kotlin language and API version
GitOrigin-RevId: a59dc8ca214a5047773fccf1cf28a1e1b07acf68
2024-08-30 22:15:55 +00:00
Alex Plate
7f1b92aeff [Workspace Model] [IJPL-161113] Extract LegacyBridgeJpsEntitySourceFactory
GitOrigin-RevId: e63b268499dcca0736144618ff891eca93b3f92d
2024-08-27 16:19:06 +00:00
Alex Plate
f093067ae0 [Workspace Model] [IJPL-161113] Extract createEntitySourceForArtifact into the separate service
GitOrigin-RevId: 58c2a87fdd325a95c738117e97468de38e090605
2024-08-27 16:19:06 +00:00
Nikolay Chashnikov
35a9f9cbc7 [jps model] make JpsLibraryCollectionBridge a real JpsElement (IJPL-409)
We have code that invokes `jpsLibrary.getParent().getParent()` to get a JpsModule instance for a module-level library. To keep such code working, we need to have JpsModule and JpsProject as super-parents (not direct parents) of JpsLibrary instances in the new implementation as well.

GitOrigin-RevId: a5f944d152229275b05efdfc686afa091c3fd963
2024-08-14 17:15:46 +00:00
Vladimir Krivosheev
1ed0c32b06 IJPL-159596 prefer SynchronizedClearableLazy
GitOrigin-RevId: 0409e7a776832a4f30e02106edc390dbddd8bf52
2024-08-06 19:58:37 +00:00
Nikita Kudrin
cdf91bf213 [benchmarks] Renaming PerformanceTest* => Benchmark*
GitOrigin-RevId: 9963b84d51e1062acc262a8d3d3de1409a708e3b
2024-07-23 18:20:01 +00:00
Mikhail Mazurkevich
1ddfba7249 Revert "[workspace model] IDEA-356368 Add more logging"
This reverts commit 1d98a64f

GitOrigin-RevId: 6851dcf24e56b4f2875bd119219e30634b03d88c
2024-07-23 08:42:13 +00:00
Nikolay Chashnikov
14c1c5ec10 [jps build] use relative paths when loading the workspace model from cache if and only if IDE uses relative paths (IJPL-157801)
StorageSerializerUtil.getVirtualFileUrlSerializer stores VirtualFileUrl instance in completely different format if 'ide.workspace.model.store.relative.paths.in.cache' registry option is enabled. Deserialization in the build process must use the same format as the IDE, so now value of this registry options is passed as 'ide.workspace.model.store.relative.paths.in.cache' system property to the JPS build process and used there to switch relativization on or off.

GitOrigin-RevId: a87b7f4f1a2c073a8d1fdaaa72a38b5dc11d0e01
2024-07-22 18:59:54 +00:00
Alex Plate
001086724a [Workspace Model] Uncomment the teamcity check for slow tests
This change was accidentally commited

GitOrigin-RevId: 38681769a3ec7b130db5f5c2be8164ceb6428ba3
2024-07-22 15:49:43 +00:00
Nikolay Chashnikov
b9a158915c [workspace model tests] cleanup: remove duplicating function and replace qualified name with import
GitOrigin-RevId: ae655267718483f5d468a511343c617050e283a9
2024-07-22 13:09:44 +00:00
Mikhail Mazurkevich
7421a2a702 [workspace model] IDEA-356368 Add more logging
GitOrigin-RevId: 1d98a64f122bc734bd12614455d641f7613dbc0e
2024-07-19 21:16:49 +00:00
Nikolay Chashnikov
786f4f4493 [tests] restore the path of the application store after the test finishes (IJPL-115184, IJI-2040)
Otherwise, next tests will store application-level data in the temporary directory instead of using PathManager.getConfigPath, causing failures (e.g. PluginModuleCompilationTest).

GitOrigin-RevId: ee74f364b1d718b9cfa89a4e49f2b0e405189647
2024-07-19 20:34:02 +00:00
Mikhail Mazurkevich
629be18c01 [workspace model] IDEA-356368 Enable trace logging for jps serialization
GitOrigin-RevId: 69cbd28d4e2b7d87265af19ef0afb1361219b4dd
2024-07-17 15:28:10 +00:00
Nikolay Chashnikov
9b120b14c5 [workspace model] docs: mention proper issue in a todo comment
GitOrigin-RevId: 4bc6ba2344421958e4e87cf9b3cf70f18d70e236
2024-07-17 10:04:59 +00:00
Nikolay Chashnikov
19f403936d [jps model] API cleanup: mark JpsSdkDependency.isInherited as deprecated
The method always returned 'false'. It doesn't make sense to improve this given that the JPS model is being migrated to Workspace Model (IJPL-409).

GitOrigin-RevId: ab8ef8486227e51e19a0028fe171ad44de73cca0
2024-07-15 11:13:39 +00:00
Mikhail Mazurkevich
6122138a6b [workspace model] IJPL-1113 Disable WSM cache relativizing
GitOrigin-RevId: 5c5d746d1b479abef791d8a0a9693ca86f86d1da
2024-07-11 18:07:25 +00:00
Mikhail Mazurkevich
ea4d46495a [workspace model] IJPL-14784 Improve documentation for JpsProjectFileEntitySource
GitOrigin-RevId: 359624b6cb66d4dc3302abeccf4009f0fb0eb56c
2024-07-08 15:10:14 +00:00
Alex Plate
4e3ba9189e [Workspace Model] [IJPL-14579] Do not throw rootsChanged in case the order of library roots groups has changed
The previous project model collected roots grouped by the root type. Because the order of keys doesn't exist in maps, the `iml` save sorted the groups alphabetically. And after the `iml` was loaded, this sorting didn't affect the library itself.

In case of `LibraryEntity`, the roots are stored in the flat list, so such sorting will cause `LibraryEntity` change. With an additional logic, we'll avoid an extra "roots changed" event

GitOrigin-RevId: b82823dd5b1a2a266bdda73b65ef51af6c4f5f24
2024-07-03 22:10:39 +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
8f5fabebbc [jps model] use default settings if JavaModuleSettingsEntity is missing in the workspace model (IJPL-409)
GitOrigin-RevId: 357e8d0a77e3b2efcbb7d91f6bdf694b4717dd0d
2024-07-03 13:23:43 +00:00
Nikolay Chashnikov
338199a682 [workspace model] cleanup: fix typo in parameter name
GitOrigin-RevId: 29b26083c8a73c6d996bc21180f4a70a49ac587d
2024-07-03 13:23:43 +00:00
Nikolay Chashnikov
e8f683a229 [jps build] use proper UrlRelativizer for deserialization of workspace model cache in JPS build process (IJPL-409)
GitOrigin-RevId: e371a3801524e0c0476663aea3564b0bb5d5d5ff
2024-07-03 13:23:43 +00:00
Nikolay Chashnikov
2c572dc97b [workspace model] refactoring: move JpsProjectUrlRelativizer to intellij.platform.workspace.jps module
This is needed to reuse it in the JPS build process (IJPL-409).

GitOrigin-RevId: 6b44e5b72beccdfedb8e57f20204be3065a7bb61
2024-07-03 13:23:43 +00:00
Nikolay Chashnikov
9b9ac93ac8 [workspace model] refactoring: replace Project parameter by projectBaseDirPath in JpsProjectUrlRelativizer
This is needed to move the latter to to intellij.platform.workspace.jps module to reuse it in the JPS build process (IJPL-409).

GitOrigin-RevId: 128a318e9f36a7efa06cc1dc3dcbded8212f0ccc
2024-07-03 13:23:43 +00:00
Nikolay Chashnikov
5db8936159 [workspace model] refactoring: move ApplicationLevelUrlRelativizer to intellij.platform.workspace.jps module
This is needed to reuse it in the JPS build process (IJPL-409).

GitOrigin-RevId: 14ee4f0d9546496c6f14156205ef734b40e6c251
2024-07-03 13:23:43 +00:00
Alex Plate
6778419025 [Workspace Model] [IJPL-156456] Increase benchmark size for the changelog
GitOrigin-RevId: f7b0821d3a27b66c8e77497821f50c2500a4138e
2024-07-02 13:51:51 +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
8924430bf0 [jps model] use the proper path to the global options directory inside the build process (IJPL-409)
GitOrigin-RevId: 767efdcd11209a23b0ab844d60312e90e61a98a9
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
2e8cb4a8e1 [jps model] fix loading attributes of iml root tag in the new implementation (IJPL-409)
The workspace model uses configurationStore API to load data, and there attributes of the root tag are represented as options in an artificial DeprecatedModuleOptionManager component.

GitOrigin-RevId: 2a0a197e8f41c491d5b9ffd9f707a9e2315f1301
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
8b44a792d5 [project model] cleanup: mark the parameter of UnloadedModulesNameHolder.isUnloaded as not-null
And fix cases where null was actually passed. Before, it was easy to forget to check it for null in the implementations.

GitOrigin-RevId: 72b7bf041e873f40ef95db97e897e628a714f756
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
e8846f629c [jps model] support loading generic facets entities in the new implementation (IJPL-409)
GitOrigin-RevId: 6e79f0a4e191ae81254a185c16e6e092f6fc73c4
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
a35167f7d0 [jps model] return modules in sorted order in the new implementation (IJPL-409)
Modules are sorted in the modules.xml file, but entities may be added in arbitrary order due to concurrent loading. So they should be sorted during conversion to JPS model for consistency with the old implementation and have stable behavior in the build process.

GitOrigin-RevId: 1e12f2930f702b80b089985d8e91cee03da10292
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
f1f084f62d [jps model] don't fail with exception in the new implementation if an invalid language level is specified in iml (IJPL-409)
GitOrigin-RevId: 8688952a1c27d07e1414ebf1afc1cf6b702c0921
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
91c91604a5 [jps model] fix resolving module references in the new implementation (IJPL-409)
GitOrigin-RevId: 0d003f25bc180690818a0c6b8c0024c69d856bc4
2024-06-28 17:05:00 +00:00
Nikolay Chashnikov
d1c0fa3d3b [jps model] use production output instead of test output if the latter isn't specified in the new implementation of JPS Model (IJPL-409)
This is needed for consistency with the old implementation.

GitOrigin-RevId: 4ad386e6c55e1b25459cb542cbc2e8c1dd7f1f44
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
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
c992e6c464 [jps model] refactoring: rename JpsProjectAdditionalData.projectJdkId to projectSdkId
GitOrigin-RevId: 4ab074c0c41edd62a262e91715dbf534ba430e11
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
Alex Plate
b2e8213d11 [Workspace Model] [IJPL-156456] Add a benchmark for changelog performance
GitOrigin-RevId: dfc5fdb382b3bea128c2e8a5863439e09887d71a
2024-06-27 15:51:28 +00:00
Alex Plate
a5fcf97ba3 [Workspace Model] Move VersionedStorageChangeInternal into the impl subpackage
After the review note in https://jetbrains.team/p/ij/reviews/138027/timeline?chat-panel-active=true

GitOrigin-RevId: 976f2d79906d7b206d308621cfad22b7bd76351d
2024-06-27 11:37:13 +00:00
Alex Plate
212e81b1ca [Workspace Model] Hide getAllChanges to the internal interface VersionedStorageChangeInternal
Users should not access all changes inside the workspace model and only process the changes that are relevant to their subsystem.

Internal discussion: https://jetbrains.slack.com/archives/G0142J1B20N/p1719324452271479

GitOrigin-RevId: 46bfaa0f41b4d92c7ec525d7505b4ba13c89532c
2024-06-26 21:18:15 +00:00
Alex Plate
7746460f32 [Workspace Model] [IJPL-867] Refactor deletion of iml files for removed imported modules
`iml` files of imported modules are not automatically removed due to different circumstances.
Because of this issue, the external build system did this manually for many years.
Unfortunately, this also affects the serialization of files and caused IJPL-867.

To fix the IJPL-867 issue, the following steps are taken:
- Get rid of manual `iml` removal by the external build system (`AbstractModuleDataService`).
- Update jps serializer to mark the imported iml for deletion.
- The `.iml` should not be deleted by the component store, but it's not due to IJPL-926. Ideally, we fix IJPL-926, but for now do the workaround: remove the ` iml ` file on the level of JPS serialization.

These steps fix the IJPL-867 issue, but a further fix for IJPL-926 is still needed.

# Notes
- Test `ExternalSystemProjectSaveTest` is created as a separate class that uses JUnit 4, however, this test can be placed in `ExternalSystemProjectTest`. The problem is that `ExternalSystemProjectTest` uses JUnit 3 and it freezez on `project.stateStore.save()` because of an unclear reason.

- `JpsProjectSerializersImpl.saveEntities` has a complicated logic when the `iml` file should be removed. As there is no goal to refactor/refresh this logic, I tried to minimize the number of changes around this place.

- `JpsProjectSerializersImpl.shouldDeleteImportedFile` has a corner case for broken configuration of the iml. This case is covered in `ExternalSystemStorageTest.multiple modules with the same name` test.

- `ModuleImlFileEntitiesSerializer.manuallyRemoveImlFile` has a check for the correct casing. This test case is covered in `ExternalSystemStorageTest.multiple modules with the same name but different case`.

- After the `iml` deletion, the VFS should technically be refreshed, but we don't do it because the module with JPS serialization does not have a dependency to the module with VFS. Because of that, the `iml` does not disappear immediately from the project tree if it's there. I consider that this problem is minor.

GitOrigin-RevId: e6228e06017f6aef26fb78321a27a3ad05e1c22c
2024-06-26 21:18:15 +00:00
Alex Plate
c95e1a8d2b [Workspace Model] [IJPL-389] Remove remaining unused fields after cleaning up the keys
Key `ide.workspace.model.separate.component.for.roots` was removed, but one field still remains in the code

GitOrigin-RevId: 8848a6f478bf02930aea427ea716769e1d1f1b02
2024-06-26 21:18:15 +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