How would I go about converting deploy -package project.prj to use compiler.b​uild.stand​aloneAppli​cation or compiler.p​ackage.ins​taller?

33 ビュー (過去 30 日間)
I am new to MATLAB and I inherited an existing app with .prj file generated from the Library Compiler window. It runs fine with
deploytool -package projectname.prj
after upgrading from R2016b to R2021a I am now getting a message that deploytool will be removed in future release (see below).
deploytool -package projectname.prj
System command line building and packaging using the deploytool executable will be removed in a
future release. Use mcc, deployment scenario specific functions such as compiler.build.standaloneApplication,
and compiler.package.installer with matlab -batch instead.
Preparing Runtime...
How would I go about converting the 1 line command deploytool -package projectname.prj to use compiler.build.standaloneApplication or similar?
I read as much documentation as I could find for compiler.build.standaloneApplication and compiler.package.installer but found nothing that even hinted at building a package with a project file.

回答 (2 件)

Krzysztof Kowalski
Krzysztof Kowalski 2022 年 2 月 11 日
I have very similar problem:
was using till now
>> applicationCompiler -package myProjectFile.prj
but now getting warnings and also an error!
"Error using bdIsLoaded (line 29)
Invalid block diagram name supplied. Valid block diagram names are the same as valid MATLAB variable names. Type "help isvarname" for more
information.
Error in Simulink.filegen.internal.FolderConfiguration"
Even though my application does not need any Simulink models!
It would be great to know how to re-use existing .prj files in newer Matlab version
My migration is from 2017a to 2020b
Thanks and Regards,
Kris

Orion Miller
Orion Miller 2023 年 9 月 15 日
Recommend using createDeploymentScript. This function uses your .prj file to auto-generate a .m file, which defines all the same configuration options and then calls compiler.build.standaloneApplication and compiler.package.installer.
createDeploymentScript("projectname.prj", "projectname.m");
projectname.m

カテゴリ

Help Center および File ExchangeC Shared Library Integration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by