diff --git a/build.gradle b/build.gradle index 914bb2430..3b5eeca1e 100644 --- a/build.gradle +++ b/build.gradle @@ -29,17 +29,26 @@ configFile.withReader { } group = "com.github.glitchfiend.biomesoplenty" +// why set the version twice? version = config.mod_version archivesBaseName = "BiomesOPlenty" -minecraft { - version = config.minecraft_version + "-" + config.forge_version // grab latest forge - useDepAts = true - mappings = project.config.mappings_version -} - // add some stuff to the version version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}" +// set this for the version.properties file, or was this broken on purpose? +config.build_number = (System.getenv().BUILD_NUMBER) ? System.getenv().BUILD_NUMBER : "" + +minecraft { + version = config.minecraft_version + "-" + config.forge_version // grab latest forge + useDepAts = true + mappings = project.config.mappings_version + //gradle complains if this isn't set when setting up/using IDEA workspace + runDir = "run" + //set a full version string with appended build number to be used in mod registration + def buildnum = (config.build_number!="") ? '.' + config.build_number : "" + replace '@MOD_VERSION@', config.mod_version + buildnum + replaceIn 'BiomesOPlenty.java' +} def commonManifest = { attributes 'FMLAT': 'biomesoplenty_at.cfg' diff --git a/src/main/java/biomesoplenty/core/BiomesOPlenty.java b/src/main/java/biomesoplenty/core/BiomesOPlenty.java index 91d2905a2..39c6be27e 100644 --- a/src/main/java/biomesoplenty/core/BiomesOPlenty.java +++ b/src/main/java/biomesoplenty/core/BiomesOPlenty.java @@ -40,11 +40,12 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; -@Mod(modid = BiomesOPlenty.MOD_ID, name = BiomesOPlenty.MOD_NAME, dependencies = "required-after:Forge@[11.14.3.1468,)", guiFactory = BiomesOPlenty.GUI_FACTORY) +@Mod(modid = BiomesOPlenty.MOD_ID, version = BiomesOPlenty.MOD_VERSION , name = BiomesOPlenty.MOD_NAME, dependencies = "required-after:Forge@[11.14.3.1468,)", guiFactory = BiomesOPlenty.GUI_FACTORY) public class BiomesOPlenty { public static final String MOD_NAME = "Biomes O' Plenty"; public static final String MOD_ID = "BiomesOPlenty"; + public static final String MOD_VERSION = "@MOD_VERSION@"; public static final String GUI_FACTORY = "biomesoplenty.client.gui.GuiFactory"; @Instance(MOD_ID)