|
| 1 | +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar |
| 2 | + |
| 3 | +buildscript { |
| 4 | + repositories { |
| 5 | + maven { url 'https://maven.minecraftforge.net' } |
| 6 | + maven { url 'https://repo.spongepowered.org/repository/maven-public' } |
| 7 | + mavenCentral() |
| 8 | + gradlePluginPortal() |
| 9 | + } |
| 10 | + dependencies { |
| 11 | + classpath 'com.gradleup.shadow:com.gradleup.shadow.gradle.plugin:9.0.0-beta10' |
| 12 | + classpath 'net.minecraftforge.gradle:ForgeGradle:6.0.+' |
| 13 | + classpath 'org.spongepowered:mixingradle:0.7.+' |
| 14 | + } |
| 15 | +} |
| 16 | + |
| 17 | +apply plugin: 'net.minecraftforge.gradle' |
| 18 | +// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. |
| 19 | +apply plugin: 'maven-publish' |
| 20 | +apply plugin: 'com.gradleup.shadow' |
| 21 | +apply plugin: 'org.spongepowered.mixin' |
| 22 | + |
| 23 | + |
| 24 | +version '1.3.6' |
| 25 | +group 'gkappa.wrapfix' |
| 26 | +archivesBaseName = 'WrapFix' |
| 27 | + |
| 28 | +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. |
| 29 | + |
| 30 | +minecraft { |
| 31 | + // The mappings can be changed at any time, and must be in the following format. |
| 32 | + // snapshot_YYYYMMDD Snapshot are built nightly. |
| 33 | + // stable_# Stables are built at the discretion of the MCP team. |
| 34 | + // Use non-default mappings at your own risk. they may not always work. |
| 35 | + // Simply re-run your setup task after changing the mappings to update your workspace. |
| 36 | + mappings channel: 'stable', version: '39-1.12' |
| 37 | + |
| 38 | + |
| 39 | + // Default run configurations. |
| 40 | + // These can be tweaked, removed, or duplicated as needed. |
| 41 | + runs { |
| 42 | + client { |
| 43 | + jvmArg "-Dfml.coreMods.load=top.outlands.wrapfix.WrapFixLoadingPlugin" |
| 44 | + jvmArg "-Dmixin.hotSwap=true" |
| 45 | + jvmArg "-Dmixin.checks.interfaces=true" |
| 46 | + jvmArg "-Dmixin.debug=true" |
| 47 | + |
| 48 | + workingDirectory project.file('run') |
| 49 | + |
| 50 | + // Recommended logging data for a userdev environment |
| 51 | + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' |
| 52 | + |
| 53 | + // Recommended logging level for the console |
| 54 | + property 'forge.logging.console.level', 'debug' |
| 55 | + } |
| 56 | + |
| 57 | + server { |
| 58 | + |
| 59 | + jvmArg "-Dfml.coreMods.load=top.outlands.wrapfix.WrapFixLoadingPlugin" |
| 60 | + jvmArg "-Dmixin.hotSwap=true" |
| 61 | + jvmArg "-Dmixin.checks.interfaces=true" |
| 62 | + |
| 63 | + // Recommended logging data for a userdev environment |
| 64 | + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' |
| 65 | + |
| 66 | + // Recommended logging level for the console |
| 67 | + property 'forge.logging.console.level', 'debug' |
| 68 | + } |
| 69 | + } |
| 70 | +} |
| 71 | + |
| 72 | +configurations { |
| 73 | + shade |
| 74 | + shade.extendsFrom implementation |
| 75 | + |
| 76 | +} |
| 77 | + |
| 78 | +repositories { |
| 79 | + maven { url "https://repo.spongepowered.org/maven" } |
| 80 | + maven { |
| 81 | + url "https://cfa2.cursemaven.com" |
| 82 | + content { |
| 83 | + includeGroup "curse.maven" |
| 84 | + } |
| 85 | + metadataSources { |
| 86 | + artifact() |
| 87 | + } |
| 88 | + } |
| 89 | + maven { |
| 90 | + url "https://maven.cleanroommc.com" |
| 91 | + } |
| 92 | + flatDir { |
| 93 | + dirs "libs" |
| 94 | + } |
| 95 | +} |
| 96 | + |
| 97 | +dependencies { |
| 98 | + // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed |
| 99 | + // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. |
| 100 | + // The userdev artifact is a special name and will get all sorts of transformations applied to it. |
| 101 | + minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860' |
| 102 | + |
| 103 | + /* |
| 104 | + compileJar("org.spongepowered:mixin:0.8.5") { |
| 105 | + exclude module: "asm-commons" |
| 106 | + exclude module: "asm-tree" |
| 107 | + exclude module: "launchwrapper" |
| 108 | + exclude module: "guava" |
| 109 | + exclude module: "log4j-core" |
| 110 | + exclude module: "gson" |
| 111 | + exclude module: "commons-io" |
| 112 | + }*/ |
| 113 | + shade "com.ibm.icu:icu4j:76.1" |
| 114 | + |
| 115 | + // Common: |
| 116 | + annotationProcessor 'org.ow2.asm:asm-debug-all:5.2' |
| 117 | + annotationProcessor 'com.google.guava:guava:32.1.2-jre' |
| 118 | + annotationProcessor 'com.google.code.gson:gson:2.8.9' |
| 119 | + |
| 120 | + // ForgeGradle: |
| 121 | + implementation ('zone.rong:mixinbooter:10.5') { |
| 122 | + transitive = false |
| 123 | + } |
| 124 | + annotationProcessor ('zone.rong:mixinbooter:10.5') { |
| 125 | + transitive = false |
| 126 | + } |
| 127 | + |
| 128 | + compileOnly fg.deobf( "curse.maven:IndustrialWiresRE-521139:3474268" ) |
| 129 | + compileOnly fg.deobf( "curse.maven:ImmersiveEngineering-231951:2974106" ) |
| 130 | + compileOnly fg.deobf( "curse.maven:BetterQuesting-629629:4010084" ) |
| 131 | + runtimeOnly "curse.maven:BetterQuesting-629629:4010084" |
| 132 | + compileOnly fg.deobf( "curse.maven:Botania-225643:3330934" ) |
| 133 | + compileOnly fg.deobf( "curse.maven:Psi-241665:3085917" ) |
| 134 | + compileOnly fg.deobf( "curse.maven:Baubles-227083:2518667" ) |
| 135 | + compileOnly fg.deobf("curse.maven:smooth-font-285742:3944565") |
| 136 | + implementation "com.cleanroommc:configanytime:3.0" |
| 137 | + |
| 138 | + |
| 139 | + //compileOnly ("blus:immersiveengineering:0.12-98") |
| 140 | + //compileOnly ("mantle:industrialwires:1.8-38") |
| 141 | + //compileOnly ("loli:mixinbooter:3.2") |
| 142 | + //compileOnly ("funguy:betterquesting:3.5.329") |
| 143 | + |
| 144 | + //runtimeOnly "curse.maven:MixinBooter-419286:3687785" |
| 145 | +} |
| 146 | + |
| 147 | +// Example for how to get properties into the manifest for reading by the runtime.. |
| 148 | +jar { |
| 149 | + manifest { |
| 150 | + attributes([ |
| 151 | + "FMLCorePluginContainsFMLMod": "true", |
| 152 | + "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", |
| 153 | + "FMLCorePlugin": "top.outlands.wrapfix.WrapFixLoadingPlugin", |
| 154 | + "ForceLoadAsMod": "true" |
| 155 | + ]) |
| 156 | + } |
| 157 | + //finalizedBy('reobfJar') |
| 158 | +} |
| 159 | + |
| 160 | +// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing |
| 161 | +//publish.dependsOn('reobfJar') |
| 162 | + |
| 163 | +java { |
| 164 | + withSourcesJar() |
| 165 | +} |
| 166 | + |
| 167 | + |
| 168 | +publishing { |
| 169 | + repositories { |
| 170 | + maven { |
| 171 | + name = "outlands" |
| 172 | + url = "https://maven.outlands.top/releases" |
| 173 | + credentials(PasswordCredentials) |
| 174 | + authentication { |
| 175 | + basic(BasicAuthentication) |
| 176 | + } |
| 177 | + } |
| 178 | + } |
| 179 | + publications { |
| 180 | + maven(MavenPublication) { |
| 181 | + groupId = "gkappa" |
| 182 | + artifactId = "wrapfix" |
| 183 | + version = version |
| 184 | + from components.java |
| 185 | + } |
| 186 | + } |
| 187 | +} |
| 188 | + |
| 189 | +mixin { |
| 190 | + add sourceSets.main, "mixins.wrapfix.refmap.json" |
| 191 | + disableAnnotationProcessorCheck() |
| 192 | +} |
| 193 | + |
| 194 | +shadowJar { |
| 195 | + archiveClassifier.set("shadow") |
| 196 | + configurations = [project.configurations.shade] |
| 197 | + relocate('com.ibm.icu','repack.com.ibm.icu') |
| 198 | + dependencies { |
| 199 | + include(dependency("com.ibm.icu:icu4j:76.1")) |
| 200 | + } |
| 201 | + manifest { |
| 202 | + inheritFrom jar.manifest |
| 203 | + } |
| 204 | + finalizedBy('reobfShadowJar') |
| 205 | +} |
| 206 | + |
| 207 | +assemble.dependsOn shadowJar |
| 208 | +tasks.shadowJar.dependsOn("reobfJar") |
| 209 | +reobf { |
| 210 | + shadowJar {} |
| 211 | +} |
| 212 | + |
| 213 | +artifacts { |
| 214 | + archives shadowJar |
| 215 | + archives sourcesJar |
| 216 | +} |
0 commit comments