|
1 | 1 | plugins { |
2 | | - id 'fabric-loom' version '1.2-SNAPSHOT' |
3 | | - id 'maven-publish' |
| 2 | + id 'fabric-loom' version '1.2-SNAPSHOT' |
4 | 3 | } |
5 | 4 |
|
6 | | -version = project.mod_version |
7 | | -group = project.maven_group |
| 5 | +version = project.simpleclient_version |
| 6 | +group = "simpleclient" |
8 | 7 |
|
9 | 8 | repositories { |
10 | | - // Add repositories to retrieve artifacts from in here. |
11 | | - // You should only use this when depending on other mods because |
12 | | - // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. |
13 | | - // See https://docs.gradle.org/current/userguide/declaring_repositories.html |
14 | | - // for more information about repositories. |
15 | 9 | } |
16 | 10 |
|
17 | 11 | dependencies { |
18 | | - // To change the versions see the gradle.properties file |
19 | | - minecraft "com.mojang:minecraft:${project.minecraft_version}" |
20 | | - mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" |
21 | | - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" |
22 | | - |
23 | | - // Fabric API. This is technically optional, but you probably want it anyway. |
24 | | - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" |
25 | | - |
26 | | - // Uncomment the following line to enable the deprecated Fabric API modules. |
27 | | - // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. |
28 | | - |
29 | | - // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" |
30 | | -} |
31 | | - |
32 | | -base { |
33 | | - archivesName = project.archives_base_name |
| 12 | + // Minecraft and Fabric Dependencies |
| 13 | + minecraft "com.mojang:minecraft:${project.minecraft_version}" |
| 14 | + mappings loom.officialMojangMappings() |
| 15 | + modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}" |
| 16 | + // Fabric API |
| 17 | + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" |
34 | 18 | } |
35 | 19 |
|
36 | 20 | processResources { |
37 | | - inputs.property "version", project.version |
38 | | - |
39 | | - filesMatching("fabric.mod.json") { |
40 | | - expand "version": project.version |
| 21 | + //inputs.property 'version', project.version |
| 22 | + filesMatching('fabric.mod.json') { |
| 23 | + expand 'version': version |
| 24 | + expand 'minecraft_version': project.minecraft_version |
| 25 | + expand 'fabric_loader_version': project.fabric_loader_version |
| 26 | + expand 'fabric_api_version': project.fabric_api_version |
41 | 27 | } |
42 | 28 | } |
43 | 29 |
|
44 | 30 | tasks.withType(JavaCompile).configureEach { |
45 | | - // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. |
46 | | - it.options.release = 17 |
47 | | -} |
48 | | - |
49 | | -java { |
50 | | - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
51 | | - // if it is present. |
52 | | - // If you remove this line, sources will not be generated. |
53 | | - withSourcesJar() |
54 | | - |
55 | | - sourceCompatibility = JavaVersion.VERSION_17 |
56 | | - targetCompatibility = JavaVersion.VERSION_17 |
57 | | -} |
58 | | - |
59 | | -jar { |
60 | | - from("LICENSE") { |
61 | | - rename { "${it}_${base.archivesName.get()}"} |
62 | | - } |
63 | | -} |
64 | | - |
65 | | -// configure the maven publication |
66 | | -publishing { |
67 | | - publications { |
68 | | - mavenJava(MavenPublication) { |
69 | | - from components.java |
70 | | - } |
71 | | - } |
72 | | - |
73 | | - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. |
74 | | - repositories { |
75 | | - // Add repositories to publish to here. |
76 | | - // Notice: This block does NOT have the same function as the block in the top level. |
77 | | - // The repositories here will be used for publishing your artifact, not for |
78 | | - // retrieving dependencies. |
79 | | - } |
| 31 | + it.options.release = 17 |
80 | 32 | } |
0 commit comments