How can I retrieve the source files from the _sharedutils folder of a build?

8 visualizaciones (últimos 30 días)

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 30 de Jul. de 2020
Editada: MathWorks Support Team el 30 de Jul. de 2020
In MATLAB R2018b and prior, you can obtain a list of shared source files using the model build information:
sharedSourceLib = buildInfo.getLinkObjects('SHARED_SRC_LIB')
getSourceFiles(sharedSourceLib, 1, 1)
In MATLAB R2019a and later, we no longer store a list of shared source files in the model buildInfo object. This is because in a model reference hierarchy, each model buildInfo captures a list of shared source files when the model was last built, so different model buildInfo's each have their own list of shared source files. Since each model buildInfo only captured shared source files that existed when the model buildInfo was created, each model buildInfo has a different list of shared source files (a subset of all the files in _sharedutils).
So starting from MATLAB R2019a, the shared utility code has its own buildInfo. You can use the following code to determine a list of the source files:
buildDir = RTW.getBuildDir(model)
sharedFolder = buildDir.SharedUtilsTgtDir;
sharedBuildInfo = load(fullfile(sharedFolder, 'buildInfo.mat'));
sharedBuildInfo = sharedBuildInfo.buildInfo;
sources = getSourceFiles(sharedBuildInfo, 1, 1);

Más respuestas (0)

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by