|
1 | 1 | plugins { |
2 | 2 | id 'maven-publish' |
3 | | - id 'ornithe-loom' version "1.0+" |
| 3 | + alias libs.plugins.quilt.loom |
| 4 | + alias libs.plugins.ploceus |
4 | 5 | } |
5 | 6 |
|
6 | | -sourceCompatibility = JavaVersion.VERSION_1_8 |
7 | | -targetCompatibility = JavaVersion.VERSION_1_8 |
8 | | - |
9 | 7 | archivesBaseName = project.archives_base_name |
10 | | -version = project.mod_version |
| 8 | +version = "${project.version}+${libs.versions.minecraft.get()}" |
11 | 9 | group = project.maven_group |
12 | 10 |
|
13 | 11 | repositories { |
| 12 | + // Add repositories to retrieve artifacts from in here. |
| 13 | + // You should only use this when depending on other mods because |
| 14 | + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. |
| 15 | + // See https://docs.gradle.org/current/userguide/declaring_repositories.html |
| 16 | + // for more information about repositories. |
14 | 17 | } |
15 | 18 |
|
| 19 | +// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>" |
| 20 | +// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work. |
16 | 21 | dependencies { |
17 | | - minecraft "com.mojang:minecraft:${project.minecraft_version}" |
18 | | - mappings "net.ornithemc:feather:${project.feather_mappings}:v2" |
19 | | - modImplementation "net.ornithemc:ornithe-loader:${project.loader_version}" |
20 | | - |
21 | | - implementation 'org.lwjgl.lwjgl:lwjgl_util:2.9.0' |
22 | | - implementation 'org.lwjgl.lwjgl:lwjgl:2.9.0' |
23 | | -} |
24 | | - |
25 | | -configurations.all { |
26 | | - resolutionStrategy { |
27 | | - dependencySubstitution { |
28 | | - substitute module('org.lwjgl.lwjgl:lwjgl_util:2.9.1-nightly-20131017') with module('org.lwjgl.lwjgl:lwjgl_util:2.9.0') |
29 | | - substitute module('org.lwjgl.lwjgl:lwjgl:2.9.1-nightly-20131017') with module('org.lwjgl.lwjgl:lwjgl:2.9.0') |
30 | | - } |
| 22 | + minecraft libs.minecraft |
| 23 | + mappings loom.layered { |
| 24 | + mappings variantOf(libs.feather.mappings) { classifier 'v2' } |
| 25 | + ploceus.nestedMappings(it) // remove this line if not using nests |
31 | 26 | } |
| 27 | + nests libs.nests // remove this line if not using nests |
| 28 | + |
| 29 | + modImplementation libs.quilt.loader |
32 | 30 | } |
33 | 31 |
|
34 | 32 | processResources { |
35 | | - inputs.property "version", project.version |
| 33 | + inputs.property 'version', version |
36 | 34 |
|
37 | | - filesMatching("ornithe.mod.json") { |
38 | | - expand "version": project.version |
| 35 | + filesMatching('quilt.mod.json') { |
| 36 | + expand "version": version |
39 | 37 | } |
40 | 38 | } |
41 | 39 |
|
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 | 40 | tasks.withType(JavaCompile).configureEach { |
46 | | - it.options.encoding = "UTF-8" |
47 | | - if (JavaVersion.current().isJava9Compatible()) it.options.release = 8 |
| 41 | + it.options.encoding = 'UTF-8' |
| 42 | + it.options.release = 8 |
48 | 43 | } |
49 | 44 |
|
50 | 45 | java { |
51 | | - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
52 | | - // if it is present. |
| 46 | + // Still required by IDEs such as Eclipse and Visual Studio Code |
| 47 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 48 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 49 | + |
| 50 | + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task if it is present. |
53 | 51 | // If you remove this line, sources will not be generated. |
54 | 52 | withSourcesJar() |
| 53 | + |
| 54 | + // If this mod is going to be a library, then it should also generate Javadocs in order to aid with development. |
| 55 | + // Uncomment this line to generate them. |
| 56 | + // withJavadocJar() |
55 | 57 | } |
56 | 58 |
|
| 59 | +// If you plan to use a different file for the license, don't forget to change the file name here! |
57 | 60 | jar { |
58 | | - from("LICENSE") { |
59 | | - rename { "${it}_${project.archivesBaseName}" } |
| 61 | + from('LICENSE') { |
| 62 | + rename { "${it}_${archivesBaseName}" } |
60 | 63 | } |
61 | 64 | } |
62 | 65 |
|
63 | | -// configure the maven publication |
| 66 | +// Configure the maven publication |
64 | 67 | publishing { |
65 | 68 | publications { |
66 | 69 | mavenJava(MavenPublication) { |
67 | 70 | from components.java |
68 | 71 | } |
69 | 72 | } |
70 | 73 |
|
71 | | - // select the repositories you want to publish to |
| 74 | + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. |
72 | 75 | repositories { |
73 | | - // uncomment to publish to the local maven |
74 | | - // mavenLocal() |
| 76 | + // Add repositories to publish to here. |
| 77 | + // Notice: This block does NOT have the same function as the block in the top level. |
| 78 | + // The repositories here will be used for publishing your artifact, not for |
| 79 | + // retrieving dependencies. |
75 | 80 | } |
76 | 81 | } |
0 commit comments