diff options
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/build.gradle b/build.gradle index c0682ed..4a0f807 100644 --- a/build.gradle +++ b/build.gradle @@ -4,19 +4,19 @@ plugins { id "org.jetbrains.kotlin.jvm" } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group -minecraft { -} - - repositories { - maven { url = "http://maven.fabricmc.net/" } + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. } dependencies { @@ -37,46 +37,46 @@ dependencies { processResources { inputs.property "version", project.version - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" + filesMatching("fabric.mod.json") { expand "version": project.version } - - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } } // ensure that the encoding is set to UTF-8, no matter what the system default is // this fixes some edge cases with special characters not displaying correctly // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html tasks.withType(JavaCompile) { - options.encoding = "UTF-8" + it.options.encoding = "UTF-8" + + // Minecraft 1.18.1 upwards uses Java 17. + it.options.release = 17 } -// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task -// if it is present. -// If you remove this task, sources will not be generated. -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource +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() } jar { - from "LICENSE" + from ("LICENSE") { + rename { "${it}_${project.archivesBaseName}"} + } } // configure the maven publication publishing { publications { mavenJava(MavenPublication) { + from components.java // add all the jars that should be included when publishing to maven - artifact(remapJar) { - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } +// artifact(remapJar) { +// builtBy remapJar +// } +// artifact(sourcesJar) { +// builtBy remapSourcesJar +// } } } @@ -87,4 +87,4 @@ publishing { } } -compileKotlin.kotlinOptions.jvmTarget = "1.8" \ No newline at end of file +compileKotlin.kotlinOptions.jvmTarget = "17" |