-
Notifications
You must be signed in to change notification settings - Fork 0
Building
Cyrusbye720 edited this page May 18, 2026
·
1 revision
- Java 21+ (required for compilation)
- Git (for cloning the repository)
git clone https://github.com/DemonZ-Development/Onlysleep.git
cd Onlysleep./gradlew clean buildOn Windows, use gradlew.bat clean build.
The compiled JAR will be in build/libs/:
build/libs/Onlysleep-1.0.0.jar
Copy the JAR to your server's plugins/ folder and restart.
git clone https://github.com/DemonZ-Development/Onlysleep.git
cd Onlysleepmvn clean packageThe compiled JAR will be in target/:
target/Onlysleep-1.0.0.jar
# Run all tests
./gradlew test
# Run specific test class
./gradlew test --tests "com.demonzdevelopment.onlysleep.config.ConfigManagerTest"
# Run with verbose output
./gradlew test --info
# Run tests without building first
./gradlew test --no-daemonThe project has 152+ unit tests covering:
- ConfigManager (configuration loading and progress bar logic)
- SleepManager (sleep counting, player filtering, permissions)
- AfkTracker (AFK detection and timeout)
- PlatformAdapter (server platform detection)
- UpdateChecker (version comparison)
- SleepPlaceholderExpansion (all 19+ placeholders)
- OnlysleepIntegrationTest (end-to-end plugin lifecycle)
./gradlew build -x test./gradlew clean build --info./gradlew clean testHTML test reports are available at build/reports/tests/test/index.html.
Onlysleep/
โโโ build.gradle.kts # Gradle build configuration
โโโ settings.gradle.kts # Gradle settings
โโโ pom.xml # Maven build configuration
โโโ gradlew / gradlew.bat # Gradle wrapper scripts
โโโ CHANGELOG.md # Version history
โโโ README.md # Main README
โโโ MODRINTH.md # Modrinth description
โโโ SPIGOT.md # Spigot description
โโโ HANGAR.md # Hangar description
โโโ wiki/ # Wiki documentation
โโโ src/
โ โโโ main/
โ โ โโโ java/com/demonzdevelopment/onlysleep/
โ โ โ โโโ Onlysleep.java # Main plugin class
โ โ โ โโโ config/ConfigManager.java # Configuration
โ โ โ โโโ command/OnlysleepCommand.java # Commands
โ โ โ โโโ listener/SleepListener.java # Event listeners
โ โ โ โโโ manager/SleepManager.java # Core logic
โ โ โ โโโ util/
โ โ โ โโโ AfkTracker.java # AFK detection
โ โ โ โโโ OfflinePlayerTracker.java # Offline caching
โ โ โ โโโ PlatformAdapter.java # Platform detection
โ โ โ โโโ SchedulerAdapter.java # Folia compatibility
โ โ โ โโโ SleepPlaceholderExpansion.java # PAPI expansion
โ โ โ โโโ UpdateChecker.java # Version checking
โ โ โโโ resources/
โ โ โโโ config.yml # Default config
โ โ โโโ messages.yml # Default messages
โ โ โโโ plugin.yml # Plugin metadata
โ โโโ test/
โ โโโ java/com/demonzdevelopment/onlysleep/
โ โโโ OnlysleepIntegrationTest.java
โ โโโ config/ConfigManagerTest.java
โ โโโ manager/SleepManagerTest.java
โ โโโ util/
โ โโโ AfkTrackerTest.java
โ โโโ PlatformAdapterTest.java
โ โโโ SleepPlaceholderExpansionTest.java
โ โโโ UpdateCheckerTest.java
โโโ .github/workflows/
โโโ build.yml # CI build workflow
โโโ codeql.yml # Security analysis
โโโ release.yml # Release automation
The project uses GitHub Actions for continuous integration:
- build.yml โ Runs on every push and pull request. Builds the plugin with both Gradle and Maven, runs all tests, and caches dependencies.
- codeql.yml โ Runs CodeQL security analysis on every push to main and weekly.
-
release.yml โ Triggered by tags matching
v*. Builds the plugin, runs tests, creates a GitHub Release with the JAR artifact.
| Dependency | Purpose |
|---|---|
| Paper API (1.21.4) | Bukkit/Paper server API |
| PlaceholderAPI | Optional placeholder expansion |
| bStats | Anonymous usage metrics |
| Adventure API | Modern component-based chat |
| Dependency | Purpose |
|---|---|
| JUnit 5 (Jupiter) | Test framework |
| Mockito 5 | Mocking Bukkit APIs |
| Mockito JUnit Jupiter | Mockito integration with JUnit 5 |
Onlysleep โ Developed by Demonz Development with โค๏ธ for the Minecraft community.
Licensed under the MIT License.
Links:
๐ Website ยท ๐ป GitHub ยท ๐ฎ Modrinth
๐ฆ Twitter/X ยท ๐ฅ YouTube ยท ๐ธ Instagram
๐ Discord ยท ๐ Reddit ยท ๐ demonzdevelopment@gmail.com