-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
93 lines (84 loc) · 3.03 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.yarn
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.nio.file.Files
plugins {
alias(libs.plugins.aboutlibraries) apply false
alias(libs.plugins.android) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.cocoapods) apply false
alias(libs.plugins.compose) apply false
alias(libs.plugins.crashlytics) apply false
alias(libs.plugins.multiplatform) apply false
alias(libs.plugins.moko.resources) apply false
alias(libs.plugins.osdetector) apply false
alias(libs.plugins.sekret) apply false
alias(libs.plugins.serialization) apply false
alias(libs.plugins.complete.kotlin)
alias(libs.plugins.versions)
}
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven("https://gitlab.com/api/v4/projects/38224197/packages/maven")
maven("https://jitpack.io")
maven("https://jogamp.org/deployment/maven")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
dependencies {
classpath(libs.moko.resources.generator)
}
}
allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven("https://gitlab.com/api/v4/projects/38224197/packages/maven")
maven("https://jitpack.io")
maven("https://jogamp.org/deployment/maven")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = CompileOptions.jvmTarget
}
configurations.configureEach {
exclude("androidx.palette", "palette")
}
plugins.withType<YarnPlugin> {
yarn.yarnLockAutoReplace = true
}
}
plugins.withType<YarnPlugin> {
yarn.yarnLockAutoReplace = true
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}
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()
}
fun File.existsSafely() = runCatching {
Files.exists(this.toPath())
}.getOrNull() ?: runCatching {
this.exists()
}.getOrNull() ?: false
fun File.create() = runCatching {
Files.createFile(this.toPath()).toFile()
}.getOrNull() ?: runCatching {
this.createNewFile()
this
}.getOrNull() ?: this