fixed shadowjar issues

This commit is contained in:
Jonas_Jones 2024-05-09 21:59:59 +02:00
parent 4656202e11
commit 3be35808b6

View file

@ -24,17 +24,18 @@ repositories {
loom { loom {
splitEnvironmentSourceSets() splitEnvironmentSourceSets()
mods { mods {
"modid" { "modid" {
sourceSet sourceSets.main sourceSet sourceSets.main
sourceSet sourceSets.client sourceSet sourceSets.client
} }
} }
} }
dependencies { dependencies {
compileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
// To change the versions see the gradle.properties file // To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
@ -43,14 +44,10 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
compileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
implementation('net.dv8tion:JDA:5.0.0-beta.17') { implementation('net.dv8tion:JDA:5.0.0-beta.17') {
exclude module: 'opus-java' exclude module: 'opus-java'
} }
shadow 'net.dv8tion:JDA:5.0.0-beta.17' shadow 'net.dv8tion:JDA:5.0.0-beta.17'
} }
tasks.withType(ShadowJar).configureEach { tasks.withType(ShadowJar).configureEach {
@ -63,21 +60,19 @@ tasks.withType(ShadowJar).configureEach {
remapJar { remapJar {
from('LICENSE') // Include license from('LICENSE') // Include license
inputFile.set shadowJar.archiveFile inputFile.set shadowJar.archiveFile
dependsOn shadowJar dependsOn shadowJar
} }
processResources { processResources {
inputs.property "version", project.version inputs.property "version", project.version
filesMatching("fabric.mod.json") { filesMatching("fabric.mod.json") {
expand "version": project.version expand "version": project.version
} }
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
it.options.release = 21 it.options.release = 17
} }
java { java {
@ -85,9 +80,8 @@ java {
// if it is present. // if it is present.
// If you remove this line, sources will not be generated. // If you remove this line, sources will not be generated.
withSourcesJar() withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_21
} }
jar { jar {
@ -99,12 +93,10 @@ jar {
// configure the maven publication // configure the maven publication
publishing { publishing {
publications { publications {
create("mavenJava", MavenPublication) { mavenJava(MavenPublication) {
artifactId = project.archives_base_name
from components.java from components.java
} }
} }
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories { repositories {
// Add repositories to publish to here. // Add repositories to publish to here.