-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic module detection only finds modules #370
Conversation
function listmodules() | ||
local function listmodules() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be available generally - one might want it in custom build.lua
code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made it local because it was not documented in l3build.dtx
.
Is it already used? by LaTeX?
As global function the name is not appropriate, imagine the documentation
listmodules(): automatically detects module
instead of
detectedmodules(): list of automatically detected module
Decision required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with listmodule()
- it returns a list of modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listmodules
can be interpreted as a function that "list modules", a function that returns modules about list, a function that returns a "list of modules".
for entry in tree(".", "*/build.lua") do -- TODO: support "**/..." | ||
local module = dirname(entry.cwd) | ||
if #module > 2 then -- this is not the current directory | ||
module = module:sub(3) -- remove the leading "./" | ||
if not exclmodules[module] then | ||
insert(modules, module) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow - aren't you risking having unpredictable nesting levels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, "*/..." only looks at the first level contrary to "**/..." that looks at arbitrary depth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, yes.
So wider question is why not just add to exclmodules
as in my suggestion - minimal change and all that.
listmodules
is turned local.It looks for any
build.lua
in subdirectories at depth 1.