|
| 1 | +plugins { |
| 2 | + id 'fabric-loom' version '1.6.11' |
| 3 | +} |
| 4 | + |
| 5 | +archivesBaseName = "Dynmap" |
| 6 | +version = parent.version |
| 7 | +group = parent.group |
| 8 | + |
| 9 | +eclipse { |
| 10 | + project { |
| 11 | + name = "Dynmap(Fabric-1.20.6)" |
| 12 | + } |
| 13 | +} |
| 14 | + |
| 15 | +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(21) // Need this here so eclipse task generates correctly. |
| 16 | + |
| 17 | +configurations { |
| 18 | + shadow |
| 19 | + implementation.extendsFrom(shadow) |
| 20 | +} |
| 21 | + |
| 22 | +repositories { |
| 23 | + mavenCentral() |
| 24 | + maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } |
| 25 | +} |
| 26 | + |
| 27 | +dependencies { |
| 28 | + minecraft "com.mojang:minecraft:${project.minecraft_version}" |
| 29 | + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" |
| 30 | + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" |
| 31 | + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" |
| 32 | + |
| 33 | + compileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' |
| 34 | + |
| 35 | + shadow project(path: ':DynmapCore', configuration: 'shadow') |
| 36 | + |
| 37 | + modCompileOnly "me.lucko:fabric-permissions-api:0.1-SNAPSHOT" |
| 38 | + compileOnly 'net.luckperms:api:5.4' |
| 39 | +} |
| 40 | + |
| 41 | +loom { |
| 42 | + accessWidenerPath = file("src/main/resources/dynmap.accesswidener") |
| 43 | +} |
| 44 | + |
| 45 | +processResources { |
| 46 | + filesMatching('fabric.mod.json') { |
| 47 | + expand "version": project.version |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +java { |
| 52 | + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
| 53 | + // if it is present. |
| 54 | + // If you remove this line, sources will not be generated. |
| 55 | + withSourcesJar() |
| 56 | +} |
| 57 | + |
| 58 | +jar { |
| 59 | + from "LICENSE" |
| 60 | + from { |
| 61 | + configurations.shadow.collect { it.toString().contains("guava") ? null : it.isDirectory() ? it : zipTree(it) } |
| 62 | + } |
| 63 | +} |
| 64 | + |
| 65 | +remapJar { |
| 66 | + archiveFileName = "${archivesBaseName}-${project.version}-fabric-${project.minecraft_version}.jar" |
| 67 | + destinationDirectory = file '../target' |
| 68 | +} |
| 69 | + |
| 70 | +remapJar.doLast { |
| 71 | + task -> |
| 72 | + ant.checksum file: task.archivePath |
| 73 | +} |
0 commit comments