Skip to content

Commit

Permalink
yes
Browse files Browse the repository at this point in the history
  • Loading branch information
RawDiamondMC committed Jul 28, 2024
1 parent 117fb7d commit c37ce66
Show file tree
Hide file tree
Showing 14 changed files with 727 additions and 668 deletions.
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

.idea
827 changes: 159 additions & 668 deletions LICENSE

Large diffs are not rendered by default.

104 changes: 104 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.plugins.ide.idea.model.IdeaModel

plugins {
id("architectury-plugin") version "3.4-SNAPSHOT"
id("dev.architectury.loom") version "1.7-SNAPSHOT" apply false
}

allprojects {
group = "band.kessokuteatime.kessokulib"
apply<IdeaPlugin>()
apply<JavaLibraryPlugin>()

repositories {
maven {
name = "NeoForged"
url = uri("https://maven.neoforged.net/releases")
}
maven {
name = "Architectury"
url = uri("https://maven.architectury.dev/")
}
}

configure<IdeaModel> {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = JavaVersion.VERSION_21.toString()
targetCompatibility = JavaVersion.VERSION_21.toString()
}

tasks.withType<ProcessResources> {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand(mutableMapOf("version" to project.version))
}
filesMatching("META-INF/neoforge.mods.toml") {
expand(mutableMapOf("version" to project.version))
}
}
}


fun getNeoModules(): List<Project> {
return subprojects.filter {
it.name.contains("neo") && it != project(":neo")
}
}

extra["getNeoModules"] = { getNeoModules() }

fun getFabricModules(): List<Project> {
return subprojects.filter {
it.name.contains("fabric") && it != project(":fabric")
}
}

extra["getFabricModules"] = { getFabricModules() }

subprojects {
apply(plugin = "dev.architectury.loom")
apply<BasePlugin>()
if (!project.parent?.name.equals("kessoku-lib")) {
apply("architectury-plugin")
}
extensions.extraProperties["getNeoModules"] = { getNeoModules() }
extensions.getByType(BasePluginExtension::class.java).archivesName.set(rootProject.name)
version =
rootProject.libs.versions.mod.get() + "+" + (if (project.name == "neo") "neoforge" else project.name) + "." + rootProject.libs.versions.minecraft.get()
dependencies {
val loom = project.extensions.getByType<LoomGradleExtensionAPI>()
"minecraft"(rootProject.libs.minecraft)
"mappings"(
loom.layered {
variantOf(rootProject.libs.yarn) { classifier("v2") }
rootProject.libs.yarn.patch
}
)
}
}

val buildModules = tasks.register("buildModules") {
subprojects.forEach { p ->
if (p.name != "neo" && p.name != "fabric" && p.name != "common") {
val buildTask = p.tasks.getByName("build")
buildTask.actions.forEach { it.execute(buildTask) }
}
}
}

val bundleModules = tasks.register("bundleModules") {
val neoBuild = project(":neo").tasks.getByName("build")
neoBuild.actions.forEach { it.execute(neoBuild) }
val fabBuild = project(":fabric").tasks.getByName("build")
fabBuild.actions.forEach { it.execute(fabBuild) }
}

tasks.getByName("bundleModules").dependsOn(buildModules.name)
tasks.getByName("build").dependsOn(buildModules.name)
5 changes: 5 additions & 0 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies {
(rootProject.extra["getFabricModules"] as () -> List<Project>)().forEach {
include(it)
}
}
21 changes: 21 additions & 0 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"schemaVersion": 1,
"id": "kessokulib",
"version": "${version}",
"name": "Kessoku Lib",
"description": "This is an example description! Tell everyone what your mod is about!",
"authors": [
"Kessoku Tea Time"
],
"contact": {
"homepage": "https://github.com/KessokuTeaTime/KessokuLib",
"sources": "https://github.com/KessokuTeaTime/KessokuLib",
"issues": "https://github.com/KessokuTeaTime/KessokuLib/issues"
},
"license": "LGPL-3.0-only",
"icon": "assets/kessokulib/icon.png",
"environment": "*",
"depends": {
"minecraft": ">=1.21- <1.21.1-"
}
}
18 changes: 18 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[versions]
mod = "0.1.0"
minecraft = "1.21"
yarn = "1.21+build.9"
yarn-mappings-patch-neoforge = "1.21+build.4"
neo = "21.0.139-beta"
fabric-loader = "0.16.0"

fabric-api = "0.100.7+1.21"
architectury-api = "13.0.6"
[libraries]
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
yarn = { group = "net.fabricmc", name = "yarn", version.ref = "yarn" }
yarn-patch = { group = "dev.architectury", name = "yarn-mappings-patch-neoforge", version.ref = "yarn-mappings-patch-neoforge" }

neo = { group = "net.neoforged", name = "neoforge", version.ref = "neo" }
fabric-loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric-loader" }
fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric-api" }
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c37ce66

Please sign in to comment.