- Create individual projects for A and B, each with its own .prj file.
- In libraries C, D, E, and the main application, add A and B as referenced projects (via Project > New Reference).
- Avoid maintaining local copies of A and B inside device libraries to prevent conflicts.
Project organization with submodules and referenced project
9 次查看(过去 30 天)
显示 更早的评论
Good afternoon,
I'm trying to organize my project with atomic approach using submodules.
My architecture is the following:
I have two generic libraries Called A and B, A is referenced into B and B is referenced in any other library or project. I also have different device libraries, called C,D and E that referennce both A and B In the end I have the main application that reference A, B, C, D and E.
Using submodules and references, when i try to open the main application, the IDE will try to open a big number of different versions of A and B libraries.
My question is: there is a better way to share libraries into projects without creating this kind of opening chain? I want to be sure that the library A and B used by artifacts into any project are the same, to avoid models or library blocks that differ from one device library and another or the main application
Best regards.
Claudi0
0 个评论
回答(1 个)
Sameer
2025-7-10
To avoid multiple versions of libraries A and B being loaded when opening your main application, it’s best to organize them as separate Simulink projects and use project references in all dependent libraries (C, D, E) and the main app. This way, all components refer to the same instance of A and B, avoiding duplication and version mismatches.
Here’s a suggested structure:
If you're using Git, you can manage A and B as submodules, which helps lock their versions and keep them consistent across teams and branches. Just clone them into a fixed location and point your references accordingly.
This setup keeps your architecture clean, ensures version consistency across all libraries, and prevents the IDE from opening multiple versions of the same library.
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dependency Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!