Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wmltools: split campaigns/add-ons into separate subtrees for wmlscope
The problem: wmlscope assigns each file to a directory-based subtree, and assumes that it is visible to every other file in that subtree. The intent is that each campaign (or add-on of another type) will be in its own subtree. However, wmlscope/wmltools has derived these subtrees based on what arguments get passed to wmlscope, rather than checking whether campaigns have actually been split out. For instance, invoking wmlscope with "../data/core ../data/campaigns <userdata>/data/add-ons" will cause wmlscope to see three subtrees, one of which consists of all mainline campaigns and another that includes all the user's add-ons. This leads to many spurious "more than one definition/resource is visible here" errors. A wildcard like "data/campaigns/*" would be expanded to all the individual campaign directories. However, the wmlscope user might not know that they should do that. Also, until the glob module was imported recently, globbing did not work in the Windows cmd shell. The solution: declare "campaigns" and "add-ons" to be roots, and check for their presence in the directory names. If indicated, split out the subdirectories into their own subtrees. Since it is possible that the user may have moved, copied, or drafted campaigns/add-ons to another folder that isn't following Wesnoth convention, also check for that.
- Loading branch information