-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
82 lines (71 loc) · 2.45 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
val samplesEnabled = !extra.has("disable_samples")
buildscript {
repositories {
google()
mavenLocal()
maven("https://plugins.gradle.org/m2/")
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:${Versions.ANDROID_GRADLE_PLUGIN}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN}")
classpath("org.jetbrains.kotlin:kotlin-serialization:${Versions.KOTLIN}")
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${Versions.ATOMIC_FU}")
classpath("org.jlleitschuh.gradle:ktlint-gradle:${Versions.KTLINT}")
}
}
plugins {
id("mirego.publish").version("1.0")
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2"
id("org.jetbrains.kotlin.plugin.compose") version Versions.KOTLIN apply false
}
allprojects {
repositories {
google()
mavenLocal()
mavenCentral()
maven("https://jitpack.io")
maven("https://plugins.gradle.org/m2/")
maven("https://s3.amazonaws.com/mirego-maven/public")
}
tasks.withType<KotlinCompilationTask<*>> {
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
version.set("0.48.0")
}
}
apiValidation {
if (samplesEnabled) {
ignoredProjects.addAll(
listOf(
"sample",
"android",
"common"
)
)
}
ignoredProjects.addAll(
listOf(
"viewmodels-declarative-compiler-core",
"viewmodels-declarative-compiler-flow",
"viewmodels-declarative-compiler-streams"
)
)
}
tasks {
val writeDevVersion by registering(WriteProperties::class) {
destinationFile.set(file("${rootDir}/gradle.properties"))
properties(java.util.Properties().apply { load(destinationFile.asFile.get().reader()) }.mapKeys { it.key.toString() })
val gitCommits = "git rev-list --count HEAD".runCommand(workingDir = rootDir)
val originalVersion = project.version.toString().replace("-dev\\w+".toRegex(), "").replace("-SNAPSHOT", "")
property("version", "$originalVersion-dev$gitCommits")
}
val tagVersion by registering(TagVersionTask::class)
}