-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
117 lines (107 loc) · 3.56 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
import kool.gen.GenerateCode
import magik.createGithubPublication
import magik.github
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.lwjgl.Lwjgl.Module.jemalloc
import org.lwjgl.lwjgl
import java.util.*
plugins {
embeddedKotlin("jvm")
id("org.lwjgl.plugin") version "0.0.34"
id("elect86.magik") version "0.3.3"
`maven-publish`
signing
// id("com.github.johnrengelman.shadow") version "8.1.1"
}
repositories {
mavenCentral()
}
dependencies {
lwjgl { implementation(jemalloc) }
testImplementation(embeddedKotlin("test"))
}
kotlin.jvmToolchain { languageVersion.set(JavaLanguageVersion.of(8)) }
tasks {
withType<KotlinCompile<*>>().all { kotlinOptions { freeCompilerArgs += listOf("-opt-in=kotlin.RequiresOptIn") } }
val generateCode by registering(GenerateCode::class)
kotlin.sourceSets { main { kotlin.srcDir(generateCode) } }
test { useJUnitPlatform() }
}
publishing {
publications {
createGithubPublication {
from(components["java"])
suppressAllPomMetadataWarnings()
}
}
repositories { github { domain = "kotlin-graphics/mary" } }
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<Javadoc> {
isFailOnError = false
}
configure<PublishingExtension> {
publications {
create<MavenPublication>("mavenCentral") {
groupId = "io.github.kotlin-graphics"
artifactId = "kool"
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("kool")
description.set("Buffer utils")
url.set("https://github.com/kotlin-graphics/kool")
licenses {
license {
name.set("MIT")
url.set("https://choosealicense.com/licenses/mit/")
}
}
developers {
developer {
id.set("elect86")
name.set("Giuseppe Barbieri")
email.set("[email protected]")
}
developer {
id.set("bixilon")
name.set("Moritz Zwerger")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:https://github.com/kotlin-graphics/kool.git")
developerConnection.set("scm:git:ssh://[email protected]:kotlin-graphics/kool.git")
url.set("https://github.com/kotlin-graphics/kool")
}
}
}
}
repositories {
maven {
name = "mavenCentral"
credentials {
username = project.properties["NEXUS_USERNAME"].toString()
password = project.properties["NEXUS_PASSWORD"].toString()
}
url = uri("https://s01.oss.sonatype.org/content/repositories/releases/")
}
}
}
signing {
val rawKey = project.properties["SIGNING_KEY"]?.toString() ?: return@signing
val key = String(Base64.getDecoder().decode(rawKey)) // \n is not working in environment variables
val password = project.properties["SIGNING_KEY_PASSWORD"]?.toString() ?: ""
useInMemoryPgpKeys(key, password)
sign(publishing.publications["mavenCentral"])
}