jraska / jraska/modules-graph-assert
moduleNameAssertAlias vs module name
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 640
- Forks
- 35
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 1
Description
When ext.moduleNameAssertAlias is set, there is no available to allow dependency by its name. There is available to use moduleNameAssertAlias value ONLY.
I would like to use moduleNameAssertAlias AND module name in regex at the same time.
For example modules:
- composeApp
- libUi
- libImpl
- testUi
- testImpl
When add val moduleNameAssertAlias: String by extra("Ui") in shared:libUi gradle module i am not able to use it in allow regex like:
moduleGraphAssert {
configurations += setOf("commonMainImplementation", "commonMainApi")
maxHeight = 3
allowed = arrayOf(
// ":composeApp -> Ui",
":composeApp -> :shared:libUi",
".*Ui -> ^(?!.*Ui$).*",
"^(?!.*Ui).* -> .*",
)
restricted = arrayOf(
)
assertOnAnyBuild = true
}
if comment moduleNameAssertAlias in gradle file, the allow array accepts condition: ":composeApp -> :shared:libUi",
But i would like to use in condition moduleNameAssertAlias and module name at the same time to compare them.
The compare string could be Ui"(':shared:libUi') like you write in exception:
[':composeApp' -> ':shared', ':composeApp' -> "Ui"(':shared:libUi')] not allowed by any of [':composeApp -> :shared:libUi', '.*Ui -> ^(?!.*Ui$).*', '^(?!.*Ui).* -> .*']
Example project
MyApplication.zip
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the attached MyApplication.zip and the moduleGraphAssert configuration shown in the report. Trace how moduleNameAssertAlias and the module name are represented when allow patterns are matched. Done means a rule can compare both forms in one expression while existing alias-only and module-name-only patterns continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100