-
Notifications
You must be signed in to change notification settings - Fork 52
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
Improve DSL by leveraging Gradle managed objects #600
Labels
Comments
Thanks for the detailed feedback! |
shanshin
added a commit
that referenced
this issue
Jun 7, 2024
The new DSL will allow to write chains like `kover.reports.total { ... }` instead of `kover { reports { total { ... } } }`. However, the DomainObjectContainer for variants has not been implemented, because it will be necessary to rework the workflow with different types of variants, which is part of a larger reworking of the DSL. Resolves #600
shanshin
added a commit
that referenced
this issue
Jun 7, 2024
The new DSL will allow to write chains like `kover.reports.total { ... }` instead of `kover { reports { total { ... } } }`. However, the DomainObjectContainer for variants has not been implemented, because it will be necessary to rework the workflow with different types of variants, which is part of a larger reworking of the DSL. Resolves #600
shanshin
added a commit
that referenced
this issue
Jun 7, 2024
The new DSL will allow to write chains like `kover.reports.total { ... }` instead of `kover { reports { total { ... } } }`. However, the DomainObjectContainer for variants has not been implemented, because it will be necessary to rework the workflow with different types of variants, which is part of a larger reworking of the DSL. Resolves #600
shanshin
added a commit
that referenced
this issue
Jun 7, 2024
The new DSL will allow to write chains like `kover.reports.total { ... }` instead of `kover { reports { total { ... } } }`. However, the DomainObjectContainer for variants has not been implemented, because it will be necessary to rework the workflow with different types of variants, which is part of a larger reworking of the DSL. Resolves #600
shanshin
added a commit
that referenced
this issue
Jun 7, 2024
The new DSL will allow to write chains like `kover.reports.total { ... }` instead of `kover { reports { total { ... } } }`. However, the DomainObjectContainer for variants has not been implemented, because it will be necessary to rework the workflow with different types of variants, which is part of a larger reworking of the DSL. PR #625 Resolves #600
Partially resolved in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
What is your use-case and why do you need this feature?
I recently put focus into this project while I was researching it for a potential replacement on JaCoCo.
While exploring
0.8.0-Beta2
usage and internals (source code), I've identified some pain points in the current experimental DSL, that IMHO should be addressed by leveraging Gradle-managed objects, likeNamedDomainObjectContainer
and its variants.I didn't scan fully what the project has to offer, like
filtering
, etc. So you may consider this as partial feedback.Describe the solution you'd like
Child closures in DSL
The main
kover: KoverProjectExtension
extension has several child closures, likereports: KoverReportsConfig
.These closures can only be accessed by calling a method (i.e.
kover.reports { }
).As my current understanding of Gradle's patterns, child closures should be accessible by property or method closure, so the following two syntaxes should be valid and equivalent:
kover.reports.doSomething() // and kover.reports { doSomething() }
This can easily be achieved by changing a bit the DSL object definition, i.e.:
kover.variants
DSLKover currently supports (as far I noted) three types of variants:
provided
,customer
, andtotal
It would be nice if you iterate the DSL to be able to access all declared variants with a
NamedDomainObjectSet
(at least), or even better, use aPolymorphicDomainObjectContainer
to also use Gradle's standard API for creating them.For instance, having:
This could be a basic implementation for
KoverVariantsContainer
:You could have a richer DSL, supporting many use cases out of the box:
Iterating all variants in a hot collection
Configuring variant in a generic way
Imaging #599 is implemented in a way that
KoverVariant
now has anaggregate
property.We can target all
debug
variants at once with:Simplified plugin internal wiring
Currently, your plugin has some manual checks to prevent variants of different types from collishing with others with the same name.
If you centralize that into a root
NamedDomainObjectContainer
, this problem will be gone (less code).Later the plugin can just react on others, like Android one, and automatically register
provided
ones:The text was updated successfully, but these errors were encountered: