Skip to content

Commit 33b97c6

Browse files
committed
initial commit
0 parents  commit 33b97c6

10 files changed

Lines changed: 710 additions & 0 deletions

File tree

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea/modules.xml
9+
.idea/jarRepositories.xml
10+
.idea/compiler.xml
11+
.idea/libraries/
12+
.idea/
13+
14+
*.iws
15+
*.iml
16+
*.ipr
17+
out/
18+
!**/src/main/**/out/
19+
!**/src/test/**/out/
20+
21+
### Kotlin ###
22+
.kotlin
23+
24+
### Eclipse ###
25+
.apt_generated
26+
.classpath
27+
.factorypath
28+
.project
29+
.settings
30+
.springBeans
31+
.sts4-cache
32+
bin/
33+
!**/src/main/**/bin/
34+
!**/src/test/**/bin/
35+
36+
### NetBeans ###
37+
/nbproject/private/
38+
/nbbuild/
39+
/dist/
40+
/nbdist/
41+
/.nb-gradle/
42+
43+
### VS Code ###
44+
.vscode/
45+
46+
### Mac OS ###
47+
.DS_Store

README.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# stomrun
2+
3+
A Gradle plugin for Minestom projects with a clean `stomrun {}` DSL.
4+
5+
What it does:
6+
7+
- Adds required repositories for Minestom and optional GitHub dependencies
8+
- Injects Minestom automatically into `implementation`
9+
- Creates a `runStom` task to run your server quickly
10+
11+
## Install (JitPack)
12+
13+
### Kotlin DSL (`build.gradle.kts`)
14+
15+
```kotlin
16+
buildscript {
17+
repositories {
18+
maven(url = "https://jitpack.io")
19+
}
20+
dependencies {
21+
classpath("com.github.bed-dev:stomrun:1.0.0")
22+
}
23+
}
24+
25+
apply(plugin = "codes.bed.stomrun")
26+
```
27+
28+
### Groovy DSL (`build.gradle`)
29+
30+
```groovy
31+
buildscript {
32+
repositories {
33+
maven { url = uri('https://jitpack.io') }
34+
}
35+
dependencies {
36+
classpath 'com.github.bed-dev:stomrun:1.0.0'
37+
}
38+
}
39+
40+
apply plugin: 'codes.bed.stomrun'
41+
```
42+
43+
If JitPack is temporarily unavailable, this plugin is planned to be available on Maven Central soon.
44+
45+
## Quick Start
46+
47+
### Kotlin DSL (`build.gradle.kts`)
48+
49+
```kotlin
50+
stomrun {
51+
version {
52+
minecraft.set("1.21.11")
53+
minestom.set("latest")
54+
}
55+
56+
libraries {
57+
mavenCentral("io.github.togar2", "MinestomPvP", "2025.12.29-1.21.11")
58+
implementation("net.kyori:adventure-api:4.17.0")
59+
github("Revxyrsal", "Lamp")
60+
}
61+
62+
runServer {
63+
memory.set("2G")
64+
mainClass.set("com.example.server.Main")
65+
jvmArg("-Dminestom.debug=true")
66+
args("nogui")
67+
}
68+
}
69+
```
70+
71+
### Groovy DSL (`build.gradle`)
72+
73+
```groovy
74+
stomrun {
75+
version {
76+
minecraft = '1.21.11'
77+
minestom = 'latest'
78+
}
79+
80+
libraries {
81+
mavenCentral('io.github.togar2', 'MinestomPvP', '2025.12.29-1.21.11')
82+
implementation('net.kyori:adventure-api:4.17.0')
83+
github('Revxyrsal', 'Lamp')
84+
}
85+
86+
runServer {
87+
memory = '2G'
88+
mainClass = 'com.example.server.Main'
89+
jvmArg('-Dminestom.debug=true')
90+
args('nogui')
91+
}
92+
}
93+
```
94+
95+
## DSL Reference
96+
97+
### `version {}`
98+
99+
- `minecraft` default: `1.21.11`
100+
- `minestom` default: `latest`
101+
- If `minestom` is `latest`, `minecraft` is used as Minestom version
102+
103+
### `libraries {}`
104+
105+
- `github(owner, repo)` -> `com.github.<owner>:<repo>:master-SNAPSHOT`
106+
- `github(owner, repo, tag)` -> `com.github.<owner>:<repo>:<tag>`
107+
- `implementation("group:artifact:version")`
108+
- `implementation(group, artifact, version)`
109+
- `mavenCentral(group, artifact, version)`
110+
111+
Repository behavior:
112+
113+
- Always adds Maven Central and Minestom snapshots
114+
- Adds JitPack only when `github(...)` is used
115+
116+
### `runServer {}`
117+
118+
- `memory` default: `2G` (used for `-Xms` and `-Xmx`)
119+
- `mainClass` default: `com.example.server.Main`
120+
- `jvmArg("...")` appends JVM flags
121+
- `args("...")` appends program args
122+
- `workingDirectory` default: project directory
123+
124+
## Run
125+
126+
```powershell
127+
.\gradlew.bat runStom
128+
```
129+
130+

build.gradle.kts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
plugins {
2+
`java-gradle-plugin`
3+
`kotlin-dsl`
4+
}
5+
6+
group = "codes.bed"
7+
version = "1.0.0"
8+
9+
repositories {
10+
gradlePluginPortal()
11+
mavenCentral()
12+
}
13+
14+
gradlePlugin {
15+
plugins {
16+
create("stomrun") {
17+
id = "codes.bed.stomrun"
18+
implementationClass = "dev.bed.stomrun.StomrunGradlePlugin"
19+
displayName = "Stomrun"
20+
description = "Declarative Gradle plugin for configuring and running Minestom servers by bed-dev"
21+
}
22+
}
23+
}
24+
25+
dependencies {
26+
testImplementation(kotlin("test"))
27+
}
28+
29+
kotlin {
30+
jvmToolchain(21)
31+
}
32+
33+
tasks.test {
34+
useJUnitPlatform()
35+
}
36+

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kotlin.code.style=official

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Mar 18 06:46:49 GMT+01:00 2026
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)