-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
174 lines (156 loc) · 6.32 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
174 lines (156 loc) · 6.32 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
group = "io.github.tukcps"
version = "0.9.10"
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.dokka)
id("idea")
id("maven-publish")
signing
}
repositories {
mavenCentral()
}
kotlin {
jvmToolchain(21)
jvm {}
val hostOs = System.getProperty("os.name")
val procArch = System.getProperty("os.arch")
val isWindows = hostOs.startsWith("Windows")
val isLinux = hostOs.startsWith("Linux")
val isMacOs = hostOs.startsWith("Mac")
val isArm64 = procArch.startsWith("aarch64")
val isX64 = procArch.startsWith("x86_64") || procArch.startsWith("x64") || procArch.startsWith("amd64")
compilerOptions { freeCompilerArgs.add("-Xexpect-actual-classes") }
when {
isMacOs -> {
when {
isArm64 -> macosArm64("native"){ binaries { sharedLib { baseName = "aadd" } } }
isX64 -> @Suppress("DEPRECATION") macosX64("native") { binaries { sharedLib { baseName = "aadd" } } }
else -> throw GradleException("Mac Processor Architecture not supported")
}
}
isLinux -> {
when {
isX64 -> linuxX64("native") { binaries { sharedLib { baseName = "aadd" } } }
isArm64 -> linuxArm64("native") { binaries { sharedLib { baseName = "aadd" } } }
else -> throw GradleException("Linux Processor Architecture not supported")
}
}
isWindows -> mingwX64("native"){
binaries { sharedLib { baseName = "aadd" } }
}
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
sourceSets {
commonMain.dependencies {
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.serialization.json)
}
commonTest.dependencies {
implementation(kotlin("test"))
}
}
}
tasks.named<Test>("jvmTest") {
useJUnitPlatform()
outputs.upToDateWhen { false }
}
val javadocJar = tasks.register<Jar>("javadocJar") {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Javadoc JAR"
archiveClassifier.set("javadoc")
from(tasks.named("dokkaGeneratePublicationHtml"))
}
publishing {
publications {
create<MavenPublication>("aadd") {
groupId = "io.github.tukcps"
artifactId = "aadd"
version = project.version.toString()
artifact(tasks["jvmJar"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
pom{
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
// pom {
name.set(project.name)
description.set("Affine Arithmetic Decision Diagram Library for Kotlin Multiplatform")
url.set("https://github.com/tukcps/Multiplatform-AADD")
licenses {
license {
name.set("Apache-2.0")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}
developers {
developer {
id.set("heermann")
name.set("Hagen Heermann")
organization.set("University of Kaiserslautern-Landau")
organizationUrl.set("https://github.com/tukcps/")
}
developer {
id.set("kwasigroch")
name.set("Sören Kwasigroch")
organization.set("University of Kaiserslautern-Landau")
organizationUrl.set("https://github.com/tukcps/")
}
developer {
id.set("zivkovic")
name.set("Carna Zivkovic")
organization.set("University of Kaiserslautern-Landau")
organizationUrl.set("https://github.com/tukcps/")
}
developer {
id.set("grimm")
name.set("Christoph Grimm")
organization.set("University of Kaiserslautern-Landau")
organizationUrl.set("https://github.com/tukcps/")
}
developer {
id.set("ratzke")
name.set("Axel Ratzke")
organization.set("University of Kaiserslautern-Landau")
organizationUrl.set("https://github.com/tukcps/")
}
developer {
id.set("herzog")
name.set("Moritz Herzog")
organization.set("University of Kaiserslautern-Landau")
organizationUrl.set("https://github.com/tukcps/")
}
}
scm {
url.set("https://github.com/tukcps/Multiplatform-AADD.git")
connection.set("scm:git:git://github.com/tukcps/Multiplatform-AADD.git")
developerConnection.set("scm:git:git://github.com/tukcps/Multiplatform-AADD.git")
}
issueManagement {
url.set("https://github.com/tukcps/Multiplatform-AADD/issues")
}
// }
}
}
}
repositories {
maven("https://cpsgit.informatik.uni-kl.de/api/v4/projects/152/packages/maven") {
name = "GitLab"
credentials(HttpHeaderCredentials::class) {
name = "Deploy-Token"
value = System.getenv("DEPLOY_TOKEN")
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
}
signing {
val signingKey = "${System.getenv("SIGNING_KEY")}"
val signingPassphrase = "${System.getenv("SIGNING_PASSPHRASE")}"
useInMemoryPgpKeys(signingKey, signingPassphrase)
sign(publishing.publications["aadd"])
}