I was reviewing the LibUIDropDown codes and then realized I made a mistake by putting version revision in the MAJOR_VERSION, which will result in multiple version of libs get loaded and some functions could be conflicted.
Before:
Lua Code:
local MAJOR_VERSION = "LibUIDropDownMenu-1.07.7030024931"
local MINOR_VERSION = 90000 + tonumber(("$Rev: 25 $"):match("%d+"))
local LibStub = _G.LibStub
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
if not lib then return end
Now I have fixed it to below:
Lua Code:
local MAJOR_VERSION = "LibUIDropDownMenu"
local MINOR_VERSION = 90000 + tonumber(("$Rev: 30 $"):match("%d+"))
local LibStub = _G.LibStub
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
if not lib then return end
But I am wondering how to do similar version checking in XML files?
The LibUIDropDownMenu has two XML files, and while synchronizing the changes in WoW 8.0.1, there are several changes need to be implemented in those XML files. So question pops up.
Instead of moving all those XML UI to be handled in Lua, I wonder if there is some easy way to do it within XML file.