Question: Suppose I have two properties for which ...
# plugin-development
k
Question: Suppose I have two properties for which we want one of them (doesn't matter which one) needs to be set, as the other can be derived. Is it OK to wire conventions ahead of time? eg.
Copy code
abstract val property1: Property<String>
abstract val property2: Property<String>

init {
    property1.convention(property2.map { ... })
    property2.convention(property1.map { ... })
}
If so, what can we do to avoid circular shenanigans in case neither are set?
👀 1
t
super smelly to me because of the circle potential. can you do a single property that has an
if
or
when
in a map fed as a convention so it is just a single input point?
seems like this might be something like "check for project property, or check for env var. then map one of these to both properties"