Repository navigation
Project scopes skip a Gradle module whose directory is named target
#2123
Replies: 1 comment 1 reply
|
This comes from the directory filter of the project scan. In 1.0.0-beta.1 a directory named (segment in BUILD_OUTPUT_DIRS && (index < sourceDirIndex || isLocatedInModuleDirectory(segments, index)))
Workaround: private val targetModule = Konsist.scopeFromDirectory("feature/target")
val projectScope = Konsist.scopeFromProject() + targetModule
val productionScope = Konsist.scopeFromProduction() +
targetModule.slice { it.sourceSetName.isNotEmpty() && !it.sourceSetName.contains("test", ignoreCase = true) }Renaming the directory also works. The filter is unchanged on |
Uh oh!
There was an error while loading. Please reload this page.
Tell us what version of Konsist you use.
1.0.0-beta.1
Was this something which used to work for you, and then stopped?
I am trying to get this working for the first time
Describe the problem
Konsist leaves out the files of a Gradle module when the module's directory is named
target.For example, a module at
feature/targetkeeps its sources infeature/target/src/main/kotlin. None of its files show up inKonsist.scopeFromProject()orKonsist.scopeFromProduction(). The files of the other modules do.So rules that use these scopes pass for that module without checking it. Nothing warns about it.
Actual behaviour
The files of
feature/targetare missing fromscopeFromProject()andscopeFromProduction().Expected behaviour
The files of
feature/targetare in both scopes, like the files of any other module.All reactions