Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

Commit

Permalink
Added gradle-versions-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
leinardi committed Feb 4, 2018
1 parent 7bb34d3 commit c4f5be8
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ android:
- google-gdk-license-.+

script:
- ./gradlew clean check --profile
- ./gradlew clean check dependencyUpdate --profile
- pandoc `ls -1rt build/reports/profile/profile-*.html | tail -n1` -t plain
- cat build/dependencyUpdates/report.txt
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply from: rootProject.file('versions-plugin.gradle')

buildscript {
repositories {
Expand All @@ -22,8 +23,9 @@ buildscript {
dependencies {
classpath deps.android_gradle_plugin
classpath deps.android_checkstyle_plugin
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath deps.android_maven_gradle_plugin
classpath deps.gradle_bintray_plugin
classpath deps.gradle_versions_plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 1 addition & 1 deletion checkstyle.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ checkstyle {
ignoreFailures = false // Whether this task will ignore failures and continue running the build.
configFile rootProject.file('config/checkstyle/checkstyle.xml')
// The Checkstyle configuration file to use.
toolVersion = '8.5' // The version of Checkstyle you want to be used
toolVersion = '8.7' // The version of Checkstyle you want to be used
}
30 changes: 30 additions & 0 deletions versions-plugin.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2018 Roberto Leinardi.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'com.github.ben-manes.versions'

dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
12 changes: 9 additions & 3 deletions versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ext.deps = [:]
def versions = [:]
versions.android_checkstyle_plugin = "1.0.0"
versions.android_gradle_plugin = "3.1.0-beta1"
versions.android_maven_gradle_plugin = "2.0"
versions.androidthings = "0.6.1-devpreview"
versions.apache_commons = "2.5"
versions.arch = hasProperty("ARCH_VERSION") ? getProperty("ARCH_VERSION") : "1.0.0"
Expand All @@ -32,14 +33,16 @@ versions.dagger = "2.13"
versions.dexmaker = "2.2.0"
versions.espresso = "3.0.1"
versions.glide = "3.8.0"
versions.gradle_bintray_plugin = "1.8.0"
versions.gradle_versions_plugin = "0.17.0"
versions.hamcrest = "1.3"
versions.joystick = "1.1.0"
versions.junit = "4.12"
versions.kotlin = "1.2"
versions.mockito = "2.7.19"
versions.mockito = "2.13.3"
versions.mockito_all = "1.10.19"
versions.mockwebserver = "3.8.1"
versions.powermock = "1.6.6"
versions.powermock = "1.7.3"
versions.paging = "1.0.0-alpha3"
versions.play_services = "11.6.2"
versions.retrofit = "2.3.0"
Expand Down Expand Up @@ -137,7 +140,7 @@ deps.mockito = mockito

def powermock = [:]
powermock.module_junit4 = "org.powermock:powermock-module-junit4:$versions.powermock"
powermock.api_mockito = "org.powermock:powermock-api-mockito:$versions.powermock"
powermock.api_mockito = "org.powermock:powermock-api-mockito2:$versions.powermock"
deps.powermock = powermock

def kotlin = [:]
Expand All @@ -148,10 +151,13 @@ deps.kotlin = kotlin

deps.android_checkstyle_plugin = "com.leinardi.android:android-checkstyle-plugin:$versions.android_checkstyle_plugin"
deps.android_gradle_plugin = "com.android.tools.build:gradle:$versions.android_gradle_plugin"
deps.android_maven_gradle_plugin = "com.github.dcendents:android-maven-gradle-plugin:$versions.android_maven_gradle_plugin"
deps.androidthings = "com.google.android.things:androidthings:$versions.androidthings"
deps.constraint_layout = "com.android.support.constraint:constraint-layout:$versions.constraint_layout"
deps.dexmaker = "com.linkedin.dexmaker:dexmaker-mockito:$versions.dexmaker"
deps.glide = "com.github.bumptech.glide:glide:$versions.glide"
deps.gradle_bintray_plugin = "com.jfrog.bintray.gradle:gradle-bintray-plugin:$versions.gradle_bintray_plugin"
deps.gradle_versions_plugin = "com.github.ben-manes:gradle-versions-plugin:$versions.gradle_versions_plugin"
deps.hamcrest = "org.hamcrest:hamcrest-all:$versions.hamcrest"
deps.joystick = "com.github.erz05:JoyStick:$versions.joystick"
deps.junit = "junit:junit:$versions.junit"
Expand Down

0 comments on commit c4f5be8

Please sign in to comment.