|
| 1 | +//file:noinspection GroovyAssignabilityCheck |
| 2 | +//file:noinspection GroovyAccessibility |
| 3 | +plugins { |
| 4 | + id "maven-publish" |
| 5 | + alias libs.plugins.loom |
| 6 | + alias libs.plugins.minotaur |
| 7 | +} |
| 8 | + |
| 9 | +version = "$modVersion+$branchName" |
| 10 | +base.archivesName = project.slug |
| 11 | + |
| 12 | +repositories { |
| 13 | + // Modrinth Maven - see: https://support.modrinth.com/en/articles/8801191-modrinth-maven |
| 14 | + // To use in a dependency, use: maven.modrinth:mod-id |
| 15 | + exclusiveContent { |
| 16 | + forRepository { |
| 17 | + maven { |
| 18 | + name = "Modrinth" |
| 19 | + url = "https://api.modrinth.com/maven" |
| 20 | + } |
| 21 | + } |
| 22 | + filter { |
| 23 | + includeGroup("maven.modrinth") |
| 24 | + } |
| 25 | + } |
| 26 | +} |
| 27 | + |
| 28 | +dependencies { |
| 29 | + minecraft libs.mc |
| 30 | + mappings variantOf(libs.yarn) { classifier "v2" } |
| 31 | + |
| 32 | + modImplementation libs.fl |
| 33 | + modImplementation libs.fapi |
| 34 | +} |
| 35 | + |
| 36 | +processResources { |
| 37 | + final Map<String, String> meta = [ |
| 38 | + version : version, |
| 39 | + modId : modId, |
| 40 | + modName : modName, |
| 41 | + modDescription: modDescription, |
| 42 | + homepage : "https://modrinth.com/mod/${slug}", |
| 43 | + issues : "https://github.com/${user}/${slug}/issues", |
| 44 | + sources : "https://github.com/${user}/${slug}", |
| 45 | + license : license, |
| 46 | + authors : authors.split(", ").join("\",\n \""), |
| 47 | + contributors : contributors.split(", ").join("\",\n \""), |
| 48 | + members : "${authors}${contributors ? ". Contributions by ${contributors}." : ""}", |
| 49 | + mc : compatibleVersions.split(", ")[0], |
| 50 | + fl : libs.versions.fl.get(), |
| 51 | + fapi : libs.versions.fapi.get(), |
| 52 | + ] |
| 53 | + inputs.properties meta |
| 54 | + filesMatching("*.mod.json") { expand(meta) } |
| 55 | + filesMatching("META-INF/*mods.toml") { expand(meta) } |
| 56 | +} |
| 57 | + |
| 58 | +tasks.withType(JavaCompile).configureEach { |
| 59 | + it.options.encoding = "UTF-8" |
| 60 | + it.options.release = 21 |
| 61 | +} |
| 62 | + |
| 63 | +java { |
| 64 | + withSourcesJar() |
| 65 | + sourceCompatibility = JavaVersion.VERSION_21 |
| 66 | + targetCompatibility = JavaVersion.VERSION_21 |
| 67 | +} |
| 68 | + |
| 69 | + |
| 70 | +publishing { |
| 71 | + repositories { |
| 72 | + } |
| 73 | + publications { |
| 74 | + mavenJava(MavenPublication) { |
| 75 | + from components.java |
| 76 | + } |
| 77 | + } |
| 78 | +} |
| 79 | + |
| 80 | +modrinth { |
| 81 | + token = "$System.env.MODRINTH_TOKEN" |
| 82 | + projectId = slug |
| 83 | + versionNumber = project.version |
| 84 | + uploadFile = remapJar |
| 85 | + gameVersions = compatibleVersions.split(", ").toList() |
| 86 | + loaders = compatibleLoaders.split(", ").toList() |
| 87 | + changelog = "$System.env.CHANGELOG" |
| 88 | + syncBodyFrom = "<!--DO NOT EDIT MANUALLY: synced from gh readme-->\n" + rootProject.file("README.md").text |
| 89 | + dependencies { |
| 90 | + required.version "fabric-api", libs.versions.fapi.get() |
| 91 | + } |
| 92 | +} |
0 commit comments