Skip to content

Regex variables/found groups #326

@krystek-dev

Description

@krystek-dev

I would like to have usable groups found in regex to use in the condition.

For example modules:

  • composeApp
  • libUi
  • libImpl
  • testUi
  • testImpl
  • another

Would like to specify that Ui modules could depends only its impl module.
It means libUi could depends ONLY libImpl and no more impl modules.
The same for testUi could depends only testImpl. There is prohibited to depends libImpl from testUi.

So i would like to specify regex like: (.*)Ui
Which means there are two groups:
0. all the string

  1. (.*) before Ui string, that means for libUi it is lib string

And then in allowed array would like to write something like:

moduleGraphAssert {
    configurations += setOf("commonMainImplementation", "commonMainApi")
    maxHeight = 3
    allowed = arrayOf(
        "(.*)Ui$ -> $1lib$",
    )
    restricted = arrayOf(
    )
    assertOnAnyBuild = true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions