| Contents | Index |
updateFilePathsAndExtensions(buildinfo, extensions)
extensions is optional.
Build information returned by RTW.BuildInfo.
A cell array of character arrays that specifies the extensions (file types) of files for which to search and include in the update processing. By default, the function searches for files with a .c extension. The function checks files and updates paths and extensions based on the order in which you list the extensions in the cell array. For example, if you specify {'.c' '.cpp'} and a folder contains myfile.c and myfile.cpp, an instance of myfile would be updated to myfile.c.
Using paths that already exist in the model build information, the updateFilePathsAndExtensions function checks whether any file references in the build information need to be updated with a path or file extension. This function can be particularly useful for
Maintaining build information for a toolchain that requires the use of file extensions
Updating multiple customized instances of build information for a given model
Note If you need to use updateFilePathsAndExtensions, you should call it once, after all files have been added to the build information, to minimize the potential performance impact of the required disk I/O. |
Create the folder path etcproj/etc in your working folder, add files etc.c, test1.c, and test2.c to the folder etc. This example assumes the working folder is w:\work\BuildInfo. From the working folder, update build information myModelBuildInfo with any missing paths or file extensions.
myModelBuildInfo = RTW.BuildInfo;
addSourcePaths(myModelBuildInfo, fullfile(pwd,...
'etcproj', '/etc'), 'test');
addSourceFiles(myModelBuildInfo, {'etc' 'test1'...
'test2'}, '', 'test');
before=getSourceFiles(myModelBuildInfo, true, true);
before
before =
'\etc' '\test1' '\test2'
updateFilePathsAndExtensions(myModelBuildInfo);
after=getSourceFiles(myModelBuildInfo, true, true);
after{:}
ans =
w:\work\BuildInfo\etcproj\etc\etc.c
ans =
w:\work\BuildInfo\etcproj\etc\test1.c
ans =
w:\work\BuildInfo\etcproj\etc\test2.caddIncludeFiles | addIncludePaths | addSourceFiles | addSourcePaths | updateFileSeparator

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |