aspect-build / aspect-cli

correct, fast, usable: choose three
https://aspect.build/cli
Apache License 2.0
92 stars 21 forks source link

[FR]: Support adding `testonly` to a glob of folders/files with gazelle plugin #669

Open Aghassi opened 6 months ago

Aghassi commented 6 months ago

What is the current behavior?

You can't isolate out a folder and say "for this folder, please give me source targets and add testonly to make sure this folder doesn't get used in production". This means we can do build file generation on a folder like mocks but we have to manually add testonly.

Describe the feature

We should be able to pass a directive like #gazelle:treat_as_testonly **/mocks/** that will generate targets in any mocks folder found, but add testonly to the ts_project target. This prevents anything from mocks being used downstream and ending up in production.