-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
116 lines (100 loc) · 3.59 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
apply from: rootProject.file('gradle/dependencies.gradle')
apply from: rootProject.file('kotlin-android/gradle/dependencies.gradle')
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
dependencies {
classpath plugin.androidGradle
classpath plugin.androidx.navigation.safeArgs
classpath plugin.google.hilt
classpath plugin.google.secretsGradle
classpath plugin.gradleVersions
classpath plugin.node
classpath plugin.kotlin.gradle
classpath plugin.square.exhaustive
classpath plugin.square.sqlDelight
classpath plugin.kotlin.serialization
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
google()
gradlePluginPortal()
maven { url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases" }
maven { url 'https://jitpack.io' }
maven { url "https://chaquo.com/maven" }
maven { url "https://plugins.gradle.org/m2/" }
}
tasks.withType(Test) {
maxHeapSize = "4096m"
testLogging {
exceptionFormat "full"
events "started", "skipped", "passed", "failed"
showStandardStreams true
}
}
plugins.withId("com.android.library") {
extensions.getByName("android").compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
plugins.withId("kotlin") {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
freeCompilerArgs += [
"-Xinline-classes",
"-Xopt-in=kotlin.RequiresOptIn",
'-Xopt-in=kotlin.time.ExperimentalTime',
'-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
]
}
}
}
// EngineIO Modules (for tests)
ext.nodeVersion = "14.15.4"
ext.nodeWorkDir = "$rootDir/.gradle/nodejs"
task clean(type: Delete) {
delete rootProject.buildDir
}
////////////////////////////////////////////////////////////////////////////
/// Gradle Versions: https://github.com/ben-manes/gradle-versions-plugin ///
////////////////////////////////////////////////////////////////////////////
apply plugin: 'com.github.ben-manes.versions'
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
checkForGradleUpdate = true
// Example 1: reject all non stable versions
rejectVersionIf {
isNonStable(candidate.version)
}
// Example 2: disallow release candidates as upgradable versions from stable versions
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
// Example 3: using the full syntax
resolutionStrategy {
componentSelection {
all {
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
reject('Release candidate')
}
}
}
}
}