|
1 | 1 | plugins {
|
2 |
| - id 'fabric-loom' version '0.6-SNAPSHOT' |
3 |
| - id 'maven-publish' |
| 2 | + id 'fabric-loom' version '0.10-SNAPSHOT' |
| 3 | + id 'maven-publish' |
4 | 4 | }
|
5 | 5 |
|
6 |
| -sourceCompatibility = JavaVersion.VERSION_1_8 |
7 |
| -targetCompatibility = JavaVersion.VERSION_1_8 |
| 6 | +sourceCompatibility = JavaVersion.VERSION_17 |
| 7 | +targetCompatibility = JavaVersion.VERSION_17 |
8 | 8 |
|
9 | 9 | archivesBaseName = project.archives_base_name
|
10 | 10 | version = project.minecraft_version+'-'+project.mod_version // thanks carpet
|
11 | 11 | group = project.maven_group
|
12 | 12 |
|
13 | 13 | repositories {
|
14 |
| - maven { |
15 |
| - url = "https://www.cursemaven.com" |
16 |
| - } |
| 14 | + maven { |
| 15 | + url = "https://www.cursemaven.com" |
| 16 | + } |
17 | 17 | }
|
18 | 18 |
|
19 | 19 | dependencies {
|
20 |
| - // To change the versions see the gradle.properties file |
21 |
| - minecraft "com.mojang:minecraft:${project.minecraft_version}" |
22 |
| - mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" |
23 |
| - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" |
| 20 | + // To change the versions see the gradle.properties file |
| 21 | + minecraft "com.mojang:minecraft:${project.minecraft_version}" |
| 22 | + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" |
| 23 | + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" |
24 | 24 |
|
25 |
| - modImplementation "curse.maven:litematica-${project.litematica_minecraft_version}-308892:${project.litematica_fileid}" |
26 |
| - modImplementation "curse.maven:malilib-${project.litematica_minecraft_version}-303119:${project.malilib_fileid}" |
| 25 | + modImplementation "curse.maven:litematica-${project.litematica_minecraft_version}-308892:${project.litematica_fileid}" |
| 26 | + modImplementation "curse.maven:malilib-${project.litematica_minecraft_version}-303119:${project.malilib_fileid}" |
27 | 27 |
|
28 |
| - modImplementation "net.fabricmc.fabric-api:fabric-resource-loader-v0:${project.fabric_resource_loader_version}" |
29 |
| - // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. |
30 |
| - // You may need to force-disable transitiveness on them. |
| 28 | + modImplementation "net.fabricmc.fabric-api:fabric-resource-loader-v0:${project.fabric_resource_loader_version}" |
31 | 29 | }
|
32 | 30 |
|
33 | 31 | processResources {
|
34 |
| - inputs.property "version", project.version |
| 32 | + inputs.property "version", project.version |
35 | 33 |
|
36 |
| - filesMatching("fabric.mod.json") { |
37 |
| - expand "version": project.version |
38 |
| - } |
| 34 | + filesMatching("fabric.mod.json") { |
| 35 | + expand "version": project.version |
| 36 | + } |
39 | 37 | }
|
40 | 38 |
|
41 | 39 | tasks.withType(JavaCompile).configureEach {
|
42 |
| - // ensure that the encoding is set to UTF-8, no matter what the system default is |
43 |
| - // this fixes some edge cases with special characters not displaying correctly |
44 |
| - // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html |
45 |
| - // If Javadoc is generated, this must be specified in that task too. |
46 |
| - it.options.encoding = "UTF-8" |
47 |
| - |
48 |
| - // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too |
49 |
| - // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. |
50 |
| - // We'll use that if it's available, but otherwise we'll use the older option. |
51 |
| - def targetVersion = 8 |
52 |
| - if (JavaVersion.current().isJava9Compatible()) { |
53 |
| - it.options.release = targetVersion |
54 |
| - } |
| 40 | + // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. |
| 41 | + it.options.release = 17 |
55 | 42 | }
|
56 | 43 |
|
57 | 44 | java {
|
58 |
| - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
59 |
| - // if it is present. |
60 |
| - // If you remove this line, sources will not be generated. |
61 |
| - withSourcesJar() |
| 45 | + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
| 46 | + // if it is present. |
| 47 | + // If you remove this line, sources will not be generated. |
| 48 | + withSourcesJar() |
62 | 49 | }
|
63 | 50 |
|
64 | 51 | jar {
|
65 |
| - from("LICENSE") { |
66 |
| - rename { "${it}_${project.archivesBaseName}" } |
67 |
| - } |
| 52 | + from("LICENSE") { |
| 53 | + rename { "${it}_${project.archivesBaseName}"} |
| 54 | + } |
68 | 55 | }
|
69 | 56 |
|
70 | 57 | // configure the maven publication
|
71 | 58 | publishing {
|
72 |
| - publications { |
73 |
| - mavenJava(MavenPublication) { |
74 |
| - // add all the jars that should be included when publishing to maven |
75 |
| - artifact(remapJar) { |
76 |
| - builtBy remapJar |
77 |
| - } |
78 |
| - artifact(sourcesJar) { |
79 |
| - builtBy remapSourcesJar |
80 |
| - } |
81 |
| - } |
82 |
| - } |
| 59 | + publications { |
| 60 | + mavenJava(MavenPublication) { |
| 61 | + from components.java |
| 62 | + } |
| 63 | + } |
83 | 64 |
|
84 |
| - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. |
85 |
| - repositories { |
86 |
| - // Add repositories to publish to here. |
87 |
| - // Notice: This block does NOT have the same function as the block in the top level. |
88 |
| - // The repositories here will be used for publishing your artifact, not for |
89 |
| - // retrieving dependencies. |
90 |
| - } |
| 65 | + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. |
| 66 | + repositories { |
| 67 | + // Add repositories to publish to here. |
| 68 | + // Notice: This block does NOT have the same function as the block in the top level. |
| 69 | + // The repositories here will be used for publishing your artifact, not for |
| 70 | + // retrieving dependencies. |
| 71 | + } |
91 | 72 | }
|
0 commit comments