Skip to content

Commit

Permalink
Improved checkLibraryVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
thehiflyer committed Apr 27, 2012
1 parent e1fd8e8 commit b2beb39
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions build.gradle
Expand Up @@ -46,16 +46,14 @@ task checkLibVersions << {
def version = dependency.version
if (!version.contains('SNAPSHOT') && !checked[dependency]) {
def group = dependency.group
def path = group.replace('.', '/')
def name = dependency.name
def url = "http://repo1.maven.org/maven2/$path/$name/maven-metadata.xml"
def url = "http://search.maven.org/solrsearch/select?q=g:\"$group\"+AND+a:\"$name\"+AND+p:\"jar\"&rows=20&wt=xml".toString()
try {
def metadata = new XmlSlurper().parseText(url.toURL().text)
def newestVersion = metadata.versioning.latest
if(newestVersion == null || newestVersion.toString().isEmpty()) {
newestVersion = metadata.versioning.release
def response = new XmlSlurper().parseText(url.toURL().text)

def newestVersion = response.result.doc.str.findAll {
it.@name.text().contains("latestVersion")
}
//println "Latest version of $name is $newestVersion"

if (!version.toString().equals(newestVersion.toString())) {
println "$group:$name $version -> $newestVersion"
Expand Down

0 comments on commit b2beb39

Please sign in to comment.