Creating Build Scans
A build scan is a shareable and centralized record of a build that provides insights into what happened and why. By applying the build scan plugin to your project, you can publish build scans to https://scans.gradle.com for free.
Contents
- What you’ll create
- What you’ll need
- Select a sample project
- Auto-apply the build scan plugin
- Enable build scans on all builds of your project
- Accept the license agreement
- Publish a build scan
- Access the build scan online
- Enable build scans for all builds (optional)
- Summary
- Next steps
- Help improve this guide
What you’ll create
This guide shows you how to publish build scans ad-hoc without any build script modifications. You will also learn how to modify a build script to enable build scans for all builds of a given project. Optionally, you will also modify an init script to enable build scans for all of your projects.
What you’ll need
- Either your own sample project, or you can use the sample project available from Gradle
- Access to the Internet
- Access to your email
- About 7 minutes
Select a sample project
Gradle makes available a simple Java project that you can use to demonstrate build scan capabilities. If you wish to use it, clone or download the repository located at https://github.com/gradle/gradle-build-scan-quickstart. If you prefer to use your own project, you can skip this step.
Auto-apply the build scan plugin
Starting with Gradle 4.3, you can enable build scans without any additional configuration in your build script. When using the command line option
--scan
to publish a build scan, the required build scan plugin is applied automatically. Before the end of the build, you are asked to accept the license agreement on the command line. The following console output demonstrates the behavior.$ ./gradlew build --scan BUILD SUCCESSFUL in 6s Do you accept the Gradle Cloud Services license agreement (https://gradle.com/terms-of-service)? [yes, no] yes Gradle Cloud Services license agreement accepted. Publishing build scan... https://gradle.com/s/czajmbyg73t62
This mechanism makes it very easy to generate ad-hoc, one-off build scans without having to configure the build scan plugin in your build. If you need finer grained configuration, you can configure the build scan plugin in a build or init script as described in the following sections.
Enable build scans on all builds of your project
Add a
plugins
block to the build.gradle
file with the following contents:plugins {
id 'com.gradle.build-scan' version '1.13'
}
Use latest plugin version which can be found on the Gradle Plugin Portal. |
If you already have a
plugins
block, always put the build scan plugin first. Adding it below any existing plugins will still work, but will miss useful information.Accept the license agreement
In order to publish build scans to https://scans.gradle.com, you need to accept the license agreement. This can be done ad-hoc via the command line when publishing, but can also be specified in your Gradle build file, by adding the following section:
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
}
The
buildScan
block allows you to configure the plugin. Here you are setting two properties necessary to accept the license agreement. Other properties are available. See the Build Scans User Manual for details.Publish a build scan
A build scan is published using a command-line flag called
--scan
.
Run a
build
task with the --scan
option. When the build is completed, after uploading the build data to scans.gradle.com, you will be presented with a link to see your build scan.$ ./gradlew build --scan BUILD SUCCESSFUL in 5s Publishing build scan... https://gradle.com/s/47i5oe7dhgz2c
Access the build scan online
The first time you follow the link, you will be asked to activate the created build scan.
Jsoup overview.
HTML parsing from string.
HTML parsing from file.
HTML parsing from URL.
Get title from HTML.
Get links from HTML.
Get images from HTML.
Get metadata from HTML.
Get form parameters.
JSON tutorial.
JSON overview.
JSON format and data types
JSON object from string.
Access json object array.
JSON object in java.
Parse json in java.
Download JSON jar.
XML parser tutorial.
XML parser overview.
DOM XML parser.
DOM parse XML file.
DOM create xml file.
DOM modify xml file.
DOM count query.
SAX XML parser.
Stax XML parser.
Stax XMLEventReader.
Stax XMLEventWriter.
Stax XMLStreamReader.
Stax XMLStreamWriter.
Angularjs tutorial.
Angularjs Architecture.
Angularjs Directives.
Angularjs Custom Directives.
Angularjs Hello World.
Angularjs Expression.
Angularjs Two Way Binding.
Angularjs Controller.
Angularjs MVC Framework.
Angularjs Filter.
Angularjs Custom Filters.
Angularjs Include Page.
Angularjs Events.
Angularjs DOM.
Angularjs Scope.
Angularjs Multiple Controllers.
Angularjs Scope Inheritance.
Angularjs Rootscope.
Angularjs Table.
Angularjs Table Sorting.
Angularjs Table Row Index.
Angularjs Modules.
Angularjs Add controller.
Angularjs Add Directive.
Angularjs Form.
Angularjs Form Validation.
Angularjs Custom Validations.
Angularjs Custom Service.
Angularjs Ajax.
Angularjs Routing.
Angularjs Http Call.
Angularjs Dependency Injection.
Angularjs Internationalization.
PlSql tutorial.
PlSql Introduction.
PlSql Variable.
PlSql Constants.
PlSql Hello World.
PlSql If-Else.
PlSql Switch.
PlSql Loop.
PlSql While.
PlSql For-In Loop.
PlSql Continue.
PlSql Loop Label.
PlSql Goto.
PlSql Procedure.
PlSql Function.
PlSql Cursor.
PlSql Exception Handling.
PlSql Triggers.
PlSql Package.
JSF tutorial.
JSF overview.
JSF architecture.
JSF lifecycle.
Jsf bean scopes.
Jsf configuration.
JSF managed bean.
JSF backing bean.
JSF Hello World.
JSF annotations.
JSF Ajax.
JSF managedproperty.
JSF navigation rule.
JSF core tags.
JSF converter tags.
Jsf validator tags.
Jsf event handling.
Jsf datatable tutorial.
No comments:
Post a Comment