forked from kamgurgul/cpu-info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
79 lines (71 loc) · 2.63 KB
/
build.gradle.kts
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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id(Libs.GradleVersion.plugin) version Libs.GradleVersion.version
id(Libs.Kotlin.koverPlugin) version Libs.Kotlin.koverVersion
}
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath(Libs.androidGradlePlugin)
classpath(Libs.Kotlin.gradlePlugin)
classpath(Libs.Hilt.gradlePlugin)
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
subprojects {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += listOf(
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
)
allWarningsAsErrors = true
jvmTarget = JavaVersion.VERSION_11.toString()
if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.layout.buildDirectory.dir("compose_compiler").get()
.asFile.absolutePath
)
}
if (project.findProperty("composeCompilerMetrics") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.layout.buildDirectory.dir("compose-metrics").get()
.asFile.absolutePath
)
}
}
}
}
/**
* Update dependencyUpdates task to reject versions which are more 'unstable' than our
* current version.
*/
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
val current = DependencyUpdates.versionToRelease(currentVersion)
// If we're using a SNAPSHOT, ignore since we must be doing so for a reason.
if (current == ReleaseType.SNAPSHOT) {
true
} else {
// Otherwise we reject if the candidate is more 'unstable' than our version
DependencyUpdates.versionToRelease(candidate.version).isLessStableThan(current)
}
}
}