Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7a152e1
Refactor: Buildscripts
emyfops Mar 9, 2024
dbaadbc
Fix: Absolute flatdir path
emyfops Mar 9, 2024
737e291
Refactor: Don't include the jars
emyfops Mar 9, 2024
6899b7b
Refactor: Misinput
emyfops Mar 9, 2024
689ad83
Feature: 1.20.+ version
emyfops Mar 9, 2024
688ecd4
Fix: Mixin mod conflict
emyfops Mar 9, 2024
ca8b3b4
Feature: Forge 1.19.3 to 1.20.x
emyfops Mar 9, 2024
a8faff8
Removed maven name
emyfops Mar 9, 2024
dcaa53c
Global val instead of absolute path
emyfops Mar 9, 2024
15d75b6
Fix: Forge dev KFF
emyfops Mar 10, 2024
aef495c
Fix: misinput
emyfops Mar 10, 2024
8763aa7
Fix: Crash on forge dev env
emyfops Mar 10, 2024
45ca80e
Feature: NeoForge modloader
emyfops Mar 10, 2024
af8c6a1
Refactor: Change module name to com.lambda.common
emyfops Mar 10, 2024
492a315
Fix: Forge dev env
emyfops Mar 10, 2024
60a6551
Revert "Refactor: Change module name to com.lambda.common"
emyfops Mar 10, 2024
783a9ee
Removed comment
emyfops Mar 10, 2024
54c5cd4
Merge branch 'master' into refactor/buildscript
emyfops Mar 10, 2024
35305c7
Fix: Crash at launch
emyfops Mar 10, 2024
ee2da65
Fix: Fabric
emyfops Mar 10, 2024
5b69414
Removed bundle
emyfops Mar 10, 2024
3e0950c
Fix: NeoForge
emyfops Mar 10, 2024
63debfb
Avoid including mod jar in fabric
emyfops Mar 10, 2024
b946660
Removed log entrypoints
emyfops Mar 10, 2024
2c7754b
Fix: Forge
emyfops Mar 10, 2024
b152805
Fix: Missing mods forge env
emyfops Mar 10, 2024
4ea2c83
Small changes
Avanatiker Mar 11, 2024
26422a6
Fix: Forge dev and prod
emyfops Mar 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.fabricmc.loom.task.RemapJarTask

val modId = project.properties["mod_id"].toString()
val modVersion = project.properties["mod_version"].toString()
val mavenGroup = project.properties["maven_group"].toString()
val minecraftVersion = project.properties["minecraft_version"].toString()
val yarnMappings = project.properties["yarn_mappings"].toString()
val modId = property("mod_id").toString()
val modVersion = property("mod_version").toString()
val mavenGroup = property("maven_group").toString()
val minecraftVersion = property("minecraft_version").toString()
val yarnMappings = property("yarn_mappings").toString()

plugins {
kotlin("jvm") version ("1.9.22")
Expand All @@ -22,6 +22,7 @@ architectury {
subprojects {
apply(plugin = "dev.architectury.loom")
apply(plugin = "org.jetbrains.dokka")

dependencies {
"minecraft"("com.mojang:minecraft:$minecraftVersion")
"mappings"("net.fabricmc:yarn:$yarnMappings:v2")
Expand Down Expand Up @@ -64,21 +65,21 @@ allprojects {
version = modVersion

repositories {
maven("https://impactdevelopment.github.io/maven/") { name = "ImpactDev" }
maven("https://api.modrinth.com/maven")
maven("https://jitpack.io")
maven("https://maven.shedaniel.me/") {
name = "Architectury"
}
maven("https://maven.shedaniel.me/") { name = "Architectury" }
maven("https://maven.terraformersmc.com/releases/")
}

tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
options.release = 17
}
compileKotlin {
kotlinOptions.jvmTarget = "17"
flatDir {
dirs("libs") // TODO: Absolute path
}
}

java {
// withSourcesJar() // Uncomment this line when the plugin system is ready

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
16 changes: 10 additions & 6 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
val fabricLoaderVersion = project.properties["fabric_loader_version"].toString()
val fabricKotlinVersion = project.properties["fabric_kotlin_version"].toString()
val mixinExtrasVersion = project.properties["mixinextras_version"].toString()
val fabricLoaderVersion = property("fabric_loader_version").toString()
val fabricKotlinVersion = property("fabric_kotlin_version").toString()
val mixinExtrasVersion = property("mixinextras_version").toString()
val kotlinXCoroutineVersion = property("kotlinx_coroutines_version").toString()

architectury { common("fabric", "forge") }

Expand All @@ -9,10 +10,9 @@ loom {
}

repositories {
maven("https://maven.fabricmc.net/") {
name = "Fabric"
}
maven("https://maven.fabricmc.net/") { name = "Fabric" }
maven("https://jitpack.io")

mavenCentral()
mavenLocal()
}
Expand All @@ -21,11 +21,15 @@ dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion")

// Add dependencies on the required Kotlin modules.
modImplementation("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion")
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:$mixinExtrasVersion")!!)

// Baritone
}

// Avoid nested jars
tasks.named("remapJar") {
enabled = false
}
Expand Down
45 changes: 34 additions & 11 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
val fabricLoaderVersion = project.properties["fabric_loader_version"].toString()
val fabricApiVersion = project.properties["fabric_api_version"].toString()
val fabricKotlinVersion = project.properties["fabric_kotlin_version"].toString()
val fabricLoaderVersion = property("fabric_loader_version").toString()
val fabricApiVersion = property("fabric_api_version").toString()
val fabricKotlinVersion = property("fabric_kotlin_version").toString()

architectury {
platformSetupLoomIde()
Expand All @@ -20,16 +20,39 @@ val common: Configuration by configurations.creating {
configurations["developmentFabric"].extendsFrom(this)
}

dependencies {
common(project(":common", configuration = "namedElements")) {
isTransitive = false
val includeLib: Configuration by configurations.creating
val includeMod: Configuration by configurations.creating

fun DependencyHandlerScope.setupConfigurations() {
includeLib.dependencies.forEach {
implementation(it)
include(it)
}
shadowCommon(project(path = ":common", configuration = "transformProductionFabric")) {
isTransitive = false

includeMod.dependencies.forEach {
modImplementation(it)
include(it)
}
modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion")
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
modImplementation("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion")
}

dependencies {
// Fabric API
includeMod("net.fabricmc:fabric-loader:$fabricLoaderVersion")
includeMod("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")
includeMod("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion")

// Add dependencies on the required Kotlin modules.
// includeLib(...)

// Add mods to the mod jar
// includeMod(...)

// Common (Do not touch)
common(project(":common", configuration = "namedElements")) { isTransitive = false }
shadowCommon(project(path = ":common", configuration = "transformProductionFabric")) { isTransitive = false }

// Finish the configuration
setupConfigurations()
}

tasks {
Expand Down
46 changes: 34 additions & 12 deletions forge/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
val forgeVersion = project.properties["forge_version"].toString()
val kotlinForgeVersion = project.properties["kotlin_forge_version"].toString()
val mixinExtrasVersion = project.properties["mixinextras_version"].toString()
val forgeVersion = property("forge_version").toString()
val kotlinForgeVersion = property("kotlin_forge_version").toString()
val mixinExtrasVersion = property("mixinextras_version").toString()

architectury {
platformSetupLoomIde()
Expand Down Expand Up @@ -33,17 +33,39 @@ val common: Configuration by configurations.creating {
configurations["developmentForge"].extendsFrom(this)
}

dependencies {
forge("net.minecraftforge:forge:$forgeVersion")
implementation("thedarkcolour:kotlinforforge:$kotlinForgeVersion")
common(project(":common", configuration = "namedElements")) {
isTransitive = false
val includeLib: Configuration by configurations.creating
val includeMod: Configuration by configurations.creating

fun DependencyHandlerScope.setupConfigurations() {
includeLib.dependencies.forEach {
implementation(it)
include(it)
}
shadowCommon(project(path = ":common", configuration = "transformProductionForge")) {
isTransitive = false

includeMod.dependencies.forEach {
modImplementation(it)
include(it)
}
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:$mixinExtrasVersion")!!)
implementation(include("io.github.llamalad7:mixinextras-forge:$mixinExtrasVersion")!!)
}

dependencies {
// Forge API
forge("net.minecraftforge:forge:$forgeVersion")

// Add dependencies on the required Kotlin modules.
includeLib("thedarkcolour:kotlinforforge:$kotlinForgeVersion")
includeLib(annotationProcessor("io.github.llamalad7:mixinextras-common:$mixinExtrasVersion")!!)
includeLib("io.github.llamalad7:mixinextras-forge:$mixinExtrasVersion")

// Add mods to the mod jar
// includeMod(...)

// Common (Do not touch)
common(project(":common", configuration = "namedElements")) { isTransitive = false }
shadowCommon(project(path = ":common", configuration = "transformProductionForge")) { isTransitive = false }

// Finish the configuration
setupConfigurations()
}

tasks {
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ maven_group=com.lambda
# General
minecraft_version=1.20.4
mixinextras_version=0.3.5
kotlinx_coroutines_version=1.8.0

# Architectury https://docs.architectury.dev/start
enabled_platforms=fabric,forge
Expand All @@ -26,4 +27,4 @@ kotlin.code.style=official

# Gradle https://gradle.org/
org.gradle.jvmargs=-Xmx2048M
org.gradle.parallel=true4
org.gradle.parallel=true4