Closed Bug 1138579 Opened 10 years ago Closed 6 years ago

Ability to define multiple patterns in Files contexts

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox64 fixed)

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: gps, Assigned: tcampbell)

References

Details

Attachments

(1 file)

Currently, Files contexts accept a single pattern as their argument. There are places where we want to cherry-pick individual files. I think it makes sense to support passing multiple files to Files.__init__.
So, one thing that I was thinking would be useful for templates is some magic around the syntax: with Template(...), Template(...): stuff such that two sub contexts are emitted, and stuff is applied to both. This would involve a proxy context that dispatches to both sub contexts. The problem is that it's hard to distinguish that form and: with Template(...): with Template(...): stuff Maybe looking at frame data?
I'd rather not depart too far from the Python language because it breaks understanding. For this feature, I was thinking of using either *args or detecting an iterable as the argument and emitting multiple Files instances (rather than a single Files that has multiple patterns). If you want to have a go at using the multiple context manager syntax and magic, I won't stop you. But I have a feeling people will want this feature soonish, which is why I'm inclined to go the easy route.
Immediate options: with Files('{a,b}'): with Files('a', 'b'): with Files('a'), Files('b'): I prefer the middle one. It still allows future extension possibilities: with Files('a/**', 'b/**', exclude='*.js'):
Product: Core → Firefox Build System
Add support for |with Files('a/**', 'b/**')| in mozbuild config files. MozReview-Commit-ID: IoM4qfEhXXc
Comment on attachment 9007357 [details] Bug 1138579 - Support multiple Files patterns in moz.build Gregory Szorc [:gps] has approved the revision.
Attachment #9007357 - Flags: review+
Pushed by gszorc@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/08f0bf17514d Support multiple Files patterns in moz.build r=gps
Flags: needinfo?(tcampbell)
Attachment #9007357 - Flags: review+ → review?(gps)
Comment on attachment 9007357 [details] Bug 1138579 - Support multiple Files patterns in moz.build Gregory Szorc [:gps] has approved the revision.
Attachment #9007357 - Flags: review+
Attachment #9007357 - Flags: review?(gps)
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3d2a3eb077ff Support multiple Files patterns in moz.build r=gps
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: