mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
makes checkLibVersions gradle 5 compatible
This commit is contained in:
parent
e809792467
commit
65390ef1d8
1 changed files with 27 additions and 25 deletions
52
build.gradle
52
build.gradle
|
@ -47,33 +47,35 @@ run {
|
||||||
// Find any 3rd party libraries which have released new versions
|
// Find any 3rd party libraries which have released new versions
|
||||||
// to the central Maven repo since we last upgraded.
|
// to the central Maven repo since we last upgraded.
|
||||||
// http://daniel.gredler.net/2011/08/08/gradle-keeping-libraries-up-to-date/
|
// http://daniel.gredler.net/2011/08/08/gradle-keeping-libraries-up-to-date/
|
||||||
task checkLibVersions << {
|
task checkLibVersions {
|
||||||
def checked = [:]
|
doLast {
|
||||||
allprojects {
|
def checked = [:]
|
||||||
configurations.each { configuration ->
|
allprojects {
|
||||||
configuration.allDependencies.each { dependency ->
|
configurations.each { configuration ->
|
||||||
def version = dependency.version
|
configuration.allDependencies.each { dependency ->
|
||||||
if (!version.contains('SNAPSHOT') && !checked[dependency]) {
|
def version = dependency.version
|
||||||
def group = dependency.group
|
if (!version.contains('SNAPSHOT') && !checked[dependency]) {
|
||||||
def path = group.replace('.', '/')
|
def group = dependency.group
|
||||||
def name = dependency.name
|
def path = group.replace('.', '/')
|
||||||
def url = "http://repo1.maven.org/maven2/$path/$name/maven-metadata.xml"
|
def name = dependency.name
|
||||||
try {
|
def url = "http://repo1.maven.org/maven2/$path/$name/maven-metadata.xml"
|
||||||
def metadata = new XmlSlurper().parseText(url.toURL().text)
|
try {
|
||||||
def versions = metadata.versioning.versions.version.collect { it.text() }
|
def metadata = new XmlSlurper().parseText(url.toURL().text)
|
||||||
versions.removeAll { it.toLowerCase().contains('alpha') }
|
def versions = metadata.versioning.versions.version.collect { it.text() }
|
||||||
versions.removeAll { it.toLowerCase().contains('beta') }
|
versions.removeAll { it.toLowerCase().contains('alpha') }
|
||||||
versions.removeAll { it.toLowerCase().contains('rc') }
|
versions.removeAll { it.toLowerCase().contains('beta') }
|
||||||
def newest = versions.max()
|
versions.removeAll { it.toLowerCase().contains('rc') }
|
||||||
if (version != newest) {
|
def newest = versions.max()
|
||||||
println "$group:$name $version -> $newest"
|
if (version != newest) {
|
||||||
|
println "$group:$name $version -> $newest"
|
||||||
|
}
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
logger.debug "Unable to download $url: $e.message"
|
||||||
|
} catch (org.xml.sax.SAXParseException e) {
|
||||||
|
logger.debug "Unable to parse $url: $e.message"
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e) {
|
checked[dependency] = true
|
||||||
logger.debug "Unable to download $url: $e.message"
|
|
||||||
} catch (org.xml.sax.SAXParseException e) {
|
|
||||||
logger.debug "Unable to parse $url: $e.message"
|
|
||||||
}
|
}
|
||||||
checked[dependency] = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue