|
| 1 | +plugins { |
| 2 | + id 'dev.architectury.loom' version '1.7-SNAPSHOT' apply false |
| 3 | + id 'architectury-plugin' version '3.4-SNAPSHOT' |
| 4 | + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false |
| 5 | +} |
| 6 | + |
| 7 | +architectury { |
| 8 | + minecraft = project.minecraft_version |
| 9 | +} |
| 10 | + |
| 11 | +allprojects { |
| 12 | + group = rootProject.maven_group |
| 13 | + version = rootProject.mod_version |
| 14 | +} |
| 15 | + |
| 16 | +subprojects { |
| 17 | + apply plugin: 'dev.architectury.loom' |
| 18 | + apply plugin: 'architectury-plugin' |
| 19 | + apply plugin: 'maven-publish' |
| 20 | + |
| 21 | + base { |
| 22 | + // Set up a suffixed format for the mod jar names, e.g. `example-fabric`. |
| 23 | + archivesName = "$rootProject.archives_name-$project.name" |
| 24 | + } |
| 25 | + |
| 26 | + repositories { |
| 27 | + // Add repositories to retrieve artifacts from in here. |
| 28 | + // You should only use this when depending on other mods because |
| 29 | + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. |
| 30 | + // See https://docs.gradle.org/current/userguide/declaring_repositories.html |
| 31 | + // for more information about repositories. |
| 32 | + } |
| 33 | + |
| 34 | + dependencies { |
| 35 | + minecraft "net.minecraft:minecraft:$rootProject.minecraft_version" |
| 36 | + mappings loom.officialMojangMappings() |
| 37 | + } |
| 38 | + |
| 39 | + java { |
| 40 | + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
| 41 | + // if it is present. |
| 42 | + // If you remove this line, sources will not be generated. |
| 43 | + withSourcesJar() |
| 44 | + |
| 45 | + sourceCompatibility = JavaVersion.VERSION_21 |
| 46 | + targetCompatibility = JavaVersion.VERSION_21 |
| 47 | + } |
| 48 | + |
| 49 | + tasks.withType(JavaCompile).configureEach { |
| 50 | + it.options.release = 21 |
| 51 | + } |
| 52 | + |
| 53 | + // Configure Maven publishing. |
| 54 | + publishing { |
| 55 | + publications { |
| 56 | + mavenJava(MavenPublication) { |
| 57 | + artifactId = base.archivesName.get() |
| 58 | + from components.java |
| 59 | + } |
| 60 | + } |
| 61 | + |
| 62 | + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. |
| 63 | + repositories { |
| 64 | + // Add repositories to publish to here. |
| 65 | + // Notice: This block does NOT have the same function as the block in the top level. |
| 66 | + // The repositories here will be used for publishing your artifact, not for |
| 67 | + // retrieving dependencies. |
| 68 | + } |
| 69 | + } |
| 70 | +} |
0 commit comments