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.
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 likemocks
but we have to manually addtestonly
.Describe the feature
We should be able to pass a directive like
#gazelle:treat_as_testonly **/mocks/**
that will generate targets in anymocks
folder found, but addtestonly
to thets_project
target. This prevents anything from mocks being used downstream and ending up in production.