11plugins {
2- id ' fabric-loom' version ' 0.7-SNAPSHOT'
3- id ' maven-publish'
2+ id ' fabric-loom' version ' 0.7-SNAPSHOT'
3+ id ' maven-publish'
44}
55
66sourceCompatibility = JavaVersion . VERSION_1_8
@@ -11,84 +11,85 @@ version = 'v' + project.mod_version + '-' + new Date().format('yyMMdd')
1111group = project. maven_group
1212
1313repositories {
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.
19- maven {
20- url " https://www.cursemaven.com"
21- }
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.
19+ maven {
20+ url " https://www.cursemaven.com"
21+ }
2222}
2323
2424dependencies {
25- // To change the versions see the gradle.properties file
26- minecraft " com.mojang:minecraft:${ project.minecraft_version} "
27- mappings " net.fabricmc:yarn:${ project.yarn_mappings} :v2"
28- modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
25+ // To change the versions see the gradle.properties file
26+ minecraft " com.mojang:minecraft:${ project.minecraft_version} "
27+ mappings " net.fabricmc:yarn:${ project.yarn_mappings} :v2"
28+ modImplementation " net.fabricmc:fabric-loader:${ project.loader_version} "
29+ modImplementation " net.fabricmc.fabric-api:fabric-api:${ project.fabric_version} "
2930
30- modImplementation(" curse.maven:carpet-349239:${ project.carpet_core_version} " )
31+ modImplementation(" curse.maven:carpet-349239:${ project.carpet_core_version} " )
3132
32- // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
33- // You may need to force-disable transitiveness on them.
33+ // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
34+ // You may need to force-disable transitiveness on them.
3435}
3536
3637processResources {
37- inputs. property " version" , project. version
38+ inputs. property " version" , project. version
3839
39- filesMatching(" fabric.mod.json" ) {
40- expand " version" : project. version
41- }
40+ filesMatching(" fabric.mod.json" ) {
41+ expand " version" : project. version
42+ }
4243}
4344
4445tasks. withType(JavaCompile ). configureEach {
45- // ensure that the encoding is set to UTF-8, no matter what the system default is
46- // this fixes some edge cases with special characters not displaying correctly
47- // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
48- // If Javadoc is generated, this must be specified in that task too.
49- it. options. encoding = " UTF-8"
46+ // ensure that the encoding is set to UTF-8, no matter what the system default is
47+ // this fixes some edge cases with special characters not displaying correctly
48+ // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
49+ // If Javadoc is generated, this must be specified in that task too.
50+ it. options. encoding = " UTF-8"
5051
51- // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
52- // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
53- // We'll use that if it's available, but otherwise we'll use the older option.
54- def targetVersion = 8
55- if (JavaVersion . current(). isJava9Compatible()) {
56- it. options. release = targetVersion
57- }
52+ // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
53+ // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
54+ // We'll use that if it's available, but otherwise we'll use the older option.
55+ def targetVersion = 8
56+ if (JavaVersion . current(). isJava9Compatible()) {
57+ it. options. release = targetVersion
58+ }
5859}
5960
6061java {
61- // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
62- // if it is present.
63- // If you remove this line, sources will not be generated.
64- withSourcesJar()
62+ // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
63+ // if it is present.
64+ // If you remove this line, sources will not be generated.
65+ withSourcesJar()
6566}
6667
6768jar {
68- from(" LICENSE" ) {
69- rename { " ${ it} _${ project.archivesBaseName} " }
70- }
69+ from(" LICENSE" ) {
70+ rename { " ${ it} _${ project.archivesBaseName} " }
71+ }
7172}
7273
7374// configure the maven publication
7475publishing {
75- publications {
76- mavenJava(MavenPublication ) {
77- // add all the jars that should be included when publishing to maven
78- artifact(remapJar) {
79- builtBy remapJar
80- }
81- artifact(sourcesJar) {
82- builtBy remapSourcesJar
83- }
84- }
85- }
76+ publications {
77+ mavenJava(MavenPublication ) {
78+ // add all the jars that should be included when publishing to maven
79+ artifact(remapJar) {
80+ builtBy remapJar
81+ }
82+ artifact(sourcesJar) {
83+ builtBy remapSourcesJar
84+ }
85+ }
86+ }
8687
87- // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
88- repositories {
89- // Add repositories to publish to here.
90- // Notice: This block does NOT have the same function as the block in the top level.
91- // The repositories here will be used for publishing your artifact, not for
92- // retrieving dependencies.
93- }
88+ // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
89+ repositories {
90+ // Add repositories to publish to here.
91+ // Notice: This block does NOT have the same function as the block in the top level.
92+ // The repositories here will be used for publishing your artifact, not for
93+ // retrieving dependencies.
94+ }
9495}
0 commit comments