-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
110 lines (93 loc) · 3.33 KB
/
build.gradle.kts
File metadata and controls
110 lines (93 loc) · 3.33 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
import magik.github
import java.util.*
plugins {
kotlin("jvm") version "2.2.0"
id("elect86.magik") version "0.3.2"
id("org.danilopianini.publish-on-central") version "9.0.7"
signing
// id("com.github.johnrengelman.shadow") version "8.1.1"
}
enum class MavenRepository(val group: String) {
MARY("kotlin.graphics"),
CENTRAL("io.github.kotlin-graphics"),
;
}
val repository = System.getenv("MAVEN_REPOSITORY")?.takeIf { it.isNotBlank() }?.let { MavenRepository.valueOf(it) } ?: MavenRepository.MARY
repositories {
mavenCentral()
if (repository == MavenRepository.MARY) {
github("kotlin-graphics/mary")
}
}
dependencies {
compileOnly(repository.group, "kotlin-unsigned", "3.3.32")
compileOnly(repository.group, "kool", "0.9.79")
compileOnly("org.lwjgl:lwjgl-jemalloc:3.3.2")
testImplementation("io.kotest:kotest-runner-junit5:5.6.2")
testImplementation("io.kotest:kotest-assertions-core:5.6.2")
testImplementation(repository.group, "kool", "0.9.79")
testImplementation(repository.group, "kotlin-unsigned", "3.3.32")
}
kotlin.jvmToolchain { languageVersion.set(JavaLanguageVersion.of(8)) }
tasks {
test { useJUnitPlatform() }
}
java {
withJavadocJar()
withSourcesJar()
}
configure<PublishingExtension> {
publications {
withType<MavenPublication> {
groupId = MavenRepository.CENTRAL.group
artifactId = "glm"
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("glm")
description.set("Kotlin port of OpenGL Mathematics (GLM)")
url.set("https://github.com/kotlin-graphics/glm")
licenses {
license {
name.set("MIT")
url.set("https://choosealicense.com/licenses/mit/")
}
}
developers {
developer {
id.set("elect86")
name.set("Giuseppe Barbieri")
email.set("elect86@gmail.com")
}
developer {
id.set("bixilon")
name.set("Moritz Zwerger")
email.set("bixilon@bixilon.de")
}
}
scm {
connection.set("scm:git:https://github.com/kotlin-graphics/glm.git")
developerConnection.set("scm:git:ssh://git@github.com:kotlin-graphics/glm.git")
url.set("https://github.com/kotlin-graphics/glm")
}
}
}
}
}
signing {
val keyId = project.properties["SIGNING_KEY_ID"]?.toString()
val rawKey = project.properties["SIGNING_KEY"]?.toString()
if (keyId == null || rawKey == null) {
return@signing println("No signing key is set!")
}
val key = String(Base64.getDecoder().decode(rawKey)) // \n is not working in environment variables
val password = project.properties["SIGNING_KEY_PASSWORD"]?.toString() ?: ""
useInMemoryPgpKeys(keyId, key, password)
sign(publishing.publications["OSSRH"])
}