The Checkstyle plugin performs quality checks on your project's Java source files using Checkstyle and generates reports from these checks.
Checkstyleプラグインは Checkstyleを使用して、あなたのプロジェクトのJavaソースファイルの品質チェックを行ないます。 そして、これらのチェック結果から結果レポートを生成します。
To use the Checkstyle plugin, include the following in your build script:
Checkstyleプラグインを使うためには、ビルドスクリプトに下記を含めます:
The plugin adds a number of tasks to the project that perform the quality checks. You can execute the checks by running gradle check.
このプラグインは、品質チェックを行なうプロジェクトへの多くのタスクを加えます。 貴方はタスク実行時にチェック処理を実行させることが出来ます。 gradle check.
The Checkstyle plugin adds the following tasks to the project:
Checkstyleプラグインは、以下のタスクをプロジェクトに追加します:
表29.1 Checkstyleプラグイン - タスクCheckstyle plugin - tasks
| タスク名Task name | 依存先Depends on | 型Type | 説明Description |
checkstyleMain
|
classes |
Checkstyle |
製品のJavaソースを対象にCheckstyleを実行します。Runs Checkstyle against the production Java source files. |
checkstyleTest
|
testClasses |
Checkstyle |
テストのJavaソースを対象にCheckstyleを実行します。Runs Checkstyle against the test Java source files. |
checkstyle
|
|
Checkstyle |
特定のソースセットで指定されたJavaソースを対象にCheckstyleを実行します。Runs Checkstyle against the given source set's Java source files. |
The Checkstyle plugin adds the following dependencies to tasks defined by the Java plugin.
Checkstyleプラグインは、Javaプラグインによって追加されたタスクに以下の依存関係を追加します。
表29.2 Checkstyleプラグイン - タスクの追加依存関係Checkstyle plugin - additional task dependencies
| タスク名Task name | 依存先Depends on |
check |
全てのCheckstyleタスクは、checkstyleMain と checkstyleTestを含みます。All Checkstyle tasks, including checkstyleMain and checkstyleTest. |
The Checkstyle plugin expects the following project layout:
Checkstyleプラグインは、以下のようなプロジェクトレイアウトを想定しています:
表29.3 Checkstyle プラグイン - プロジェクトレイアウトCheckstyle plugin - project layout
| ファイル File |
意味 Meaning |
config/checkstyle/checkstyle.xml
|
Checkstyle の設定ファイル Checkstyle configuration file |
The Checkstyle plugin adds the following dependency configurations:
Checkstyleプラグインは、以下の依存関係設定を追加します。
表29.4 Checkstyleプラグイン - 依存関係設定
Checkstyle plugin - dependency configurations
| 名前 Name |
意味 Meaning |
checkstyle
|
Checkstyleのライブラリを使用します。 The Checkstyle libraries to use |
See the CheckstyleExtension class in the API documentation.