-
Notifications
You must be signed in to change notification settings - Fork 81
/
build.gradle
95 lines (86 loc) · 2.49 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
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
94
95
buildscript {
dependencies {
classpath libs.android.plugin
classpath libs.kotlin.plugin.core
classpath libs.kotlin.plugin.compose
classpath libs.kotlin.ksp.plugin
classpath libs.maven.publish.plugin
classpath libs.dokka.plugin
classpath libs.spotless.plugin
classpath libs.kotlinx.binaryCompatibilityValidator
}
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
}
allprojects {
version = property("VERSION_NAME") as String
repositories {
mavenCentral()
google()
}
}
subprojects {
tasks.withType(Test).configureEach {
testLogging {
if (System.getenv("CI") == "true") {
events = ["failed", "skipped", "passed"]
}
exceptionFormat "full"
}
}
tasks.withType(JavaCompile).configureEach { task ->
task.sourceCompatibility = '11'
task.targetCompatibility = '11'
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile).configureEach { task ->
task.kotlinOptions {
jvmTarget = '11'
}
}
plugins.withType(com.android.build.gradle.BasePlugin).configureEach {
def android = extensions.getByName("android") as com.android.build.gradle.BaseExtension
android.compileSdkVersion libs.versions.compileSdk.get().toInteger()
android.defaultConfig {
minSdkVersion libs.versions.minSdk.get().toInteger()
targetSdkVersion libs.versions.compileSdk.get().toInteger()
}
android.compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
android.lintOptions {
checkDependencies true
checkReleaseBuilds false // Full lint runs as part of 'build' task.
}
}
apply plugin: 'com.diffplug.spotless'
spotless {
kotlin {
target("src/**/*.kt")
ktlint(libs.ktlint.core.get().version)
.editorConfigOverride([
'ktlint_standard_filename': 'disabled',
// Making something an expression body should be a choice around readability.
'ktlint_standard_function-expression-body': 'disabled',
'ktlint_function_naming_ignore_when_annotated_with': 'Composable',
])
.customRuleSets([
libs.ktlint.composeRules.get().toString(),
])
licenseHeaderFile(rootProject.file('gradle/license-header.txt'))
}
}
plugins.withId('maven-publish') {
publishing {
repositories {
maven {
name = "installLocally"
url = "${rootProject.buildDir}/localMaven"
}
}
}
}
}