- Are there any good reasons for not allowing lists to be passed to tasks?
- What is the convenient way of passing multiple param values to tasks in gradle? (gradle -x task1 -x task2)
- Does anybody have any concerns on adding support for that?
--
You received this message because you are subscribed to the Google Groups "gradle-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gradle-dev+...@googlegroups.com.
To post to this group, send email to gradl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/40db9ae7-5a6f-41b8-adeb-df20f2f67e52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
We shouldn't change the behavior of `@Option` because that would mean refactoring all tasks that use it to handle being passed a collection. We would instead want to either 1) introduce a new annotation or 2) add a parameter to `@Option` to explicitly declare that the parameter is a collection type.
@Option(option = "tests", description = "Sets test class or method name to be included, '*' is supported.")
- public Test setTestNameIncludePattern(String testNamePattern) {
+ public Test setTestNameIncludePattern(List<String> testNamePattern) {
- Is supporting multiple test filter specs via the CLI something we want?
2. If so, should we enhance `@Option` to support this or solve some other way?
If I understand correctly '@Option' already supports multiple arguments. But, due to some reason, there some asserts were added which were not allowing to use this feature.
--
You received this message because you are subscribed to the Google Groups "gradle-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gradle-dev+...@googlegroups.com.
To post to this group, send email to gradl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/c2ded611-875b-48de-8f7e-a01837ead8db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- Are there any good reasons for not allowing lists to be passed to tasks?
Depending on the nature of the option it often doesn't make sense to accept multiple values.
- What is the convenient way of passing multiple param values to tasks in gradle? (gradle -x task1 -x task2)
These are command line arguments, not task options and would therefore require a completely separate solution. There are other examples where this would make sense too (-I for passing init scripts) but again would have to be handled case by case.
- Does anybody have any concerns on adding support for that?
We shouldn't change the behavior of `@Option` because that would mean refactoring all tasks that use it to handle being passed a collection. We would instead want to either 1) introduce a new annotation or 2) add a parameter to `@Option` to explicitly declare that the parameter is a collection type.
There a separate issue here, which is that `@Option` is not a public API (although folks are definitely using it). This means that solving the use case above (allowing multiple test filter specs) and extending `@Option` to allow multivalues are really orthogonal problems, although the solution might be the same.The questions we need to answer are:
- Is supporting multiple test filter specs via the CLI something we want?
- If so, should we enhance `@Option` to support this or solve some other way?
- If we decide to enhance `@Option` or not, is this something we should consider making public?
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/CAL%3DKZYA9ygZn4-tTSrUS1JiM0%3DVMqBVmoO3jUanEc%3DG2DD04cg%40mail.gmail.com.
If I understand correctly '@Option' already supports multiple arguments. But, due to some reason, there some asserts were added which were not allowing to use this feature.I believe you are conflating command line options (ex: gradle --info) with task options (ex. gradle dependencies --configuration compile). These are two completely separate things with different implementations. The @Option annotation only applies to the latter. Currently @Option does not support collection types.My point being that we can potentially support the mutliple test filter use case without making changes to @Option. One argument to extending @Option to support collection types is that it might be useful for other things. That said, it's not a public API so that shouldn't be a motivation in this case. It's also not a trivial thing to implement. Handling multiple values means using a delimiter of some kind. We can't use a space because of ambiguity reasons. In the case of `gradle test --tests foo bar` is 'bar' a test filter or a task? Picking an arbitrary delimiter is problematic too because it might be a valid character for the parameter depending on the task implementation.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/CAL%3DKZYB0n8qLc0fsZFB28DPBa_WBRXZzjSy%2BXsbhb503e2ssZA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gradle-dev/CAMyicfWV%2B-257BxHkBadnX4PGs6qXF%3Dks%3Dmy8tWtzARWYw2W7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.