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

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 日

1 投票

I don't know of a documented way to generate the prj file the first time.

7 件のコメント

Sunny Talekar
Sunny Talekar 2018 年 2 月 23 日
Thanks Sean. I have been using packageToolbox for packaging the actual toolbox.
I'm just trying to understand if there is a way to manipulate the toolbox project file (the way you can do for Simulink project files) from command line.
Frederik Zilstorff
Frederik Zilstorff 2018 年 7 月 6 日
Sunny, did you find an answer for this problem? Thank you in advance.
Sean de Wolski
Sean de Wolski 2018 年 7 月 6 日
There is no documented way as of R2018a. I put in the enhancement request and will add your vote to it.
Sunny Talekar
Sunny Talekar 2018 年 7 月 16 日
Thanks Sean
James
James 2018 年 7 月 23 日
upvote from me for this too.
Sean de Wolski
Sean de Wolski 2018 年 7 月 23 日
Done!
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 日

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 件のコメント

Harley Day
Harley Day 2019 年 3 月 1 日
Hi Sunny,
Great. Any chance we can use your code?
H
Sunny Talekar
Sunny Talekar 2019 年 3 月 5 日
Hi Harley,
I'll have to redact some of the IP. Let me see if I can do it over the weekend.
Watch this space :)
sunny
Harley Day
Harley Day 2019 年 6 月 25 日
Hi Sunny,
Any progress?
H
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')

カテゴリ

ヘルプ センター および File ExchangeEnvironment and Settings についてさらに検索

製品

タグ

質問済み:

2018 年 2 月 23 日

回答済み:

2022 年 7 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by