102 lines
2.6 KiB
Groovy
102 lines
2.6 KiB
Groovy
plugins {
|
|
id 'fabric-loom' version "${loom_version}"
|
|
id 'maven-publish'
|
|
id "org.jetbrains.kotlin.jvm" version "2.1.20" // Ensure your kotlin_version in gradle.properties matches or is compatible
|
|
}
|
|
|
|
version = project.mod_version
|
|
group = project.maven_group
|
|
|
|
base {
|
|
archivesName = project.archives_base_name
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
|
|
maven { url 'https://maven.impactdev.net/repository/development/' }
|
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
|
|
}
|
|
|
|
loom {
|
|
splitEnvironmentSourceSets()
|
|
|
|
mods {
|
|
"cobblesync" {
|
|
sourceSet sourceSets.main
|
|
sourceSet sourceSets.client
|
|
}
|
|
}
|
|
}
|
|
|
|
fabricApi {
|
|
configureDataGeneration {
|
|
client = true
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Minecraft & Fabric Loader
|
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
|
mappings loom.officialMojangMappings()
|
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
|
|
|
// Fabric API
|
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
|
// Fabric Kotlin Language Adapter
|
|
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
|
|
|
|
// Other Mod Dependencies (e.g., Cobblemon)
|
|
modImplementation "com.cobblemon:fabric:1.7.2+1.21.1-SNAPSHOT"
|
|
|
|
// JSON and GSON dependencies - add implementation first, then include
|
|
implementation "org.json:json:20250517"
|
|
include "org.json:json:20250517"
|
|
|
|
implementation "com.google.code.gson:gson:2.13.2"
|
|
include "com.google.code.gson:gson:2.13.2"
|
|
}
|
|
|
|
processResources {
|
|
inputs.property "version", project.version
|
|
|
|
filesMatching("fabric.mod.json") {
|
|
expand "version": inputs.properties.version
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
it.options.release = 21
|
|
}
|
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
|
kotlinOptions {
|
|
jvmTarget = "21" // Ensure jvmTarget is a string
|
|
}
|
|
}
|
|
|
|
java {
|
|
withSourcesJar()
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
targetCompatibility = JavaVersion.VERSION_21
|
|
}
|
|
|
|
jar {
|
|
inputs.property "archivesName", project.base.archivesName
|
|
from("LICENSE") {
|
|
rename { "${it}_${inputs.properties.archivesName}"}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
create("mavenJava", MavenPublication) {
|
|
artifactId = project.archives_base_name
|
|
from components.java
|
|
}
|
|
}
|
|
repositories {
|
|
// Add your publishing repositories here
|
|
}
|
|
}
|