matlab.project.convertDefinitionFiles
说明
matlab.project.convertDefinitionFiles(
将在 projectRoot
,definitionType
)projectRoot
中存储的工程的定义文件类型转换为 definitionType
指定的新类型。matlab.project.convertDefinitionFiles
保留工程的源代码管理历史记录。
警告
为避免出现合并问题,请不要多次转换工程的定义文件类型。
示例
更改工程定义文件类型
检查工程当前使用的定义文件管理。
projectRoot = "C:/projects/myproject";
proj = openProject(projectRoot);
currentDefinitionFileType = proj.DefinitionFilesType
currentDefinitionFileType = DefinitionFiles enumeration MultiFile
在转换工程定义文件管理之前,请关闭工程。
close(proj);
以编程方式将工程定义文件管理转换为使用固定路径的多个工程文件。
matlab.project.convertDefinitionFiles(projectRoot,matlab.project.DefinitionFiles.FixedPathMultiFile)
检查新工程定义文件管理。
proj = openProject(projectRoot); newDefinitionFileType = proj.DefinitionFilesType
newDefinitionFileType = DefinitionFiles enumeration FixedPathMultiFile
输入参数
projectRoot
— 工程文件夹的完整路径
字符向量 | 字符串标量
工程根文件夹的完整路径,指定为字符向量或字符串标量。
示例: "C:/projects/myproject"
数据类型: char
| string
definitionType
— 定义文件类型
matlab.project.DefinitionFiles.SingleFile
| matlab.project.DefinitionFiles.MultiFile
| matlab.project.DefinitionFiles.FixedPathMultiFile
定义文件类型,指定为 matlab.project.DefinitionFiles.SingleFile
、matlab.project.DefinitionFiles.MultiFile
或 matlab.project.DefinitionFiles.FixedPathMultiFile
。
根据您的用例选择定义文件类型:
MultiFile
- 有助于避免在对共享工程执行合并时发生文件冲突SingleFile
- 速度更快,但当两个用户将同一工程中的更改提交到源代码管理工具时,可能会导致合并问题FixedPathMultiFile
- 如果您需要使用长路径,此选项更适用
版本历史记录
在 R2020b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)