|
| 1 | +import net.minecraftforge.gradle.user.UserBaseExtension |
| 2 | + |
| 3 | +buildscript { |
| 4 | + repositories { |
| 5 | + mavenCentral() |
| 6 | + maven { |
| 7 | + name = "forge" |
| 8 | + setUrl("https://maven.minecraftforge.net/") |
| 9 | + } |
| 10 | + } |
| 11 | + dependencies { |
| 12 | + classpath("net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT") |
| 13 | + classpath("org.eclipse.jgit:org.eclipse.jgit:5.8.0.202006091008-r") |
| 14 | + classpath("org.apache.commons:commons-lang3:3.12.0") |
| 15 | + } |
| 16 | +} |
| 17 | + |
| 18 | +plugins { |
| 19 | + id("com.matthewprenger.cursegradle") version "1.1.0" |
| 20 | + id("maven-publish") |
| 21 | +} |
| 22 | + |
| 23 | +apply { |
| 24 | + plugin("net.minecraftforge.gradle.forge") |
| 25 | +} |
| 26 | + |
| 27 | +val mcVersion = "1.12.2" |
| 28 | +val forgeVersion = "14.23.5.2847" |
| 29 | +val mcFullVersion = "$mcVersion-$forgeVersion" |
| 30 | +val modVersion = "0.1.2-beta" |
| 31 | +version = "$mcVersion-$modVersion" |
| 32 | +group = "net.htmlcsjs.htmlTech" |
| 33 | + |
| 34 | +configure<BasePluginConvention> { |
| 35 | + archivesBaseName = "htmlTech" |
| 36 | +} |
| 37 | + |
| 38 | +fun minecraft(configure: UserBaseExtension.() -> Unit) = project.configure(configure) |
| 39 | + |
| 40 | +minecraft { |
| 41 | + version = mcFullVersion |
| 42 | + mappings = "stable_39" |
| 43 | + runDir = "run" |
| 44 | + replace("@VERSION@", modVersion) |
| 45 | + replaceIn("HTValues.java") |
| 46 | +} |
| 47 | +repositories { |
| 48 | + maven { |
| 49 | + setUrl("https://minecraft.curseforge.com/api/maven") |
| 50 | + } |
| 51 | + maven { |
| 52 | + setUrl("http://chickenbones.net/maven/") |
| 53 | + } |
| 54 | + maven { |
| 55 | + setUrl("http://dvs1.progwml6.com/files/maven/") |
| 56 | + } |
| 57 | + maven { // TOP |
| 58 | + name = "tterrag maven" |
| 59 | + setUrl("https://maven.tterrag.com/") |
| 60 | + } |
| 61 | + maven { |
| 62 | + name = "CraftTweaker Maven" |
| 63 | + setUrl("https://maven.blamejared.com/") |
| 64 | + } |
| 65 | +} |
| 66 | + |
| 67 | +dependencies { |
| 68 | + "deobfCompile"("mezz.jei:jei_1.12.2:+") |
| 69 | + "provided"(files("libs/gregtech-1.12.2-2.1.0-beta.jar")) |
| 70 | + "deobfCompile"("codechicken-lib-1-8:CodeChickenLib-1.12.2:3.2.3.358:universal") |
| 71 | + "deobfCompile"("codechicken:ChickenASM:1.12-1.0.2.9") |
| 72 | + "deobfCompile"("mcjty.theoneprobe:TheOneProbe-1.12:1.12-1.4.23-16") |
| 73 | + "deobfCompile"("team.chisel.ctm:CTM:MC1.12.2-1.0.2.31") |
| 74 | + "deobfCompile"("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.655") |
| 75 | +} |
| 76 | + |
| 77 | +configure<JavaPluginConvention> { |
| 78 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 79 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 80 | +} |
| 81 | + |
| 82 | +val processResources: ProcessResources by tasks |
| 83 | +val sourceSets: SourceSetContainer = the<JavaPluginConvention>().sourceSets |
| 84 | + |
| 85 | +processResources.apply { |
| 86 | + inputs.property("version", modVersion) |
| 87 | + inputs.property("mcversion", mcFullVersion) |
| 88 | + |
| 89 | + from(sourceSets["main"].resources.srcDirs) { |
| 90 | + include("mcmod.info") |
| 91 | + expand(mapOf("version" to modVersion, |
| 92 | + "mcversion" to mcFullVersion)) |
| 93 | + } |
| 94 | + |
| 95 | + // copy everything else, thats not the mcmod.info |
| 96 | + from(sourceSets["main"].resources.srcDirs) { |
| 97 | + exclude("mcmod.info") |
| 98 | + } |
| 99 | +} |
0 commit comments