-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
149 lines (132 loc) · 4.69 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
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
plugins {
kotlin("jvm")
`maven-publish`
}
repositories {
mavenLocal()
mavenCentral()
}
val ktorVersion: String by project
val kotlinVersion: String by project
val ktxCoroutinesVersion: String by project
val gqlVersion: String by project
val log4jVersion: String by project
val gqlDslVersion: String by project
val reactiveVersion: String by project
val jacksonVersion: String by project
dependencies {
// Kotlin
implementation(platform(kotlin("bom", kotlinVersion)))
implementation(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:$ktxCoroutinesVersion"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactive")
implementation("org.reactivestreams:reactive-streams:$reactiveVersion")
// Logging
implementation("org.apache.logging.log4j:log4j-api:$log4jVersion")
// Ktor main
implementation(platform("io.ktor:ktor-bom:$ktorVersion"))
api("io.ktor:ktor-server-core")
compileOnly("io.ktor:ktor-server-websockets")
// Serialization
implementation(platform("com.fasterxml.jackson:jackson-bom:$jacksonVersion"))
api("com.fasterxml.jackson.core:jackson-databind")
api("com.fasterxml.jackson.module:jackson-module-kotlin")
// GraphQL
api("com.graphql-java:graphql-java:$gqlVersion")
testImplementation("io.ktor:ktor-server-test-host") {
exclude("ch.qos.logback")
}
testImplementation(kotlin("test-junit5"))
testImplementation("io.ktor:ktor-client-websockets")
testImplementation("io.ktor:ktor-server-content-negotiation")
testImplementation("io.ktor:ktor-client-content-negotiation")
testImplementation("io.ktor:ktor-serialization-jackson")
testRuntimeOnly("org.apache.logging.log4j:log4j-core:$log4jVersion")
testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion")
testImplementation("io.github.gui-yom:graphql-dsl:$gqlDslVersion")
testImplementation("io.github.gui-yom:graphql-dsl-test:$gqlDslVersion")
}
sourceSets {
main {
java.srcDir("src")
resources.srcDir("resources")
}
test {
java.srcDir("test")
resources.srcDir("testresources")
}
}
kotlin {
sourceSets["main"].kotlin.srcDirs("src")
sourceSets["test"].kotlin.srcDirs("test")
}
java {
targetCompatibility = JavaVersion.VERSION_18
withSourcesJar()
}
tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_18.toString()
}
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}
}
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
publishing {
repositories {
githubPackages("Gui-Yom/ktor-graphql")
maven {
name = "ossrh"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.findProperty("ossrhUsername") as String?
password = project.findProperty("ossrhPassword") as String?
}
}
}
publications {
create<MavenPublication>("root") {
from(project.components["java"])
artifact(javadocJar)
pom {
name.set("ktor-graphql")
description.set("A graphql feature for Ktor.")
url.set("https://github.com/Gui-Yom/ktor-graphql")
scm {
connection.set("scm:git:git://github.com/Gui-Yom/ktor-graphql.git")
developerConnection.set("scm:git:ssh://github.com/Gui-Yom/ktor-graphql.git")
url.set("https://github.com/Gui-Yom/ktor-graphql/")
}
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://github.com/Gui-Yom/ktor-graphql/blob/master/LICENSE")
}
}
developers {
developer {
id.set("Gui-Yom")
name.set("Guillaume Anthouard")
email.set("[email protected]")
}
}
}
}
}
}
fun RepositoryHandler.githubPackages(path: String) = maven {
url = uri("https://maven.pkg.github.com/$path")
name = "GithubPackages"
credentials {
username = project.findProperty("MERCURI_GITHUB_USERNAME") as String? ?: System.getenv("USERNAME")
password = project.findProperty("MERCURI_PACKAGE_READER_TOKEN") as String? ?: System.getenv("TOKEN")
}
}