2016年4月3日日曜日

Gradleのタスクに指定できるオプションを調べる方法

Gradleのhelpタスクで、そのタスクに指定できるオプションを見ることができる。

使い方

helpタスクのオプションのtaskに対して調べたいタスク名を指定する。
gradlew help --task タスク名

実行結果

dependencyInsightタスクのhelpを見てみた結果。
このタスクは2つのオプションを指定できることなんかがわかる。
$ ./gradlew help --task dependencyInsight
:help
Detailed task information for dependencyInsight

Path
     :dependencyInsight

Type
     DependencyInsightReportTask (org.gradle.api.tasks.diagnostics.DependencyInsightReportTask)

Options
     --configuration     Looks for the dependency in given configuration.

     --dependency     Shows the details of given dependency.

Description
     Displays the insight into a specific dependency in root project 'spring-boot-in-action'.

Group
     help