-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
139 lines (117 loc) · 3.83 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
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
object Versions {
val java = JavaVersion.VERSION_17 // can't go higher than 17 because of shadowJar
const val kotlin = "1.9.23"
const val nettyBuffer = "4.1.107.Final" // https://mvnrepository.com/artifact/io.netty/netty-buffer
}
plugins {
kotlin("jvm") version "1.9.23"
id("java")
idea
id("com.vanniktech.maven.publish") version "0.28.0"
`java-library`
}
project.group = "com.walkmind.extensions"
project.version = "1.9"
project.description = "Collections of highly customizable binary serializers for Netty's ByteBuf class."
val artifactID = "serializers"
val licenseName = "Apache-2.0"
val licenseUrl = "http://opensource.org/licenses/apache-2.0"
val repoHttpsUrl = "https://github.com/unoexperto/extensions-serializers.git"
val repoSshUri = "[email protected]:unoexperto/extensions-serializers.git"
mavenPublishing {
configure(
KotlinJvm(
javadocJar = JavadocJar.Empty(),
sourcesJar = true,
)
)
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
coordinates(project.group.toString(), artifactID, project.version.toString())
pom {
name.set(project.name)
description.set(project.description)
inceptionYear.set("2020")
url.set(repoHttpsUrl)
licenses {
license {
name.set(licenseName)
url.set(licenseUrl)
distribution.set("repo")
}
}
developers {
developer {
email.set("[email protected]")
id.set("unoexperto")
name.set("ruslan")
url.set("https://github.com/unoexperto/")
}
}
scm {
connection.set("scm:$repoSshUri")
developerConnection.set("scm:$repoSshUri")
url.set(repoHttpsUrl)
}
}
}
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
dependencies {
implementation(kotlin("stdlib", Versions.kotlin))
compileOnly("io.netty:netty-buffer:${Versions.nettyBuffer}")
testImplementation(kotlin("test-junit5", Versions.kotlin))
testImplementation("io.netty:netty-buffer:${Versions.nettyBuffer}")
}
repositories {
mavenCentral()
}
configurations {
implementation {
resolutionStrategy.failOnVersionConflict()
}
}
java {
sourceCompatibility = Versions.java
targetCompatibility = Versions.java
}
tasks {
withType<KotlinCompile> {
// https://github.com/JetBrains/kotlin/blob/master/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt
kotlinOptions.freeCompilerArgs = listOf(
"-Xextended-compiler-checks",
"-Xjsr305=strict",
"-Xjvm-default=all",
"-Xinline-classes",
"-opt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.io.path.ExperimentalPathApi",
"-opt-in=kotlin.js.ExperimentalJsExport",
"-opt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-Xskip-prerelease-check",
)
kotlinOptions.apiVersion = "1.9"
kotlinOptions.languageVersion = "1.9"
kotlinOptions.jvmTarget = Versions.java.toString()
}
withType<Test>().all {
testLogging.showStandardStreams = true
testLogging.showExceptions = true
useJUnitPlatform {
}
}
withType<Wrapper>().all {
gradleVersion = "8.5"
distributionType = Wrapper.DistributionType.BIN
}
}