Skip to content

Commit 9a6a813

Browse files
committed
Init commit
1 parent 5c695dc commit 9a6a813

File tree

19 files changed

+921
-0
lines changed

19 files changed

+921
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Automatically build the project and run any configured tests for every push
2+
# and submitted pull request. This can help catch issues that only occur on
3+
# certain platforms or Java versions, and provides a first line of defence
4+
# against bad commits.
5+
6+
name: build
7+
on: [pull_request, push]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
# Use these Java versions
14+
java: [
15+
21, # Current Java LTS
16+
]
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- name: checkout repository
20+
uses: actions/checkout@v4
21+
- name: validate gradle wrapper
22+
uses: gradle/wrapper-validation-action@v2
23+
- name: setup jdk ${{ matrix.java }}
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: ${{ matrix.java }}
27+
distribution: 'microsoft'
28+
- name: make gradle wrapper executable
29+
run: chmod +x ./gradlew
30+
- name: build
31+
run: ./gradlew build
32+
- name: capture build artifacts
33+
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: Artifacts
37+
path: build/libs/

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# gradle
2+
3+
.gradle/
4+
build/
5+
out/
6+
classes/
7+
8+
# eclipse
9+
10+
*.launch
11+
12+
# idea
13+
14+
.idea/
15+
*.iml
16+
*.ipr
17+
*.iws
18+
19+
# vscode
20+
21+
.settings/
22+
.vscode/
23+
bin/
24+
.classpath
25+
.project
26+
27+
# macos
28+
29+
*.DS_Store
30+
31+
# fabric
32+
33+
run/
34+
35+
# java
36+
37+
hs_err_*.log
38+
replay_*.log
39+
*.hprof
40+
*.jfr

build.gradle.kts

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import dev.kordex.gradle.plugins.kordex.DataCollection
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4+
5+
plugins {
6+
id("fabric-loom") version "1.8-SNAPSHOT"
7+
id("maven-publish")
8+
id("org.jetbrains.kotlin.jvm") version "2.0.21"
9+
id("dev.kordex.gradle.kordex") version "1.4.2"
10+
}
11+
12+
version = property("mod_version").toString()
13+
group = property("maven_group").toString()
14+
15+
base {
16+
archivesName.set(property("archives_base_name").toString())
17+
}
18+
19+
20+
repositories {
21+
// Add repositories to retrieve artifacts from in here.
22+
// You should only use this when depending on other mods because
23+
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
24+
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
25+
// for more information about repositories.
26+
maven("https://oss.sonatype.org/content/repositories/snapshots")
27+
maven("https://maven.enjarai.dev/releases")
28+
maven("https://maven.nucleoid.xyz")
29+
}
30+
31+
loom {
32+
splitEnvironmentSourceSets()
33+
34+
mods {
35+
create("compsmpdiscordbot") {
36+
sourceSet(sourceSets.main.get())
37+
}
38+
}
39+
40+
}
41+
42+
dependencies {
43+
minecraft("com.mojang:minecraft:${property("minecraft_version")}")
44+
mappings("net.fabricmc:yarn:${property("yarn_mappings")}:v2")
45+
modImplementation("net.fabricmc:fabric-loader:${property("loader_version")}")
46+
47+
modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_version")}")
48+
modImplementation("net.fabricmc:fabric-language-kotlin:${property("fabric_kotlin_version")}")
49+
50+
modImplementation("xd.arkosammy:monkeyconfig:${property("monkey_config_version")}")
51+
52+
}
53+
54+
kordEx {
55+
jvmTarget = 21
56+
bot {
57+
dataCollection(DataCollection.Standard)
58+
59+
mainClass = "xd.arkosammy.compsmpdiscordbot.CompSMPDiscordBot"
60+
}
61+
}
62+
63+
tasks.processResources {
64+
inputs.property("version", project.version)
65+
66+
filesMatching("fabric.mod.json") {
67+
expand(mapOf("version" to project.version))
68+
}
69+
}
70+
71+
tasks.withType<JavaCompile>().configureEach {
72+
options.release = 21
73+
}
74+
75+
tasks.withType<KotlinCompile>().configureEach {
76+
compilerOptions {
77+
jvmTarget = JvmTarget.JVM_21
78+
}
79+
}
80+
81+
java {
82+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
83+
// if it is present.
84+
// If you remove this line, sources will not be generated.
85+
withSourcesJar()
86+
87+
sourceCompatibility = JavaVersion.VERSION_21
88+
targetCompatibility = JavaVersion.VERSION_21
89+
}
90+
91+
tasks.withType<Jar> {
92+
from("LICENSE") {
93+
rename { "${it}_${project.base.archivesName.get()}" }
94+
}
95+
}
96+
97+
// configure the maven publication
98+
publishing {
99+
publications {
100+
create<MavenPublication>("mavenJava") {
101+
groupId = project.group.toString()
102+
artifactId = base.archivesName.get()
103+
version = project.version.toString()
104+
from(components["java"])
105+
}
106+
}
107+
108+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
109+
repositories {
110+
// Add repositories to publish to here.
111+
// Notice: This block does NOT have the same function as the block in the top level.
112+
// The repositories here will be used for publishing your artifact, not for
113+
// retrieving dependencies.
114+
}
115+
}

gradle.properties

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Done to increase the memory available to gradle.
2+
org.gradle.jvmargs=-Xmx1G
3+
org.gradle.parallel=true
4+
5+
# Fabric Properties
6+
# check these on https://fabricmc.net/develop
7+
minecraft_version=1.21.1
8+
yarn_mappings=1.21.1+build.3
9+
loader_version=0.16.7
10+
fabric_kotlin_version=1.12.3+kotlin.2.0.21
11+
12+
# Mod Properties
13+
mod_version=1.0.0
14+
maven_group=xd.arkosammy
15+
archives_base_name=compsmp-discord-bot
16+
17+
# Dependencies
18+
fabric_version=0.106.0+1.21.1
19+
20+
# Monkey Config
21+
monkey_config_version=0.1.2+1.21

gradle/libs.versions.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[versions]
2+
kotlin = "2.0.21" # Kotlin version must be updated in build.gradle.kts too
3+
4+
kord-extensions = "2.2.1-SNAPSHOT"
5+
slf4j = "2.0.9"
6+
7+
[libraries]
8+
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" }
9+
10+
slf4j = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }

gradle/wrapper/gradle-wrapper.jar

42.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)