diff options
author | makamys <makamys@outlook.com> | 2022-06-04 09:31:42 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-04 09:33:13 +0200 |
commit | 24204cfdc91a9ecc5e0012d9f256a7e72f541d64 (patch) | |
tree | 233971dbe560cb416eaa0646c7bf38853daabc1b /build.gradle | |
parent | b0f7f36a0b26f8ae0f6c238ae1a11f68d20efa1c (diff) | |
download | Neodymium-24204cfdc91a9ecc5e0012d9f256a7e72f541d64.tar.gz Neodymium-24204cfdc91a9ecc5e0012d9f256a7e72f541d64.tar.bz2 Neodymium-24204cfdc91a9ecc5e0012d9f256a7e72f541d64.zip |
Migrate to generic buildscript
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 102 |
1 files changed, 10 insertions, 92 deletions
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 |