+
+run {
+ if (project.hasProperty("appArgs")) {
+ // allow passing command-line arguments to the main application e.g.:
+ // $ gradle run -PappArgs="['-u', '+...', 'daemon', '--json']"
+ args Eval.me(appArgs)
+ }
+}
+
+// Find any 3rd party libraries which have released new versions
+// to the central Maven repo since we last upgraded.
+task checkLibVersions {
+ doLast {
+ def checked = [:]
+ allprojects {
+ configurations.each { configuration ->
+ configuration.allDependencies.each { dependency ->
+ def version = dependency.version
+ if (!checked[dependency]) {
+ def group = dependency.group
+ def path = group.replace('.', '/')
+ def name = dependency.name
+ def url = "https://repo1.maven.org/maven2/$path/$name/maven-metadata.xml"
+ try {
+ def metadata = new XmlSlurper().parseText(url.toURL().text)
+ def newest = metadata.versioning.latest;
+ if ("$version" != "$newest") {
+ println "UPGRADE {\"group\": \"$group\", \"name\": \"$name\", \"current\": \"$version\", \"latest\": \"$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"
+ }
+ checked[dependency] = true
+ }
+ }
+ }
+ }
+ }
+}