forked from kgit2/kgit2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
105 lines (93 loc) · 3.17 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
val kotlinVersion: String by rootProject
val kotlinXCoroutinesVersion: String by rootProject
val kspVersion: String by rootProject
val bitmaskVersion: String by rootProject
val kommandVersion: String by rootProject
plugins {
kotlin("multiplatform")
id("com.google.devtools.ksp")
}
kotlin {
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosArm64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
sourceSets {
all {
languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
languageSettings.optIn("kotlin.ExperimentalStdlibApi")
}
val commonMain by getting {
dependencies {
implementation("com.squareup.okio:okio:3.2.0")
implementation("io.ktor:ktor-client-core:2.1.2")
implementation("io.github.aakira:napier:2.6.1")
implementation("com.kgit2:kommand:$kommandVersion")
implementation(project(":annotations"))
// implementation("com.kgit2:bitmask-library:$bitmaskVersion")
}
kotlin.srcDirs("build/generated/ksp/metadata/commonMain")
kotlin.srcDirs("build/generated/ksp/native/nativeMain/kotlin")
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinXCoroutinesVersion")
}
}
val nativeMain by getting
val nativeTest by getting
}
nativeTarget.apply {
compilations.getByName("main") {
cinterops {
val libgit2 by creating {
defFile(rootProject.file("lib/build/cinterop/libgit2.def"))
packageName("libgit2")
}
val libnative by creating {
defFile(rootProject.file("lib/build/cinterop/libnative.def"))
packageName("libnative")
}
}
}
binaries {
executable {
entryPoint = "main"
}
}
}
}
dependencies {
// add("kspCommonMainMetadata", "com.kgit2:bitmask-processor:$kspVersion")
// add("kspNative", "com.kgit2:bitmask-processor:$kspVersion")
add("kspCommonMainMetadata", project(":ksp"))
add("kspNative", project(":ksp"))
}
tasks {
val wrapper by getting(Wrapper::class) {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = "7.6"
}
}
allprojects {
group = "com.kgit2"
version = "1.0-SNAPSHOT"
repositories {
mavenLocal()
mavenCentral()
}
tasks.whenTaskAdded {
if (name.startsWith("ksp")) {
// logging.captureStandardError(LogLevel.ERROR)
// logging.captureStandardOutput(LogLevel.DEBUG)
group = "ksp"
// TODO("should delete this line")
// this.enabled = false
}
}
}