Forked from matthewprenger/changelog-auth.gradle
Last active
August 29, 2015 14:11
-
-
Save hanetzer/cd41112eb0bf589b9a18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
def env = System.getenv() | |
def jenkinsUrl = env.JENKINS_URL | |
def jenkinsJob = env.JOB_NAME | |
def buildNumber = env.BUILD_NUMBER | |
if (jenkinsUrl != null && jenkinsJob != null && buildNumber != null) { | |
def changelog = "" | |
def data = new URL("$jenkinsUrl/job/$jenkinsJob/$buildNumber/api/xml?depth=20").text | |
def xml = new XmlSlurper().parseText(data) | |
xml.changeSet.item.each { change -> | |
changelog += "$change.author.fullName: $change.msg" + '\n' | |
} | |
project.ext.changelog = changelog | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment