このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
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
入力引数
プロジェクト。matlab.project.Project
オブジェクトとして指定します。currentProject
を使用して、現在読み込まれているプロジェクトからプロジェクト オブジェクトを作成します。
出力引数
プロジェクト チェック。プロパティをもつ ProjectCheckResult
オブジェクトの配列として返されます。
バージョン履歴
R2020a で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)