// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

[[project_reports_plugin]]
== The Project Report Plugin

The Project report plugin adds some tasks to your project which generate reports containing useful information about your build. These tasks generate the same content that you get by executing the `tasks`, `dependencies`, and `properties` tasks from the command line (see <<sec:obtaining_information_about_your_build>>). In contrast to the command line reports, the report plugin generates the reports into a file. There is also an aggregating task that depends on all report tasks added by the plugin.

We plan to add much more to the existing reports and create additional ones in future releases of Gradle.


[[sec:project_reports_usage]]
=== Usage

To use the Project report plugin, include the following in your build script:

[source,java]
----

apply plugin: 'project-report'

----



[[sec:project_reports_tasks]]
=== Tasks

The project report plugin defines the following tasks:

.Project report plugin - tasks
[cols="a,a,a,a", options="header"]
|===
| Task name
| Depends on
| Type
| Description

|  `dependencyReport`
| -
| api:org.gradle.api.tasks.diagnostics.DependencyReportTask[]
| Generates the project dependency report.

|  `htmlDependencyReport`
| -
| api:org.gradle.api.reporting.dependencies.HtmlDependencyReportTask[]
| Generates an HTML dependency and dependency insight report for the project or a set of projects.

|  `propertyReport`
| -
| api:org.gradle.api.tasks.diagnostics.PropertyReportTask[]
| Generates the project property report.

|  `taskReport`
| -
| api:org.gradle.api.tasks.diagnostics.TaskReportTask[]
| Generates the project task report.

|  `projectReport`
|  `dependencyReport`, `propertyReport`, `taskReport`, `htmlDependencyReport`
| api:org.gradle.api.Task[]
| Generates all project reports.
|===


[[sec:project_reports_project_layout]]
=== Project layout

The project report plugin does not require any particular project layout.

[[sec:project_reports_dependency_management]]
=== Dependency management

The project report plugin does not define any dependency configurations.

[[sec:project_reports_convention_properties]]
=== Convention properties

The project report defines the following convention properties:

.Project report plugin - convention properties
[cols="a,a,a,a", options="header"]
|===
| Property name
| Type
| Default value
| Description

include::reportingBasePluginProperties.adoc[]
|  `projects`
|  `Set&lt;Project&gt;`
| A one element set with the project the plugin was applied to.
| The projects to generate the reports for.

|  `projectReportDirName`
|  `String`
|  `project`
| The name of the directory to generate the project report into, relative to the reports directory.

|  `projectReportDir`
|  `File` (read-only)
|  `__reportsDir__/__projectReportDirName__`
| The directory to generate the project report into.
|===

These convention properties are provided by a convention object of type api:org.gradle.api.plugins.ProjectReportsPluginConvention[].
