forked from SORMAS-Foundation/SORMAS-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (75 loc) · 2.61 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
classpath 'com.google.firebase:perf-plugin:1.4.2'
classpath 'org.jacoco:org.jacoco.core:0.8.10'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.0.0.2929'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
// Use "dependencyUpdates" task to list all updateable dependencies.
// For unknown reasons the Android Studio gradle tooling doesn't list all updates
id "com.github.ben-manes.versions" version "0.47.0"
}
allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
flatDir {
dirs 'libs'
}
}
// this makes sure that the compiler let's us know about underlying errors
// otherwise you only see "error: cannot find symbol class DataBindingComponent"
gradle.projectsEvaluated {
tasks.withType(JavaCompile.class) {
options.compilerArgs << "-Xmaxerrs" << "10000"
}
}
afterEvaluate {
if (project.plugins.hasPlugin("kotlin-kapt")) {
kapt {
javacOptions {
option("-Xmaxerrs", 10000)
}
}
}
}
}
/**
* Returns an int representing how mature [version] is. Higher numbers are more mature.
* https://github.com/ben-manes/gradle-versions-plugin/issues/440#issuecomment-1410918392
*/
static def maturityLevel(String version) {
/**
* Version qualifiers, in order from least to most mature.
* The most mature is to have no qualifier at all.
*/
def qualifiers = ["preview", "alpha", "beta", "m", "cr", "rc"]
def qualifiersRegex = qualifiers.collect { /(?i).*[.\-]$it[.\-\d]*/ }
def index = qualifiersRegex.findIndexOf { version ==~ it }
return (index < 0) ? qualifiers.size : index
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
def candidateMaturity = maturityLevel(it.candidate.version)
def currentMaturity = maturityLevel(it.currentVersion)
candidateMaturity < currentMaturity
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply from: 'versioning.gradle'
apply from: 'signing.gradle'