-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
49 lines (44 loc) · 1.57 KB
/
build.gradle.kts
File metadata and controls
49 lines (44 loc) · 1.57 KB
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
plugins {
// Plugin to help us find updated dependencies, not required to use ObjectBox
alias(libs.plugins.versions)
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
// For ObjectBox: add the kapt and ObjectBox plugin
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.objectbox) apply false
}
buildscript {
// For Android projects
val _compileSdkVersion by extra(35) /* Android 15 */
val _targetSdkVersion by extra(33) /* Android 13 (TIRAMISU) */
}
// Helper task for us to quickly compress the example files into a ZIP file.
tasks.register<Zip>("zipAll") {
archiveBaseName.set("objectbox-examples")
from(rootDir) {
exclude("**/.idea/**")
exclude("**/build/**")
exclude(".gradle/**")
exclude("**/*.iml")
exclude("**/*.dll")
exclude("**/*.so")
exclude("**/local.properties")
}
destinationDirectory.set(layout.buildDirectory)
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
// Reject preview releases for dependencyUpdates task
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version)
}
}