Skip to content

Commit 48aaa0b

Browse files
committed
Gradle and refactor
1 parent 5d63fd1 commit 48aaa0b

File tree

38 files changed

+951
-1008
lines changed

38 files changed

+951
-1008
lines changed

.gitignore

Lines changed: 54 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Created by https://www.toptal.com/developers/gitignore/api/java,macos,maven,gradle,eclipse,windows,jetbrains+all
2-
# Edit at https://www.toptal.com/developers/gitignore?templates=java,macos,maven,gradle,eclipse,windows,jetbrains+all
1+
# Created by https://www.toptal.com/developers/gitignore/api/java,gradle,maven,intellij+all,eclipse,windows,linux,macos
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=java,gradle,maven,intellij+all,eclipse,windows,linux,macos
33

44
### Eclipse ###
55
.metadata
@@ -67,33 +67,7 @@ local.properties
6767
# Spring Boot Tooling
6868
.sts4-cache/
6969

70-
### Java ###
71-
# Compiled class file
72-
*.class
73-
74-
# Log file
75-
*.log
76-
77-
# BlueJ files
78-
*.ctxt
79-
80-
# Mobile Tools for Java (J2ME)
81-
.mtj.tmp/
82-
83-
# Package Files #
84-
*.jar
85-
*.war
86-
*.nar
87-
*.ear
88-
*.zip
89-
*.tar.gz
90-
*.rar
91-
92-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
93-
hs_err_pid*
94-
replay_pid*
95-
96-
### JetBrains+all ###
70+
### Intellij+all ###
9771
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
9872
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
9973

@@ -127,14 +101,14 @@ replay_pid*
127101
# When using Gradle or Maven with auto-import, you should exclude module files,
128102
# since they will be recreated, and may cause churn. Uncomment if using
129103
# auto-import.
130-
# .idea/artifacts
131-
# .idea/compiler.xml
132-
# .idea/jarRepositories.xml
133-
# .idea/modules.xml
134-
# .idea/*.iml
135-
# .idea/modules
136-
# *.iml
137-
# *.ipr
104+
.idea/artifacts
105+
.idea/compiler.xml
106+
.idea/jarRepositories.xml
107+
.idea/modules.xml
108+
.idea/*.iml
109+
.idea/modules
110+
*.iml
111+
*.ipr
138112

139113
# CMake
140114
cmake-build-*/
@@ -172,7 +146,7 @@ fabric.properties
172146
# Android studio 3.1+ serialized cache file
173147
.idea/caches/build_file_checksums.ser
174148

175-
### JetBrains+all Patch ###
149+
### Intellij+all Patch ###
176150
# Ignore everything but code style settings and run configurations
177151
# that are supposed to be shared within teams.
178152

@@ -181,6 +155,47 @@ fabric.properties
181155
!.idea/codeStyles
182156
!.idea/runConfigurations
183157

158+
### Java ###
159+
# Compiled class file
160+
*.class
161+
162+
# Log file
163+
*.log
164+
165+
# BlueJ files
166+
*.ctxt
167+
168+
# Mobile Tools for Java (J2ME)
169+
.mtj.tmp/
170+
171+
# Package Files #
172+
*.jar
173+
*.war
174+
*.nar
175+
*.ear
176+
*.zip
177+
*.tar.gz
178+
*.rar
179+
180+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
181+
hs_err_pid*
182+
replay_pid*
183+
184+
### Linux ###
185+
*~
186+
187+
# temporary files which can be created if a process still has a handle open of a deleted file
188+
.fuse_hidden*
189+
190+
# KDE directory preferences
191+
.directory
192+
193+
# Linux trash folder which might appear on any partition or disk
194+
.Trash-*
195+
196+
# .nfs files are created when an open file is removed but is still being accessed
197+
.nfs*
198+
184199
### macOS ###
185200
# General
186201
.DS_Store
@@ -284,4 +299,4 @@ gradle-app.setting
284299
# Java heap dump
285300
*.hprof
286301

287-
# End of https://www.toptal.com/developers/gitignore/api/java,macos,maven,gradle,eclipse,windows,jetbrains+all
302+
# End of https://www.toptal.com/developers/gitignore/api/java,gradle,maven,intellij+all,eclipse,windows,linux,macos

Jenkinsfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ pipeline {
33

44
tools {
55
jdk 'Jdk17'
6-
maven 'maven'
6+
maven 'gradle'
77
}
88

99
stages {
1010
stage('Build') {
1111
steps {
1212
echo 'Building..'
13-
sh 'mvn clean package'
13+
sh './gradlew clean build'
1414
}
1515
post {
1616
success {
17-
archiveArtifacts 'spigot/target/GeyserBlockPlatform-Spigot.jar'
18-
archiveArtifacts 'bungeecord/target/GeyserBlockPlatform-Bungeecord.jar'
19-
archiveArtifacts 'velocity/target/GeyserBlockPlatform-Velocity.jar'
17+
archiveArtifacts 'spigot/build/libs/GeyserBlockPlatform-Spigot.jar'
18+
archiveArtifacts 'bungeecord/build/libs/GeyserBlockPlatform-Bungeecord.jar'
19+
archiveArtifacts 'velocity/build/libs/GeyserBlockPlatform-Velocity.jar'
2020
}
2121
}
2222
}
@@ -59,7 +59,7 @@ pipeline {
5959
env.changes = message
6060
}
6161

62-
discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n${changes}\n\n[**Artifacts on Jenkins**](https://ci.projectg.dev/job/GeyserBlockPlatform/)", footer: 'ProjectG', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), result: currentBuild.currentResult, title: "${env.JOB_NAME}", webhookURL: "${env.DISCORD_WEBHOOK}"
62+
discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n${changes}\n\n[**Artifacts on Jenkins**](https://ci.kejonamc.dev/job/GeyserBlockPlatform/)", footer: 'kejonaMC', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), result: currentBuild.currentResult, title: "${env.JOB_NAME}", webhookURL: "${env.DISCORD_WEBHOOK}"
6363
}
6464
}
6565
}

build.gradle.kts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
plugins {
3+
`java-library`
4+
id("idea")
5+
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
6+
}
7+
8+
allprojects {
9+
group = "com.github.camotoy.geyserblockplatform"
10+
version = "1.1-SNAPSHOT"
11+
description = "Prevent specific Bedrock platforms from joining your server"
12+
13+
tasks {
14+
withType<JavaCompile> {
15+
options.encoding = "UTF-8"
16+
}
17+
}
18+
}
19+
20+
subprojects {
21+
apply(plugin = "java-library")
22+
23+
java {
24+
toolchain {
25+
languageVersion.set(JavaLanguageVersion.of(8))
26+
}
27+
}
28+
29+
dependencies {
30+
annotationProcessor("org.projectlombok:lombok:1.18.28")
31+
compileOnly("org.projectlombok:lombok:1.18.28")
32+
33+
compileOnly("org.jetbrains:annotations:24.0.1")
34+
}
35+
36+
repositories {
37+
mavenCentral()
38+
maven("https://repo.opencollab.dev/main/")
39+
maven("https://oss.sonatype.org/content/repositories/snapshots")
40+
maven("https://repo.spongepowered.org/maven/")
41+
}
42+
43+
tasks.processResources {
44+
filesMatching(listOf("bungee.yml", "spigot.yml")) {
45+
expand(
46+
"description" to project.description,
47+
"version" to project.version,
48+
)
49+
}
50+
}
51+
}
52+
53+
idea {
54+
module {
55+
isDownloadJavadoc = true
56+
isDownloadSources = true
57+
}
58+
}

bungeecord/.gitignore

Lines changed: 0 additions & 113 deletions
This file was deleted.

bungeecord/build.gradle.kts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
plugins {
3+
id("com.github.johnrengelman.shadow")
4+
}
5+
6+
dependencies {
7+
compileOnly("net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT")
8+
}
9+
10+
tasks {
11+
shadowJar {
12+
val prefix = "${project.group}.${project.name}.shaded"
13+
relocate("org.spongepowered.configurate", "$prefix.configurate")
14+
relocate("io.leangen.geantyref", "$prefix.geantyref")
15+
16+
archiveFileName.set("GeyserBlockPlatform-Bungeecord.jar")
17+
}
18+
19+
build {
20+
dependsOn(shadowJar)
21+
}
22+
}

0 commit comments

Comments
 (0)