File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
spring-modulith-core/src/main/java/org/springframework/modulith/core Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 44
44
import org .springframework .util .function .SingletonSupplier ;
45
45
46
46
import com .tngtech .archunit .base .DescribedPredicate ;
47
+ import com .tngtech .archunit .core .domain .JavaAnnotation ;
47
48
import com .tngtech .archunit .core .domain .JavaClass ;
48
49
import com .tngtech .archunit .core .domain .JavaClasses ;
50
+ import com .tngtech .archunit .core .domain .JavaType ;
49
51
import com .tngtech .archunit .core .domain .properties .CanBeAnnotated ;
50
52
import com .tngtech .archunit .core .domain .properties .HasName ;
51
53
import com .tngtech .archunit .core .importer .ClassFileImporter ;
@@ -67,12 +69,17 @@ public class ApplicationModules implements Iterable<ApplicationModule> {
67
69
private static final ImportOption IMPORT_OPTION = new ImportOption .DoNotIncludeTests ();
68
70
private static final boolean JGRAPHT_PRESENT = ClassUtils .isPresent ("org.jgrapht.Graph" ,
69
71
ApplicationModules .class .getClassLoader ());
70
- private static final DescribedPredicate <CanBeAnnotated > IS_AOT_TYPE ;
72
+ private static final DescribedPredicate <CanBeAnnotated > IS_AOT_TYPE , IS_GENERATED ;
71
73
private static final DescribedPredicate <HasName > IS_SPRING_CGLIB_PROXY = nameContaining ("$$SpringCGLIB$$" );
72
74
73
75
static {
76
+
74
77
IS_AOT_TYPE = ClassUtils .isPresent ("org.springframework.aot.generate.Generated" ,
75
78
ApplicationModules .class .getClassLoader ()) ? getAtGenerated () : DescribedPredicate .alwaysFalse ();
79
+
80
+ IS_GENERATED = annotatedWith (JavaClass .Predicates .simpleName ("Generated" )
81
+ .onResultOf (JavaType ::toErasure )
82
+ .onResultOf (JavaAnnotation ::getType ));
76
83
}
77
84
78
85
@ Nullable
You can’t perform that action at this time.
0 commit comments