-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
110 lines (95 loc) · 2.99 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
import com.android.build.gradle.internal.tasks.factory.dependsOn
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
plugins {
kotlin("multiplatform") version "1.6.10"
id("org.jetbrains.changelog") version "1.3.1"
id("com.vanniktech.maven.publish") version "0.18.0"
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
id("com.android.library")
}
group = "com.faithlife"
version = "0.0.4"
repositories {
google()
mavenCentral()
}
kotlin {
android {
publishLibraryVariants("release")
}
val frameworkBaseName = "FaithlifeOAuth"
val xcFramework = XCFramework(frameworkBaseName)
ios {
binaries.framework {
baseName = frameworkBaseName
xcFramework.add(this)
}
tasks.build.dependsOn("assemble" + frameworkBaseName + "XCFramework")
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.squareup.okio:okio:3.0.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.1")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("com.willowtreeapps.assertk:assertk:0.25")
}
}
val androidMain by getting
val androidTest by getting {
dependencies {
implementation("junit:junit:4.13.1")
}
}
val iosMain by getting
val iosTest by getting
}
}
android {
compileSdk = 31
sourceSets.getByName("main").manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 21
targetSdk = 31
}
buildFeatures {
buildConfig = false
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
ktlint {
version.set("0.43.0")
}
tasks.withType<Test> {
testLogging {
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showExceptions = true
showCauses = true
}
addTestListener(object : TestListener {
override fun afterSuite(suite: TestDescriptor, result: TestResult) {
if (suite.parent == null) {
val output =
"| Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped) |"
val border = "-".repeat(output.length)
println(
"""
$border
$output
$border
""".trimIndent()
)
}
}
override fun afterTest(testDescriptor: TestDescriptor?, result: TestResult?) {}
override fun beforeTest(testDescriptor: TestDescriptor?) {}
override fun beforeSuite(suite: TestDescriptor?) {}
})
}