11plugins {
2- id ' fabric-loom' version ' 0 .10.3 '
2+ id ' fabric-loom' version ' 1 .10-SNAPSHOT '
33 id ' maven-publish'
44}
55
6- sourceCompatibility = JavaVersion . VERSION_16
7- targetCompatibility = JavaVersion . VERSION_16
8-
9- archivesBaseName = project. archives_base_name
106version = project. mod_version
117group = project. maven_group
128
13- repositories {
14- // Add repositories to retrieve artifacts from in here.
15- // You should only use this when depending on other mods because
16- // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
17- // See https://docs.gradle.org/current/userguide/declaring_repositories.html
18- // for more information about repositories.
9+ base {
10+ archivesName = project. archives_base_name
11+ }
12+
13+ loom {
14+ splitEnvironmentSourceSets()
15+
16+ mods {
17+ " fidelity" {
18+ sourceSet sourceSets. main
19+ sourceSet sourceSets. client
20+ }
21+ }
22+
23+ }
24+
25+ sourceSets {
26+ main {
27+ java. srcDirs = [' src/main/java' ]
28+ resources. srcDirs = [' src/main/resources' ]
29+ }
30+ client {
31+ java. srcDirs = [' src/client/java' ]
32+ resources. srcDirs = [' src/client/resources' ]
33+ }
1934}
2035
2136dependencies {
22- // To change the versions see the gradle.properties file
2337 minecraft " com.mojang:minecraft:${ project.minecraft_version} "
2438 mappings " net.fabricmc:yarn:${ project.yarn_mappings} :v2"
2539 modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
2640
27- // Fabric API. This is technically optional, but you probably want it anyway.
2841 modImplementation " net.fabricmc.fabric-api:fabric-api:${ project.fabric_version} "
2942
30- // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
31- // You may need to force-disable transitiveness on them.
3243}
3344
3445processResources {
3546 inputs. property " version" , project. version
3647
3748 filesMatching(" fabric.mod.json" ) {
38- expand " version" : project . version
49+ expand " version" : inputs . properties . version
3950 }
4051}
4152
4253tasks. withType(JavaCompile ). configureEach {
43- // ensure that the encoding is set to UTF-8, no matter what the system default is
44- // this fixes some edge cases with special characters not displaying correctly
45- // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
46- // If Javadoc is generated, this must be specified in that task too.
47- it. options. encoding = " UTF-8"
48-
49- // Minecraft 1.17 (21w19a) upwards uses Java 16.
50- it. options. release = 16
54+ it. options. release = 17
5155}
5256
5357java {
54- // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
55- // if it is present.
56- // If you remove this line, sources will not be generated.
5758 withSourcesJar()
59+
60+ sourceCompatibility = JavaVersion . VERSION_17
61+ targetCompatibility = JavaVersion . VERSION_17
5862}
5963
6064jar {
65+ inputs. property " archivesName" , project. base. archivesName
66+
6167 from(" LICENSE" ) {
62- rename { " ${ it} _${ project.archivesBaseName } " }
68+ rename { " ${ it} _${ inputs.properties.archivesName } " }
6369 }
6470}
6571
6672// configure the maven publication
6773publishing {
6874 publications {
69- mavenJava(MavenPublication ) {
70- // add all the jars that should be included when publishing to maven
71- artifact(remapJar) {
72- builtBy remapJar
73- }
74- artifact(sourcesJar) {
75- builtBy remapSourcesJar
76- }
75+ create(" mavenJava" , MavenPublication ) {
76+ artifactId = project. archives_base_name
77+ from components. java
7778 }
7879 }
79-
80- // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
81- repositories {
82- // Add repositories to publish to here.
83- // Notice: This block does NOT have the same function as the block in the top level.
84- // The repositories here will be used for publishing your artifact, not for
85- // retrieving dependencies.
86- }
8780}
0 commit comments