runChecks
説明
は、特定のプロジェクトでチェックを実行します。このチェックは、欠落ファイル、未保存のファイル、ソース管理対象でないファイル、または古い派生ファイルなどプロジェクトの整合性に関する問題を検出します。checkResults
= runChecks(proj
)
派生ファイルが最新であることをチェックする場合、プロジェクトの依存関係を更新しなければなりません。大規模なプロジェクトでは時間がかかる場合があります。派生ファイル チェックを除外する場合、runChecks
を呼び出す前に依存関係を更新しないでください。
例
派生ファイルのチェックの除外とプロジェクト チェックの実行
プロジェクト Times Table App を開きます。currentProject
を使用して、現在読み込まれているプロジェクトからプロジェクト オブジェクトを作成します。
openExample("matlab/TimesTableProjectExample")
proj = currentProject;
大規模なプロジェクトでは、派生ファイルのチェックは時間がかかる場合があるため、これを除いたすべてのプロジェクト チェックを実行します。
checkResults = runChecks(proj)
checkResults = 11×1 ProjectCheckResult array with properties: ID Description Passed ProblemFiles
配列 checkResults
から table を作成します。この table は、派生ファイルのチェックが実行されなかったことを示しています。
summary = table(checkResults)
summary = 11×3 table Passed Description ID ______ ____________________________________________________________________________________________________________________________________ ________________________________________________________ true "All project definition files are under source control." "Project:Checks:ProjectDefinitionFilesUnderSourceControl" true "All files in the project are under source control." "Project:Checks:AllProjectFilesUnderSourceControl" true "All files under source control are in the project." "Project:Checks:AllFilesUnderSourceControlInProject" true "All project folders exist." "Project:Checks:ProjectFoldersExist" true "All project files exist on the file system." "Project:Checks:ProjectFilesExist" true "All project folders on the MATLAB search path are on the project path." "Project:Checks:ProjectPath" true "All projects in sub-folders are referenced by this project." "Project:Checks:ReferencedSubprojects" true "Check for project files with unsaved changes." "Project:Checks:UnsavedProjectFiles" false "All derived files in the project are up-to-date." "Project:Checks:OutOfDateDerivedFiles" true "There are no slprj or sfprj folders in the project." "Project:Checks:SLPRJ" true "Model files saved in a different format (MDL or SLX) are added to the project.↵The original files are not currently in the project." "Project:Checks:MDLToSLX"
メモ
ソース管理関連のチェックを実行するには、リポジトリのフル クローンが必要です。CI/CD パイプラインでは、GitLab® などの一部のリポジトリ ホスティング プラットフォームは、既定で、深さがジョブあたり 50
のシャロー クローンを使用します。代わりに、クローンと取得の深さを 0
に設定してフル クローンを作成してください。
すべてのプロジェクト チェックの実行
プロジェクト Times Table App を開きます。currentProject
を使用して、現在読み込まれているプロジェクトからプロジェクト オブジェクトを作成します。
openExample("matlab/TimesTableProjectExample")
proj = currentProject;
派生ファイルが最新であることをチェックする場合、最初にプロジェクトの依存関係を更新しなければなりません。
updateDependencies(proj);
すべてのプロジェクト チェックを実行します。
checkResults = runChecks(proj)
checkResults = 11×1 ProjectCheckResult array with properties: ID Description Passed ProblemFiles
メモ
ソース管理関連のチェックを実行するには、リポジトリのフル クローンが必要です。CI/CD パイプラインでは、GitLab などの一部のリポジトリ ホスティング プラットフォームは、既定で、深さがジョブあたり 50
のシャロー クローンを使用します。代わりに、クローンと取得の深さを 0
に設定してフル クローンを作成してください。
ID
、Passed
、および ProblemFiles
プロパティを使用して、最初のチェックに関する情報を取得します。最初のチェックはパスし、問題は見つかりませんでした。すべてのプロジェクト定義ファイルがソース管理対象です。
id = checkResults(1).ID status = checkResults(1).Passed problems = checkResults(1).ProblemFiles
id = "Project:Checks:ProjectDefinitionFilesUnderSourceControl" status = logical 1 problems = 0×0 empty string array
派生ファイルのチェックはパスし、問題のあるファイルは見つかりませんでした。すべての派生ファイルは最新です。
id = checkResults(9).ID status = checkResults(9).Passed problems = checkResults(1).ProblemFiles
id = "Project:Checks:OutOfDateDerivedFiles" status = logical 1 problems = 0×0 empty string array
入力引数
proj
— プロジェクト
matlab.project.Project
オブジェクト
プロジェクト。matlab.project.Project
オブジェクトとして指定します。currentProject
を使用して、現在読み込まれているプロジェクトからプロジェクト オブジェクトを作成します。
出力引数
checkResults
— プロジェクト チェック
ProjectCheckResult
オブジェクトの配列
プロジェクト チェック。プロパティをもつ ProjectCheckResult
オブジェクトの配列として返されます。
バージョン履歴
R2020a で導入
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)