This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
103 lines (92 loc) · 2.94 KB
/
build.gradle
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
import org.gradle.process.internal.ExecException
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
}
group = 'lol.hub'
version = { ->
def pattern = 'v[0-9]*'
def fallback = 'indev'
def result = new ByteArrayOutputStream()
try {
exec {
commandLine 'git', 'describe', '--tags', '--abbrev=0', '--match', pattern
ignoreExitValue = true
standardOutput = result
// void stderr
errorOutput = new OutputStream() {
@Override
void write(int b) throws IOException {}
}
}
} catch (ExecException ignored) {
ignored.printStackTrace()
println 'No git tag found with format \'' + pattern + '\', using fallback version identifier \'' + fallback + '\'.'
return fallback
}
return result.toString().trim().replaceFirst('v', '')
}()
repositories {
mavenCentral()
}
dependencies {
compileOnly group: 'org.jetbrains', name: 'annotations', version: '24.1.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.11.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.11.0'
testImplementation group: 'net.jodah', name: 'concurrentunit', version: '0.4.6'
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
withJavadocJar()
withSourcesJar()
}
javadoc {
options.addBooleanOption('html5', true)
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
}
test {
useJUnitPlatform()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = project.name
description = 'Tiny and fast pubsub implementation with subscriber priorities and event canceling for Java.'
licenses {
license {
name = 'MIT License'
url = 'https://raw.githubusercontent.com/nothub/TinyEventBus/master/LICENSE.txt'
}
}
developers {
developer {
name = 'hub'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/nothub/TinyEventBus.git'
developerConnection = 'scm:git:ssh://github.com/nothub/TinyEventBus.git'
url = 'https://github.com/nothub/TinyEventBus'
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}