Skip to content

Instantly share code, notes, and snippets.

@sonOfRa
Created November 1, 2018 10:51
Show Gist options
  • Save sonOfRa/4e15a5a1ccb9c35d96955cacbadb18a8 to your computer and use it in GitHub Desktop.
Save sonOfRa/4e15a5a1ccb9c35d96955cacbadb18a8 to your computer and use it in GitHub Desktop.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "com.github.ben-manes:gradle-versions-plugin:0.20.0"
classpath "gradle.plugin.se.patrikerdes:gradle-use-latest-versions-plugin:0.2.3"
classpath 'net.researchgate:gradle-release:2.6.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply from: 'release.gradle'
apply plugin: "com.github.ben-manes.versions"
apply plugin: "se.patrikerdes.use-latest-versions"
apply plugin: 'net.researchgate.release'
dependencyUpdates {
resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
if (selection.candidate.group != "com.wiberry") {
selection.reject('Only Wiberry!')
}
}
}
}
checkForGradleUpdate = false
revision = "release"
}
task build{}
build.dependsOn('app:assembleRelease')
task test{}
test.dependsOn('app:testReleaseUnitTest')
release {
buildTasks = ['build', 'test']
// Single quotes! The substitution is not done by gradle, it's done by the plugin
// If we use double quotes, gradle will substitute, which will cause a tag like
// v1.2.3-SNAPSHOT
tagTemplate = 'v${version}'
preTagCommitMessage = '[Release Automation] - pre tag commit: '
tagCommitMessage = '[Release Automation] - creating tag: '
newVersionCommitMessage = '[Release Automation] - new version commit: '
git {
requireBranch = ''
pushToRemote = "${project.findProperty('remote')}"
}
}
afterReleaseBuild.dependsOn('app:uploadArchives')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment