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
Add ability to define templateAttributes
within a target
#533
Add ability to define templateAttributes
within a target
#533
Conversation
What about going even further and define associated templates for tests into the tested target template ? This would give us the ability to define only targets of interest. targetTemplates: use I don't know if people use more than a unit (and for app a ui) test targets |
I think my solution solves the issue in a more general way and would also be useful for many other use cases. I agree that it would also be a good idea to have some way to automatically generate an associated test target for a framework target but this can still be done separately. |
That's what I thoughts I'll give this a try when I can and give you feedbacks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you @tomquist, this is fantastic addition!
I wonder if now that the replacement strings can be anything if the syntax should be a bit more verbose so as not to cause any clashes. For example ${framework_name}
instead of $framework_name
.
Before we could get away with just the $
as the names of the replacements were known and deemed "safe", now I'm not so sure. If we did use a newer syntax, it might be worth updating to ${target_name}
and ${platform}
as well, while keeping backwards compatibility. What do you think?
Regarding your suggestion to use |
That would be great. Warnings would come from a linter which is not yet implemented and tracked here #214 |
I did the necessary change and also added warnings for old usage of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! It does the job for now. Left a couple of small comments
029a744
to
3bb7ebd
Compare
7fb05f0
to
3021da2
Compare
I'll rebase the branch on master and add additional tests that combine nested templates with targetAttributes. |
This allows parameterizing templates. Also change placeholder syntax to `${placeholderName}` also for existing placeholders `$target_name`and `$platform` and generate warnings when using the old placeholder syntax.
3021da2
to
aaae772
Compare
I adjusted the |
Great work! |
This allows parameterizing templates. One specific problem I wanted to solve with this issue is that I have a multi-framework project where framework-targets are specified by a target template. Each framework consists of the framework itself and a corresponding test target. The framework template is specified like this:
Now I'd like to create a template for the test target where the test-files are placed in
modules/<ModuleName>/Tests
. I have no way of defining a common template for this.When this PR is merged, I'm able to define the following template:
and use it like this: