Resolving circular included builds

Suppose in my Gradle project I have two included builds, A and B. In A/settings.gradle.kts I have

includeBuild("../B")

and likewise I have in B/settings.gradle.kts I have

includeBuild("../A")

Of course, this would obviously cause things to fail to build, but there are likely use cases where you might see this happen (for example, if A was a convention plugin that sets a project’s version, and B was a convention plugin that configures publishing settings).

What’s the best way to resolve such circular inclusions?