How to work with Simulink project and libraries?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello,
We have a folder structure like: C:\Project1 C:\Project2 C:\CommonLib
We would like to have the CommonLib files to be part of each project, to be able to integrate those common files to SVN. So a change of a CommonLib file by a developer working on Project1 will be propagated for another developer working on Project2. When I try to add the CommonLib files to the Simulink Project1, I get the error message that the file in not in the root directory of the project.
I wonder then how to handle common libraries within project. Can someone please help me to understand that?
Thanks
댓글 수: 0
답변 (2개)
C.J. Harris
2012년 5월 9일
You can handle the common libraries within SVN using the 'externals' definition for both projects, this way you could ensure they were always added to your project root directory on checkout.
If they are not within your project root directory on checkout you would have to add the folder to your MATLAB path. This could either be done temporarily by your setup scripts, or permanently by added the CommonLib folder to your MATLAB path.
Gavin Walker
2012년 6월 20일
There are a number of different workflows that might work here. Something that influences the choice of workflow is "how often do the libraries in CommonLib get updated?"
If the answer is that CommonLib is updated infrequently, then it might be possible to treat CommonLib like a toolbox or blockset. You can use a project start up shortcut to add the network location of CommonLib to the MATLAB path (and have a shutdown shortcut to remove it). When it is discovered as a dependent file or files of the project then it can be marked as an "external dependency" to show that it is expected for it not to be part of the current project.
CommonLib itself might well be in its own Simulink Project that is opened when development work is needed on CommonLib. If a user of Project1 has made changes to CommonLib then they can open the CommonLib Simulink Project, check for modified files, run the tests and validation procedures that are specific to the CommonLib Simulink Project and, once all changes are tested & reviewed, submit. Other users of CommonLib will get these changes the next time they update their CommonLib project.
There are a lot of variants on these workflows, such as SVN externals as described by Chris.
댓글 수: 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!