-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
executable file
·70 lines (62 loc) · 2.18 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: './versions.gradle'
apply plugin: 'com.github.ben-manes.versions'
buildscript {
apply from: './versions.gradle'
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:' + versions.gradlePlugin
classpath 'com.github.ben-manes:gradle-versions-plugin:' + versions.benmanes
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
class GreetingTask extends DefaultTask {
}
task gradleUpdates(type: GreetingTask) {
doLast {
println ''
group = "wrapper"
["nightly": "nightly",
"rc" : "release-candidate",
"current": "current"].each {
def label = it.value
def version = new groovy.json.JsonSlurper().parseText(new URL("https://services.gradle.org/versions/${label}").text)
if (version.empty) {
throw new GradleException("Cannot update wrapper to '${label}' version as there is currently no version of that label")
}
println " -${label} version: ${version.version} (downloadUrl: ${version.downloadUrl})"
}
}
finalizedBy(dependencyUpdates)
}
dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'b', 'ea'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
subprojects { //check dependecies that may cause error contains -> ./gradlew -q allDeps --configuration releaseUnitTestCompileClasspath | grep ' -> ' -B 3
task allDeps(type: DependencyReportTask) {}
}