improved dev stuff. Local server and build

This commit is contained in:
Niklas 2020-06-28 15:08:12 +02:00
parent 46e97dcb43
commit f8a466a955
12 changed files with 58 additions and 7 deletions

2
.gitignore vendored
View File

@ -2,6 +2,8 @@
**/build/
!src/**/build/
dev/container
dev/server
dev/build
# Ignore Gradle GUI config
gradle-app.setting

View File

@ -0,0 +1,15 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Attach" type="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" />
<option name="HOST" value="127.0.0.1" />
<option name="PORT" value="5005" />
<option name="AUTO_RESTART" value="false" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="5005" />
<option name="LOCAL" value="false" />
</RunnerSettings>
<method v="2" />
</configuration>
</component>

View File

@ -15,6 +15,13 @@ Running gradle from Intellij works fine but from the terminal i had to use
# Dev tools
## Local Server
You can compile the spigot server on your own by running `./buildSpigot.sh 1.16.1` inside the dev directory. The first
parameter is the version. If no version is given the `latest` tag is used which is not always the newest minecraft
version.
After that you can start the server and it will run inside the `server` directory.
## Server
You can run a spigot server for development. Run `sudo docker-compose up` inside of `dev`.
To make inserting the plugin easier change the `SPIGOT_UID` to your UID (run the `id` command). The only problem is

15
dev/buildSpigot.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env sh
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
mkdir $SCRIPTPATH/build
mkdir $SCRIPTPATH/server
cd $SCRIPTPATH/build
curl -o BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
java -jar BuildTools.jar --rev ${1:-latest}
cd $SCRIPTPATH/server
echo "eula=true" > eula.txt

View File

@ -3,7 +3,7 @@ version: "3"
services:
spigot-dev:
image: "nimmis/spigot"
container_name: "spigot-dev-hc-revive"
container_name: "spigot-dev"
environment:
- EULA=true
- MC_MAXMEM=4g

5
dev/docker/insertPlugin.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
cp $SCRIPTPATH/../../build/libs/* $SCRIPTPATH/container/plugins

2
dev/docker/log.sh Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env sh
sudo docker exec spigot-dev mc_log

2
dev/docker/restartServer.sh Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env sh
sudo docker exec spigot-dev mc_restart

View File

@ -2,4 +2,4 @@
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
cp $SCRIPTPATH/../build/libs/* $SCRIPTPATH/container/plugins
cp $SCRIPTPATH/../build/libs/* $SCRIPTPATH/server/plugins

View File

@ -1,2 +0,0 @@
#!/usr/bin/env sh
sudo docker exec spigot-dev-hc-revive mc_log

View File

@ -1,2 +0,0 @@
#!/usr/bin/env sh
sudo docker exec spigot-dev-hc-revive mc_restart

7
dev/startServer.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env sh
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
cd $SCRIPTPATH/server
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005 -jar $SCRIPTPATH/build/spigot-*.jar nogui