Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

jlaurens
Copy link
Contributor

listmodules is turned local.
It looks for any build.lua in subdirectories at depth 1.

function listmodules()
local function listmodules()
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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".

Comment on lines +34 to +39
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)
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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.

@jlaurens jlaurens closed this Jun 28, 2024
@jlaurens jlaurens deleted the #369 branch June 28, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants