-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
798 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
These instructions are written with Linux in mind because that is my development environment. | ||
|
||
|
||
Java Environment | ||
---------------- | ||
|
||
Create a ".env" file, and assign the `JAVA_HOME` variable to the path of the | ||
Java 17 JDK. E.g., | ||
|
||
```shell | ||
# Define the version of Java to use with Gradle (i.e., "./gradlew"). | ||
JAVA_HOME=/usr/lib/jvm/java-17-openjdk | ||
``` | ||
|
||
The "env-gradlew" script is a wrapper around "gradlew", and loads the ".env" file to ensure Gradle is run with the proper version of Java. | ||
|
||
|
||
IDE Projects | ||
------------ | ||
|
||
Project files for IntelliJ IDEA and Eclipse can be generated by running the "idea" and "eclipse" tasks, respectively: | ||
|
||
```shell | ||
./env-gradlew idea | ||
# OR | ||
./env-gradlew eclipse | ||
``` | ||
|
||
|
||
Playtesting | ||
----------- | ||
|
||
The Minecraft client can be run directly with the mod by running the "runClient" task: | ||
|
||
```shell | ||
./env-gradlew runClient | ||
``` | ||
|
||
Once a world has been launched within Minecraft, the metrics can be inspected by running: | ||
|
||
```shell | ||
curl -Ss 'http://localhost:19565/metrics' | ||
``` | ||
|
||
|
||
Compiling | ||
--------- | ||
|
||
The release JAR can be compiled by running the "assemble" task: | ||
|
||
```shell | ||
./env-gradlew assemble | ||
``` | ||
|
||
The release JAR will be located at "build/libs/Prometheus-Exporter-{MC Version}-{Mod Loader}-{Mod Version}.jar". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Grafana | ||
------- | ||
|
||
Known compatible Grafana (v9) dashboards: | ||
|
||
- [Minecraft Server Stats] built by [randombk]. | ||
|
||
|
||
[Minecraft Server Stats]: https://grafana.com/grafana/dashboards/16508-minecraft-server-stats/ | ||
[randombk]: https://github.com/randombk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# | ||
# This is a tiny wrapper to load the environment variables from ".env" before | ||
# running "gradlew". This makes using the correct version of Java easier. | ||
# | ||
|
||
# Exit on error. | ||
set -e | ||
|
||
# Get project directory. | ||
home_dir="$(cd "$(dirname "$0")" && pwd)" | ||
|
||
# Load ".env". | ||
set -a | ||
. "$home_dir/.env" | ||
set +a | ||
|
||
# Verify Gradle wrapper JAR. | ||
# - See <https://gradle.org/release-checksums/>. | ||
sha256sum --quiet -c "$home_dir/gradle-wrapper-v8.1.sha256" | ||
|
||
# Run Gradle. | ||
"$home_dir/gradlew" "$@" |
Oops, something went wrong.