-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
126 lines (107 loc) · 3.07 KB
/
build.gradle.kts
File metadata and controls
126 lines (107 loc) · 3.07 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
plugins {
alias(libs.plugins.kotlin.jvm)
`maven-publish`
}
val projectName = "Netty-HttpServer"
val projectDescription = "A Kotlin library for web REST APIs built on top of Netty."
val licenseName = "GNU General Public License v3.0"
val licenseUrl = "https://www.gnu.org/licenses/gpl-3.0.en.html"
val authorName = "ccbluex"
val projectUrl = "https://github.com/ccbluex/netty-httpserver"
group = "net.ccbluex"
version = "2.6.1"
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
kotlin {
jvmToolchain(21)
}
dependencies {
api(libs.log4j.core)
api(libs.bundles.netty)
api(libs.gson)
api(libs.tika.core)
api(libs.coroutines.core)
testImplementation(kotlin("test"))
testImplementation(libs.coroutines.test)
testImplementation(libs.okhttp)
testImplementation(libs.retrofit.core)
testImplementation(libs.retrofit.gson)
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<JavaCompile> {
options.release.set(21)
}
tasks.withType<Jar> {
manifest {
attributes(
"Implementation-Title" to projectName,
"Implementation-Version" to version,
"Implementation-Vendor" to authorName,
"License" to licenseName,
"License-Url" to licenseUrl
)
}
// Include LICENSE file in the JAR
from("LICENSE") {
into("META-INF/")
}
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
from(tasks.javadoc)
}
publishing {
publications {
create<MavenPublication>("pub") {
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
pom {
name.set(projectName)
description.set(projectDescription)
url.set(projectUrl)
licenses {
license {
name.set(licenseName)
url.set(licenseUrl)
}
}
developers {
developer {
id.set("ccbluex")
name.set(authorName)
}
}
scm {
connection.set("scm:git:git://github.com/ccbluex/netty-httpserver.git")
developerConnection.set("scm:git:ssh://github.com:ccbluex/netty-httpserver.git")
url.set(projectUrl)
}
}
}
}
repositories {
maven {
name = "ccbluex-maven"
url = uri("https://maven.ccbluex.net/releases")
credentials {
username = System.getenv("MAVEN_TOKEN_NAME")
password = System.getenv("MAVEN_TOKEN_SECRET")
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
}