-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
126 lines (109 loc) · 3.75 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import com.android.build.gradle.internal.tasks.factory.dependsOn
import org.gradle.api.tasks.testing.logging.TestLogEvent
/*
* Copyright 2023 estiven. Use of this source code is governed by the Apache 2.0 license.
*/
plugins {
//trick: for the same plugin versions in all sub-modules
alias(libs.plugins.androidLibrary).apply(false)
alias(libs.plugins.kotlinMultiplatform).apply(false)
alias(libs.plugins.kotlinCocoapods).apply(false)
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.dokka)
id("io.kotest.multiplatform") version "5.8.0" apply false
id("org.jetbrains.kotlinx.kover") version "0.7.6"
id("org.sonarqube") version "4.4.1.3373"
}
val ktlintVersion = libs.versions.ktlint.version.get()
buildscript {
repositories {
mavenCentral()
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
gradlePluginPortal()
}
dependencies {
classpath(":build-logic")
}
}
allprojects {
plugins.withId("org.gradle.maven-publish") {
group = "io.github.estivensh4"
version = aws.versions.aws.get()
}
}
koverReport {
verify {
rule {
bound {
minValue = 80
}
}
}
}
subprojects {
apply(plugin = "io.kotest.multiplatform")
apply(plugin = "org.jetbrains.kotlinx.kover")
apply(plugin = "org.jetbrains.dokka")
apply<io.gitlab.arturbosch.detekt.DetektPlugin>()
configure<io.gitlab.arturbosch.detekt.extensions.DetektExtension> {
source.from(files("src/"))
config.from(files("${project.rootDir}/detekt.yml"))
buildUponDefaultConfig = true
allRules = true
}
}
dependencies {
kover(projects.awsCommon)
kover(projects.awsS3)
kover(projects.awsDynamo)
}
allprojects {
tasks.withType<AbstractTestTask> {
testLogging {
showExceptions = true
showCauses = true
showStackTraces = true
showStandardStreams = true
events = setOf(
TestLogEvent.PASSED,
TestLogEvent.FAILED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT,
TestLogEvent.STANDARD_ERROR,
)
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
tasks.withType<org.jetbrains.dokka.gradle.AbstractDokkaTask> {
val className =
"org.jetbrains.kotlin.gradle.targets.native.internal.CInteropMetadataDependencyTransformationTask"
@Suppress("UNCHECKED_CAST")
val taskClass = Class.forName(className) as Class<Task>
parent?.subprojects?.forEach { dependsOn(it.tasks.withType(taskClass)) }
}
}
sonar {
properties {
property("sonar.projectKey", "estivensh4_aws-kmp")
property("sonar.organization", "estivensh4-1")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.sourceEncoding", "UTF-8")
//property("sonar.sources", "aws-s3, aws-common, aws-dynamo")
property("sonar.test", ".")
property("sonar.exclusions", "")
property("sonar.test.exclusions", "")
property("sonar.inclusions", "**/src/commonMain/**/*,**/src/jvmMain/**/*,**/src/main/**/*,**/*.swift")
property("sonar.test.inclusions", "**/src/*Test/**/*")
property("sonar.c.file.suffixes", "-")
property("sonar.cpp.file.suffixes", "-")
property("sonar.objc.file.suffixes", "-")
property("sonar.token", System.getenv("SONAR_TOKEN"))
property(
"sonar.coverage.jacoco.xmlReportPaths",
"$buildDir/reports/kover/report.xml"
)
}
}
tasks.sonar.dependsOn(":koverXmlReport")