jimporter / bfg9000

bfg9000 - build file generator
https://jimporter.github.io/bfg9000
BSD 3-Clause "New" or "Revised" License
76 stars 21 forks source link

Simplify `find_files` API #129

Closed jimporter closed 4 years ago

jimporter commented 4 years ago

We should simplify the find_files API so that the search path and the glob are specified together, like:

# Old way:
find_files('include', '*.hpp')
find_files(['include', 'src'], '*.hpp')
find_files('src', ['*.hpp', '*.cpp'])

# New way:
find_files('include/**/*.hpp')
find_files(['include/**/*.hpp', 'src/**/*.cpp'])  # maybe not...
find_files(Path('include/**/*.hpp'))
find_files(Path('include').append('**/*.hpp'))

This would be a breaking change, but it's nicer looking, more flexible in some ways, and would possibly make it easier to add "implicit globs" one day if we wanted.

jimporter commented 4 years ago

Debating whether to add a compatibility shim for the old way so that it's easier to upgrade, or just rip the bandaid off now and tell people they need to fix their find_files() calls...