From 12cc5c1718b5dedb3d412c39345a38ad4f2b5329 Mon Sep 17 00:00:00 2001 From: AtomSponge Date: Sun, 29 Nov 2015 12:07:15 +0100 Subject: [PATCH] Automatically replace mod version in ModUtil class --- build.gradle | 8 +++++--- src/main/java/ellpeck/actuallyadditions/util/ModUtil.java | 6 ++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 7b2227414..57a0f80e3 100644 --- a/build.gradle +++ b/build.gradle @@ -25,6 +25,9 @@ archivesBaseName = "ActuallyAdditions" minecraft { version = "1.7.10-10.13.4.1558-1.7.10" runDir = "idea" + + replaceIn "ModUtil.java" + replace "mod_version", project.version.toString() } repositories { @@ -45,15 +48,14 @@ dependencies { compile "codechicken:NotEnoughItems:1.7.10-1.0.5.110:dev" } -processResources{ - +processResources { inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' - expand 'version':project.version, 'mcversion':project.minecraft.version + expand 'version': project.version, 'mcversion': project.minecraft.version } from(sourceSets.main.resources.srcDirs) { diff --git a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java index 18eabd8b2..47779d90f 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java @@ -15,14 +15,12 @@ import org.apache.logging.log4j.Logger; import java.util.Locale; -public class ModUtil{ - - public static final String VERSION = "1.7.10-r8"; +public class ModUtil { + public static final String VERSION = "mod_version"; // Will be replaced by gradle public static final String MOD_ID = "ActuallyAdditions"; public static final String NAME = "Actually Additions"; public static final String MOD_ID_LOWER = MOD_ID.toLowerCase(Locale.ROOT); public static final Logger LOGGER = LogManager.getLogger(MOD_ID); - }