Open ArturoBlazquez opened 10 months ago
You could already use [@AnalyzeClasses
's packagesOf
](https://javadoc.io/doc/com.tngtech.archunit/archunit-junit5-api/latest/com/tngtech/archunit/junit/AnalyzeClasses.html#packagesOf()):
@AnalyzeClasses(packagesOf = {First.class, Second.class})
public class MyArchitectureTest {
// ...
}
This will however not only import First
and Second
, but their entire packages.
If your rules only apply to those classes, I'd be explicit about that in the rule definition.
There are times when there are architecture rules that only apply to some classes, but that are not on the same package. It would be nice if we could do something similar to this
Something similar can be achieved using
locations
, but it implies either adding a lot of boilerplate codeor having to develop a custom solution like this one, that still isn't completely clean as it implies adding an extra annotation