I have two addons whose directory structures are shown below. Both addons use the same [embedded] library, myLib-1.0. In myLib-1.0 there are two source files, the public services defined in myLib-1.0 and the private services defined in PrivateAPI.lua and only visible to the code in myLib-1.0.
Here’s the directory structure for FooAddon.
FooAddon
Libs\myLib-1.0
Libs\myLib-1.0\LibStub.lua
Libs\myLib-1.0\PrivateAPI.lua
Libs\myLib-1.0\myLib-1.0.luaFoo.lua
FooAddon.toc
Here’s the directory structure for the BarAddon
BarAddon
Libs\myLib-1.0
Libs\myLib-1.0\LibStub.lua
Libs\myLib-1.0\PrivateAPI.lua
Libs\myLib-1.0\myLib-1.0.luaBar.lua
BarAddon.toc
In my current implementation, the FooAddon and BarAddon run fine when the other is not present. When both are loaded, the BarAddon (the first one loaded) is clobbered, I think, by the FooAddon because the former doesn’t work and the latter does. So, I’m wondering of this might be because the namespace of myLib is the same in both addons.
At any rate, it’s hard to explain, but any ideas as to how to approach this?
Cheers,