Is it possible to generate/update MATLAB toolbox project file (*.prj) programmatically?

조회 수: 10 (최근 30일)
Hi,
I have created a custom toolbox. Now I'm trying to have a continuous development process that would automatically package the toolbox every midnight (if any of the files have changed). I'm trying to understand if it would be possible to update the toolbox project file programmatically - to change toolbox version, project file list, excluded file list, etc. I can then use the updated prj file to package the new toolbox.
Cheers,
sunny

답변 (3개)

Sean de Wolski
Sean de Wolski 2018년 2월 23일
I don't know of a documented way to generate the prj file the first time.
  댓글 수: 7
Harley Day
Harley Day 2018년 9월 10일
편집: Harley Day 2018년 9월 10일
Yes I've been thinking the same thing. There doesn't seem to be a way to programatically update a matlab project file. This would be useful for the purposes of code maintenance from github. My continuous integration server could then be configured to build and distribute new releases of the toolbox when I commit to the master branch.

댓글을 달려면 로그인하십시오.


Sunny Talekar
Sunny Talekar 2019년 3월 1일
Workaround:
Given that the toolbox project file is just an xml under the hood, I knocked up some functions to update relevant sections of the project file using built-in xml editing functionality. Serves the purpose but a built-in solution would be much appreciated.
  댓글 수: 4
Eric Hoffmann
Eric Hoffmann 2019년 10월 3일
Hi Sunny,
I too would be interested in looking at your code.
Thanks,
Eric

댓글을 달려면 로그인하십시오.


Sly Knight
Sly Knight 2022년 7월 14일
Use readstruct and writestruct.
project = readstruct(fullfile(path,project_name.prj),'FileType','xml');
project.configuration.param_version = project_file.configuration.param_version + 1;
writestruct(project,fullfile(path,project_name.prj),'FileType','xml')

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by