|
| 1 | +buildscript { |
| 2 | + repositories { |
| 3 | + maven { url = 'https://files.minecraftforge.net/maven' } |
| 4 | + jcenter() |
| 5 | + mavenCentral() |
| 6 | + } |
| 7 | + dependencies { |
| 8 | + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '[6.0.24,6.2)', changing: true |
| 9 | + } |
| 10 | +} |
| 11 | +apply plugin: 'net.minecraftforge.gradle' |
| 12 | +//apply plugin: 'com.github.johnrengelman.shadow' |
| 13 | +apply plugin: 'eclipse' |
| 14 | + |
| 15 | +eclipse { |
| 16 | + project { |
| 17 | + name = "Dynmap(Forge-1.21.10)" |
| 18 | + } |
| 19 | +} |
| 20 | + |
| 21 | +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(21) // Need this here so eclipse task generates correctly. |
| 22 | + |
| 23 | +println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) |
| 24 | + |
| 25 | +ext.buildNumber = System.getenv().BUILD_NUMBER ?: "Dev" |
| 26 | + |
| 27 | +minecraft { |
| 28 | + mappings channel: 'official', version: '1.21.10' |
| 29 | + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') |
| 30 | + reobf = false |
| 31 | + copyIdeResources = true |
| 32 | + runs { |
| 33 | + server { |
| 34 | + property 'eventbus.api.strictRuntimeChecks', 'true' |
| 35 | + workingDirectory project.file('run').canonicalPath |
| 36 | + } |
| 37 | + } |
| 38 | +} |
| 39 | + |
| 40 | +project.archivesBaseName = "${project.archivesBaseName}-forge-1.21.10" |
| 41 | + |
| 42 | +dependencies { |
| 43 | + implementation project(path: ":DynmapCore", configuration: "shadow") |
| 44 | + implementation project(path: ':DynmapCoreAPI') |
| 45 | + annotationProcessor 'net.minecraftforge:eventbus-validator:7.0-beta.7' |
| 46 | + |
| 47 | + minecraft 'net.minecraftforge:forge:1.21.10-60.1.5' |
| 48 | +} |
| 49 | + |
| 50 | +processResources |
| 51 | +{ |
| 52 | + filesMatching('META-INF/mods.toml') { |
| 53 | + // replace version and mcversion |
| 54 | + expand( |
| 55 | + version: project.version + '-' + project.ext.buildNumber, |
| 56 | + mcversion: "1.21.10" |
| 57 | + ) |
| 58 | + } |
| 59 | +} |
| 60 | + |
| 61 | +shadowJar { |
| 62 | + dependencies { |
| 63 | + include(dependency(':DynmapCore')) |
| 64 | + include(dependency("commons-codec:commons-codec:")) |
| 65 | + exclude("META-INF/maven/**") |
| 66 | + exclude("META-INF/services/**") |
| 67 | + } |
| 68 | + relocate('org.apache.commons.codec', 'org.dynmap.forge_1_21_10.commons.codec') |
| 69 | + |
| 70 | + archiveBaseName = "Dynmap" |
| 71 | + archiveClassifier = "forge-1.21.10" |
| 72 | + destinationDirectory = file '../target' |
| 73 | +} |
| 74 | + |
| 75 | +shadowJar.doLast { |
| 76 | + task -> |
| 77 | + ant.checksum file: task.archivePath |
| 78 | +} |
| 79 | + |
| 80 | +build.dependsOn(shadowJar) |
0 commit comments