// Copyright (C) 2024 Gradle, Inc.
//
// Licensed under the Creative Commons Attribution-Noncommercial-ShareAlike 4.0 International License.;
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      https://creativecommons.org/licenses/by-nc-sa/4.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_report_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 <<command_line_interface.adoc#sec:command_line_project_reporting,Command-line project reporting>>). 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.

[[sec:project_reports_usage]]
== Usage

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

[source,groovy]
----
plugins {
    id 'project-report'
}
----

[[sec:project_reports_tasks]]
== Tasks

The project report plugin defines the following tasks:

`dependencyReport` — link:{groovyDslPath}/org.gradle.api.tasks.diagnostics.DependencyReportTask.html[DependencyReportTask]::
Generates the project dependency report.

`htmlDependencyReport` — link:{groovyDslPath}/org.gradle.api.reporting.dependencies.HtmlDependencyReportTask.html[HtmlDependencyReportTask]::
Generates an HTML dependency and dependency insight report for the project or a set of projects.

`propertyReport` — link:{groovyDslPath}/org.gradle.api.tasks.diagnostics.PropertyReportTask.html[PropertyReportTask]::
Generates the project property report.

`taskReport` — link:{groovyDslPath}/org.gradle.api.tasks.diagnostics.TaskReportTask.html[TaskReportTask]::
Generates the project task report.

`projectReport` — link:{groovyDslPath}/org.gradle.api.Task.html[Task]::
_Depends on_: `dependencyReport`, `propertyReport`, `taskReport`, `htmlDependencyReport`
+
Generates all project reports.

[[sec:project_reports_output]]
== Report output

By default, the reports are written to the `project` directory under the reporting base directory, which resolves to `build/reports/project/`:

`tasks.txt`::
The plain-text task report, produced by `taskReport`.

`properties.txt`::
The plain-text property report, produced by `propertyReport`.

`dependencies.txt`::
The plain-text dependency report, produced by `dependencyReport`.

`dependencies/`::
The HTML dependency report, produced by `htmlDependencyReport`.

The plugin applies the reporting base plugin, so you can change the base directory for all reports through the link:{groovyDslPath}/org.gradle.api.reporting.ReportingExtension.html[`reporting`] extension:

[source,groovy]
----
reporting {
    baseDirectory = layout.buildDirectory.dir('my-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.
