From 24204cfdc91a9ecc5e0012d9f256a7e72f541d64 Mon Sep 17 00:00:00 2001 From: makamys Date: Sat, 4 Jun 2022 09:31:42 +0200 Subject: Migrate to generic buildscript --- build.gradle | 102 ++++++----------------------------------------------------- 1 file changed, 10 insertions(+), 92 deletions(-) (limited to 'build.gradle') diff --git a/build.gradle b/build.gradle index 5a3a3bf..1b9e638 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,12 @@ +/** The root of the build. Exposed for flexibility, but you shouldn't edit it + unless you have to. Edit project.gradle instead. */ + buildscript { repositories { mavenCentral() - jcenter() maven { name = "forge" - url = "http://files.minecraftforge.net/maven" + url = "https://maven.minecraftforge.net/" } maven { name = "sonatype" @@ -13,102 +15,18 @@ buildscript { } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' - // MixinGradle only works with ForgeGradle 2+, so we need to implement it ourselves. - // (Comments mark the lines where this is done.) - //classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT' - } -} - -repositories { - maven { // this has to be here and not in buildscript.repositories, otherwise Gradle won't find mixin <0.8 for some reason - name = 'sponge' - url = 'https://repo.spongepowered.org/maven/' } } -configurations { - embed - compile.extendsFrom(embed) -} - -apply plugin: 'forge' - -version = "0.0" -group= "makamys.lodmod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "lodmod" - -minecraft { - version = "1.7.10-10.13.4.1614-1.7.10" - runDir = "run" +plugins { + id 'java-library' + id 'maven-publish' } -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - dependencies { - embed 'org.spongepowered:mixin:0.7+' - - /* Mixin 0.8 breaks with 1.7.10, but can be made to work by embedding these. However, - doing so overrides the libraries provided by Forge, which will likely result in other mods breaking. */ - //embed 'org.ow2.asm:asm-all:5.2' - //embed 'com.google.guava:guava:21.0' -} - -def outRefMapFile = tasks.compileJava.temporaryDir.toString() + "/lodmod.mixin.refmap.json" // 1.7.10 mixin compatibility - -jar { - manifest { - attributes ( - 'MixinConfigs': 'lodmod.mixin.json', - 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker', - 'TweakOrder': 0, - - // If these two are not set, Forge will not detect the mod, it will only run the mixins - 'FMLCorePluginContainsFMLMod': 'true', - 'ForceLoadAsMod': 'true', - 'FMLAT': "LODMod_at.cfg" - ) - } - - from(sourceSets.main.output); - - from outRefMapFile; // 1.7.10 mixin compatibility - - // embed libraries in jar - from configurations.embed.collect { - exclude '**/LICENSE.txt' - it.isDirectory() ? it : zipTree(it) - } -} - -// 1.7.10 mixin compatibility -def outSrgFile = tasks.compileJava.temporaryDir.toString() + "/outSrg.srg" - -afterEvaluate { - tasks.compileJava.options.compilerArgs += ["-AreobfSrgFile=${tasks.reobf.srg}", "-AoutSrgFile=${outSrgFile}", "-AoutRefMapFile=${outRefMapFile}"]; -} - -reobf { - addExtraSrgFile outSrgFile + compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev" + compile "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev" } -// end of mixin stuff -processResources -{ - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version - } - - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - } -} +apply from: "buildscript/forge-1.7.gradle" \ No newline at end of file -- cgit