Working Release
This commit is contained in:
120
build.gradle
120
build.gradle
@@ -1,115 +1,101 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version "${loom_version}"
|
||||
id 'maven-publish'
|
||||
id "org.jetbrains.kotlin.jvm" version "2.1.20"
|
||||
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
|
||||
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'
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
splitEnvironmentSourceSets()
|
||||
|
||||
mods {
|
||||
"cobblesync" {
|
||||
sourceSet sourceSets.main
|
||||
sourceSet sourceSets.client
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fabricApi {
|
||||
configureDataGeneration {
|
||||
client = true
|
||||
}
|
||||
configureDataGeneration {
|
||||
client = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// To change the versions see the gradle.properties file
|
||||
// Minecraft & Fabric Loader
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings loom.officialMojangMappings()
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
|
||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||
// 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.6.0+1.21.1-SNAPSHOT"
|
||||
|
||||
// JSON and GSON dependencies - add implementation first, then include
|
||||
implementation "org.json:json:20231013"
|
||||
include "org.json:json:20231013"
|
||||
|
||||
implementation "com.google.code.gson:gson:2.10.1"
|
||||
implementation "org.json:json:20231013" // Or the latest version
|
||||
include "com.google.code.gson:gson:2.10.1"
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
inputs.property "version", project.version
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": inputs.properties.version
|
||||
}
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": inputs.properties.version
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
it.options.release = 21
|
||||
it.options.release = 21
|
||||
}
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||
kotlinOptions {
|
||||
jvmTarget = 21
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "21" // Ensure jvmTarget is a string
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||
// if it is present.
|
||||
// If you remove this line, sources will not be generated.
|
||||
withSourcesJar()
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
withSourcesJar()
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
jar {
|
||||
inputs.property "archivesName", project.base.archivesName
|
||||
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${inputs.properties.archivesName}"}
|
||||
}
|
||||
inputs.property "archivesName", project.base.archivesName
|
||||
from("LICENSE") {
|
||||
rename { "${it}_${inputs.properties.archivesName}"}
|
||||
}
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
create("mavenJava", MavenPublication) {
|
||||
artifactId = project.archives_base_name
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
|
||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
||||
repositories {
|
||||
// Add repositories to publish to here.
|
||||
// Notice: This block does NOT have the same function as the block in the top level.
|
||||
// The repositories here will be used for publishing your artifact, not for
|
||||
// retrieving dependencies.
|
||||
}
|
||||
}
|
||||
publications {
|
||||
create("mavenJava", MavenPublication) {
|
||||
artifactId = project.archives_base_name
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
// Add your publishing repositories here
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user