-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
121 lines (108 loc) · 3.42 KB
/
build.gradle
File metadata and controls
121 lines (108 loc) · 3.42 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
plugins {
id 'java'
id 'signing'
id 'maven-publish'
}
group = 'dev.ursinn'
version = '1.0-SNAPSHOT'
description = 'MinecraftServer'
repositories {
mavenCentral()
}
dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
compileOnly 'org.projectlombok:lombok:1.18.28'
annotationProcessor 'org.projectlombok:lombok:1.18.28'
testCompileOnly 'org.projectlombok:lombok:1.18.28'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.28'
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
// Build FatJar
jar {
manifest {
attributes "Main-Class": "com.github.joshj1091.mcserver.bootstrap.Bootstrap"
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
// Javadoc
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
// Publishing Stack - Start
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'mcserver'
from components.java
pom {
packaging = 'jar'
name = 'MinecraftServer'
description = 'A basic implementation of the Minecraft protocol'
url = 'https://github.com/ursinn/MinecraftServer'
inceptionYear = '2016'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/ursinn/MinecraftServer/blob/main/LICENSE'
}
}
developers {
developer {
id = 'ursinn'
name = 'Ursin Filli'
email = 'mail@ursinn.dev'
timezone = '+1'
url = 'https://ursinn.dev'
}
}
scm {
connection = 'scm:git:git://github.com/ursinn/MinecraftServer.git'
developerConnection = 'scm:git:git@github.com:ursinn/MinecraftServer.git'
url = 'https://github.com/ursinn/MinecraftServer'
}
issueManagement {
system = 'GitHub Issues'
url = 'https://github.com/ursinn/MinecraftServer/issues'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username ossrhS01Username
password ossrhS01Password
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
// Publishing Stack - End