The CodeNarc plugin performs quality checks on your project's Groovy source files using CodeNarc and generates reports from these checks.
CodeNarcプラグインは CodeNarcを使用して、あなたのプロジェクトのGroovyソースファイルの品質チェックを行ないます。 そして、これらのチェック結果から結果レポートを生成します。
To use the CodeNarc plugin, include the following in your build script:
CodeNarcプラグインを使うためには、ビルドスクリプトに下記を含めます:
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 CodeNarc plugin adds the following tasks to the project:
CodeNarcプラグインを使うためには、ビルドスクリプトに下記を含めます:
表30.1 CodeNarcプラグイン - タスクCodeNarc plugin - tasks
| タスク名Task name | 依存先Depends on | 型Type | 説明Description | |
codenarcMain
|
- | CodeNarc |
製品のGroovyソースを対象にCodeNarcを実行します。Runs CodeNarc against the production Groovy source files. | |
codenarcTest
|
- | CodeNarc |
Runs CodeNarc against the test Groovy source files. | テストのGroovyソースを対象にCodeNarcを実行します。Runs Checkstyle against the test Groovy source files. |
codenarc
|
- | CodeNarc |
特定のソースセットで指定されたGroovyソースを対象にCodeNarcを実行します。Runs CodeNarc against the given source set's Groovy source files. |
The CodeNarc plugin adds the following dependencies to tasks defined by the Groovy plugin.
CodeNarcプラグインは、Groovyプラグインによって追加されたタスクに以下の依存関係を追加します。
表30.2 CodeNarcプラグイン - タスクの追加依存関係CodeNarc plugin - additional task dependencies
| タスク名Task name | 依存先Depends on |
check |
全てのCodeNarcタスクは、codenarcMain と codenarcTestを含みます。All CodeNarc tasks, including codenarcMain and codenarcTest. |
The CodeNarc plugin expects the following project layout:
CodeNarcプラグインは、以下のようなプロジェクトレイアウトを想定しています:
表30.3 CodeNarc プラグイン - プロジェクトレイアウトCodeNarc plugin - project layout
| ファイル File |
意味 Meaning |
config/codenarc/codenarc.xml
|
CodeNarc の設定ファイル CodeNarc configuration file |
The CodeNarc plugin adds the following dependency configurations:
CodeNarcプラグインは、以下の依存関係設定を追加します。
表30.4 CodeNarcプラグイン - 依存関係設定
CodeNarc plugin - dependency configurations
| 名前 Name |
意味 Meaning |
codenarc
|
CodeNarcのライブラリを使用します。 The CodeNarc libraries to use |