-
Notifications
You must be signed in to change notification settings - Fork 0
Building
Cyrusbye720 edited this page Aug 29, 2026
·
2 revisions
- 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