-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
112 lines (94 loc) · 3.11 KB
/
build.gradle.kts
File metadata and controls
112 lines (94 loc) · 3.11 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
plugins {
`java-library`
`maven-publish`
signing
id("com.gradleup.nmcp").version("1.4.4")
id("com.gradleup.nmcp.aggregation").version("1.4.4")
}
group = "io.github.merlimat.slog"
version = System.getenv("RELEASE_VERSION") ?: "0.0.0-SNAPSHOT"
val slf4jVersion: String by project
val log4j2Version: String by project
val junitVersion: String by project
val jacksonVersion: String by project
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
compileOnly("org.slf4j:slf4j-api:$slf4jVersion")
compileOnly("org.apache.logging.log4j:log4j-core:$log4j2Version")
compileOnly("org.apache.logging.log4j:log4j-api:$log4j2Version")
testImplementation("org.slf4j:slf4j-api:$slf4jVersion")
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.apache.logging.log4j:log4j-core:$log4j2Version")
testImplementation("org.apache.logging.log4j:log4j-slf4j2-impl:$log4j2Version")
testImplementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
nmcpAggregation(project(":"))
}
tasks.register("benchmark") {
description = "Run JMH benchmarks"
group = "benchmark"
dependsOn(":benchmark:jmh")
}
tasks.javadoc {
exclude("io/github/merlimat/slog/impl/**")
}
tasks.test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifactId = "slog"
pom {
name = "slog"
description = "Structured logging for Java, inspired by Go's log/slog"
url = "https://github.com/merlimat/slog"
licenses {
license {
name = "Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0"
}
}
developers {
developer {
id = "merlimat"
name = "Matteo Merli"
email = "matteo.merli@gmail.com"
}
}
scm {
connection = "scm:git:git://github.com/merlimat/slog.git"
developerConnection = "scm:git:ssh://github.com/merlimat/slog.git"
url = "https://github.com/merlimat/slog"
}
}
}
}
}
signing {
val signingKey = System.getenv("GPG_PRIVATE_KEY")
val signingPassword = System.getenv("GPG_PASSPHRASE")
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}
}
nmcpAggregation {
centralPortal {
username = System.getenv("CENTRAL_USERNAME")
password = System.getenv("CENTRAL_PASSWORD")
publishingType = "AUTOMATIC"
}
}