-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
67 lines (59 loc) · 2.2 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
import app.elementaryeditor.buildsrc.DependencyUpdates
import app.elementaryeditor.buildsrc.ReleaseType
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.buildConfig = [
'compileSdk': 31,
'minSdk' : 21,
'targetSdk' : 31,
]
repositories {
google()
mavenCentral()
}
dependencies {
classpath libs.android.pluginGradle
classpath libs.kotlin.pluginGradle
classpath libs.androidx.navigation.safeArgs.pluginGradle
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
alias(libs.plugins.gradleDependencyUpdate)
}
subprojects {
configurations.configureEach {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
// Enable experimental coroutines APIs, including Flow
freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.FlowPreview"
freeCompilerArgs += "-Xopt-in=kotlin.time.ExperimentalTime"
// Set JVM target to 11
jvmTarget = JavaVersion.VERSION_11
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
/**
* Update dependencyUpdates task to reject versions which are more 'unstable' than our
* current version.
*/
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
def current = DependencyUpdates.versionToRelease(it.currentVersion)
// If we're using a SNAPSHOT, ignore since we must be doing so for a reason.
if (current == ReleaseType.SNAPSHOT) return true
// Otherwise we reject if the candidate is more 'unstable' than our version
def candidate = DependencyUpdates.versionToRelease(it.candidate.version)
return candidate.isLessStableThan(current)
}
}
Object propOrDef(String propertyName, Object defaultValue) {
def propertyValue = project.properties[propertyName]
return propertyValue != null ? propertyValue : defaultValue
}