-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
57 lines (48 loc) · 1.51 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
import com.pubnub.components.buildsrc.Libs
import com.pubnub.components.buildsrc.Urls
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
apply plugin: "com.github.ben-manes.versions"
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath(Libs.androidGradlePlugin)
classpath(Libs.Kotlin.gradlePlugin)
classpath(Libs.Hilt.gradlePlugin)
classpath(Libs.gradleMavenPublishPlugin)
classpath(Libs.gradleVersionsPlugin)
}
}
allprojects {
repositories {
google()
mavenCentral()
if (!Libs.AndroidX.Compose.snapshot.isEmpty()) {
maven { url Urls.composeSnapshotRepo }
maven { url Urls.mavenCentralSnapshotRepo }
}
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
// Treat all Kotlin warnings as errors
allWarningsAsErrors = true
jvmTarget = Libs.Build.Kotlin.jvmTarget
// Use experimental APIs
freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn'
freeCompilerArgs += '-opt-in=kotlin.time.ExperimentalTime'
}
}
}
// https://github.com/ben-manes/gradle-versions-plugin
def isUnstable = { String version ->
def unstableKeyword = ['ALPHA', 'BETA', 'RC'].any { it -> version.toUpperCase().contains(it) }
return unstableKeyword
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isUnstable(it.candidate.version)
}
}