Skip to content

Instantly share code, notes, and snippets.

@breskeby
Last active November 9, 2016 16:30
Show Gist options
  • Save breskeby/5e39d5e820d505b583bc57f39f5e507f to your computer and use it in GitHub Desktop.
Save breskeby/5e39d5e820d505b583bc57f39f5e507f to your computer and use it in GitHub Desktop.
buildscan recipe gist for creating topic on gradle forum
buildScan.buildFinished { result ->
if(result.failure){
if(result.failure instanceof org.gradle.internal.exceptions.LocationAwareException){
if(result.failure.reportableCauses.size() >= 1) {
def reportMessage = result.failure.reportableCauses[0].message
buildScan.link("Create Gradle Forum Topic", createForumLink(reportMessage))
}
}
}
}
def createForumLink(reportMessage){
def message = reportMessage.replace(' ', "%20")
return "http://discuss.gradle.org/new-topic?title=Build%20fails%20with%20%22${message}%22&body=put%20your%20build%20scan%20url%20here!&category=Help%2FDiscuss&tags=buildscan-provided"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment