// Copyright (C) 2023 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.

[[build_scans]]
= Build Scans

A build scan is a *representation of metadata captured* as you run your build.

image::gradle-basic-1.png[]

== Build Scans
Gradle captures your build metadata and sends it to the link:https://scans.gradle.com/[Build Scan Service].
The service then transforms the metadata into information you can analyze and share with others.

image::build-scan-1.png[]

The information that scans collect can be an invaluable resource when troubleshooting, collaborating on, or optimizing the performance of your builds.

For example, with a build scan, it’s no longer necessary to copy and paste error messages or include all the details about your environment each time you want to ask a question on Stack Overflow, Slack, or the Gradle Forum.
Instead, copy the link to your latest build scan.

image::build-scan-2.png[]

== Enable Build Scans

To enable build scans on a gradle command, add `--scan` to the command line option:

[source,text]
----
 ./gradlew build --scans
----

You may be prompted to agree to the terms to use Build Scans.

Vist the link:https://scans.gradle.com/[Build Scans page] to learn more.

[.text-right]
**Next Step:** <<part1_gradle_init.adoc#part1_gradle_init,Start the Tutorial>> >>
