-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
122 lines (97 loc) · 3.07 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
apply plugin: 'java-library'
static String envOr(String key, String presentPrefix = "", Object or = "") {
def env = System.getenv()
if (env.containsKey(key))
return presentPrefix + env.get(key)
return or
}
def getCommitTimestampMinutes() {
// Run 'git log' command to get the timestamp of the latest commit
def result = new ByteArrayOutputStream()
exec {
commandLine 'git', 'log', '-1', '--format=%ct'
standardOutput = result
}
// Convert the timestamp to minutes
def timestampSeconds = result.toString().trim().toLong()
def timestampMinutes = timestampSeconds / 60
return (int) timestampMinutes
}
ext {
buildId = getCommitTimestampMinutes()
}
task tcBuildId {
doLast {
println "##teamcity[buildNumber '$buildId']"
}
}
tasks.named('jar').configure { dependsOn tcBuildId }
group 'org.comroid'
version '2.1' + '.' + buildId
apply from: 'gradle/vars.gradle'
sourceCompatibility = 17
targetCompatibility = 17
configurations {
compileClasspath {
resolutionStrategy.activateDependencyLocking()
}
}
tasks.withType(Javadoc) {
source = sourceSets.main.java
options {
encoding = 'UTF-8'
/*
links = [
"https://docs.oracle.com/javase/8/docs/api/",
"https://docs.oracle.com/javaee/7/api/"
]
*/
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
try {
archiveClassifier.set 'sources'
} catch (MissingPropertyException ignored) {
classifier = "sources"
}
}
task javadocJar(type: Jar) {
from javadoc.destinationDir
try {
archiveClassifier.set 'javadoc'
} catch (MissingPropertyException ignored) {
classifier = "javadoc"
}
}
compileJava.options.encoding = 'UTF-8'
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url 'https://www.jitpack.io' }
}
dependencies {
// annotations
api 'org.jetbrains:annotations:24.1.0'
// soft dependencies
compileOnly 'org.slf4j:slf4j-api:1.+'
implementation 'org.apache.logging.log4j:log4j-api:2.23.1'
compileOnly 'com.fasterxml.jackson.core:jackson-databind:2.+'
compileOnly 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.+'
compileOnly 'antlr:antlr:2.7.7'
compileOnly 'com.rabbitmq:amqp-client:5.18.0'
compileOnly 'jakarta.persistence:jakarta.persistence-api:3.+'
compileOnly 'org.apache.tomcat:tomcat-annotations-api:10.+'
compileOnly 'net.dv8tion:JDA:5.+'
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'net.kyori:adventure-api:4.11.+'
compileOnly 'net.kyori:adventure-platform-bungeecord:4.3.3'
// lombok
api 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:+'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
testImplementation 'org.easymock:easymock:+'
}
apply from: 'gradle/publishing.gradle'