|
| 1 | +// versions |
| 2 | +val minecraftVersion = "1.21.1" |
| 3 | +val minecraftDep = "=1.21.1" |
| 4 | +// https://parchmentmc.org/docs/getting-started |
| 5 | +val parchmentVersion = "2024.11.17" |
| 6 | +// https://fabricmc.net/develop |
| 7 | +val loaderVersion = "0.16.14" |
| 8 | + |
| 9 | +// buildscript |
| 10 | +plugins { |
| 11 | + id("fabric-loom") version "1.11.+" |
| 12 | + id("maven-publish") |
| 13 | +} |
| 14 | + |
| 15 | +base.archivesName = "sheared" |
| 16 | +group = "one.devos.nautical" |
| 17 | + |
| 18 | +val buildNum = providers.environmentVariable("GITHUB_RUN_NUMBER") |
| 19 | + .filter(String::isNotEmpty) |
| 20 | + .map { "build.$it" } |
| 21 | + .orElse("local") |
| 22 | + .get() |
| 23 | + |
| 24 | +version = "1.0.0+mc$minecraftVersion.$buildNum" |
| 25 | + |
| 26 | +repositories { |
| 27 | + maven("https://maven.parchmentmc.org") |
| 28 | + maven("https://api.modrinth.com/maven") |
| 29 | +} |
| 30 | + |
| 31 | +dependencies { |
| 32 | + // dev environment |
| 33 | + minecraft("com.mojang:minecraft:$minecraftVersion") |
| 34 | + mappings(loom.layered { |
| 35 | + officialMojangMappings { nameSyntheticMembers = false } |
| 36 | + parchment("org.parchmentmc.data:parchment-$minecraftVersion:$parchmentVersion@zip") |
| 37 | + }) |
| 38 | + modImplementation("net.fabricmc:fabric-loader:$loaderVersion") |
| 39 | +} |
| 40 | + |
| 41 | +tasks.withType(ProcessResources::class) { |
| 42 | + val properties: Map<String, Any> = mapOf( |
| 43 | + "version" to version, |
| 44 | + "minecraft_dependency" to minecraftDep |
| 45 | + ) |
| 46 | + |
| 47 | + inputs.properties(properties) |
| 48 | + |
| 49 | + filesMatching("fabric.mod.json") { |
| 50 | + expand(properties) |
| 51 | + } |
| 52 | +} |
| 53 | + |
| 54 | +java { |
| 55 | + withSourcesJar() |
| 56 | +} |
| 57 | + |
| 58 | +publishing { |
| 59 | + publications { |
| 60 | + register<MavenPublication>("mavenJava") { |
| 61 | + from(components["java"]) |
| 62 | + } |
| 63 | + } |
| 64 | + |
| 65 | + repositories { |
| 66 | + maven("https://mvn.devos.one/snapshots") { |
| 67 | + name = "devOsSnapshots" |
| 68 | + credentials(PasswordCredentials::class) |
| 69 | + } |
| 70 | + maven("https://mvn.devos.one/releases") { |
| 71 | + name = "devOsReleases" |
| 72 | + credentials(PasswordCredentials::class) |
| 73 | + } |
| 74 | + } |
| 75 | +} |
0 commit comments