Gradle Build Scan rocks!

D0f6db0264fa58232df736e3bc8b898b
Posted on

Earlier today I attend a webinar hosted by Gradle, Inc. where Gradle Build Scan was introduced. If you're already using Gradle as the build tool for your project, setting up Gradle Build Scan will take you no more than 2 minutes. All I had to do was to follow the steps outlined in https://scans.gradle.com/setup/step-1, which involves opening up your build.gradle file and adding the following at the top:

plugins {
    id 'com.gradle.build-scan' version '1.0'
}

buildScan {
    licenseAgreementUrl = 'https://gradle.com/terms-of-service'
    licenseAgree = 'yes'
}

I then ran my Gradle "build" task and had to append "-Dscan" at the end, like this:

jpark:hellooo-world jpark$ ./gradlew build -Dscan

As the Gradle task was completing, I could see that the Gradle Build Scans tool was posting the results to a uniquely generated URL. I ran the above command several times and here's a URL that was generated: https://scans.gradle.com/s/cl7czl4ezvnta

When I went to the URL, it showed me the following information:

  • Console output from when the Gradle task was executed
  • Metrics on build performance as well as suggestions on how to make the build faster
  • Which Gradle tasks were executed
  • Information on dependencies
  • Information on Gradle plugins used
  • Infrastructure-related information on where the Gradle task was run (such as the version of Java, OS, # of CPU cores)

VERY COOL!

What I like:

  • Super easy to implement if you're already using Gradle. It could not be any easier!
  • The results page that's generated by the tool is very helpful and beautiful to look at, IMO.
  • The most recent update to the Jenkins Gradle Plugin supports Gradle Build Scans. According to the page: "If a Gradle Build Scan is produced during the build then a link is added to the build page."
  • The uniquely generated pages will live FOREVER (according to Mark Vieira who presented the webinar).

What I don't like:

  • There should be some way to be able to control who can access the results page. I'm not yet 100% sure that I feel confident about using Gradle Build Scans at Cappex.com for this reason. FYI as it relates to this bullet point - at the webinar, the presenter informed us that there is a enterprise-level on-premise option that could be implemented.
  • It's great that the results pages live forever; however, it would be even better if there was a way to permanently delete them.

Despite the negatives, this is looking like an amazingly useful tool and I can't wait to dig deeper into it and hopefully start using it at Cappex.com.

QUICK UPDATE (8/25/2016): Here are the links to the webinar slides and the recording.

comments powered by Disqus
© 2020 Junho Park
This website is built on Ruby on Rails with Bootstrap and Sass. The blog is powered by Postmarkdown. The opinions expressed here are my own.