From ffe489c2939d7e43f48552496464a71c5c4335fb Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 2 Mar 2019 23:38:57 +0530 Subject: Dependency updates (#489) * Configure dependencyUpdates task Configured to emit JSON reports in build directory and to only use stable releases. Signed-off-by: Harsh Shandilya * Update dependencies Signed-off-by: Harsh Shandilya --- build.gradle.kts | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index 6a8c4dd5..dc9ef005 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. +import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask buildscript { repositories { @@ -7,11 +7,15 @@ buildscript { mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:3.2.1") - classpath(kotlin("gradle-plugin", "1.2.71")) + classpath("com.android.tools.build:gradle:3.3.1") + classpath(kotlin("gradle-plugin", "1.3.21")) } } +plugins { + id("com.github.ben-manes.versions") version "0.21.0" +} + allprojects { repositories { google() @@ -19,3 +23,22 @@ allprojects { mavenCentral() } } + +tasks.named("dependencyUpdates") { + resolutionStrategy { + componentSelection { + all { + val rejected = listOf("alpha", "beta", "rc", "cr", "m", "preview") + .map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-]*") } + .any { it.matches(candidate.version) } + if (rejected) { + reject("Release candidate") + } + } + } + } + checkForGradleUpdate = true + outputFormatter = "json" + outputDir = "build/dependencyUpdates" + reportfileName = "report" +} -- cgit v1.2.3