-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
110 lines (100 loc) · 3.79 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 org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.8.20"
signing
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "1.0.0"
}
group = "com.arianegraphql"
version = "0.3.4"
subprojects {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
languageVersion = "1.8"
apiVersion = "1.8"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
apply(plugin = "kotlin")
apply(plugin = "maven-publish")
apply(plugin = "signing")
dependencies {
implementation(kotlin("stdlib"))
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
testImplementation("io.mockk:mockk:1.10.6")
testImplementation("io.github.serpro69:kotlin-faker:1.6.0")
}
tasks {
// published artifacts
val jarComponent = [email protected]("java")
val sourcesJar by registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val javadocJar by registering(Jar::class) {
archiveClassifier.set("javadoc")
from("$buildDir/javadoc")
}
publishing {
publications {
withType<MavenPublication> {
pom {
name.set("${[email protected]}:${[email protected]}")
url.set("https://github.com/arianegraphql/ariane-server")
description.set("Lightweight Kotlin GraphQL server")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/arianegraphql/ariane-server/blob/main/LICENSE")
}
}
developers {
developer {
id.set("mbiamont")
name.set("Melvin Biamont")
email.set("[email protected]")
url.set("https://github.com/mbiamont")
}
}
scm {
connection.set("scm:git:git://github.com/arianegraphql/ariane-server.git")
developerConnection.set("scm:git:git://github.com/arianegraphql/ariane-server.git")
url.set("https://github.com/arianegraphql/ariane-server")
}
}
}
create<MavenPublication>("mavenJava") {
from(jarComponent)
// no need to publish sources or javadocs for SNAPSHOT builds
artifact(sourcesJar.get())
artifact(javadocJar.get())
}
}
}
signing {
val signingPassword = project.property("GPG_PASSPHRASE") as String?
val signingKey = project.property("GPG_SECRET") as String?
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}
}
}
tasks {
jar {
enabled = false
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(project.property("SONATYPE_USERNAME") as String?)
password.set(project.property("SONATYPE_PASSWORD") as String?)
}
}
}
}