Skip to content

Commit 5446214

Browse files
author
Soroosh Sarabadani
committed
move the resource class metadata to sub directory called "javaoperatorsdk"
1 parent e07d463 commit 5446214

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

operator-framework/src/main/java/io/javaoperatorsdk/operator/ControllerUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class ControllerUtils {
2121

2222
static {
2323
try {
24-
final Enumeration<URL> customResourcesMetadaList = ControllerUtils.class.getClassLoader().getResources("javaoperatorsdk-custom-resources");
24+
final Enumeration<URL> customResourcesMetadaList = ControllerUtils.class.getClassLoader().getResources("javaoperatorsdk/controllers");
2525
for (Iterator<URL> it = customResourcesMetadaList.asIterator(); it.hasNext(); ) {
2626
URL url = it.next();
2727
final List<String> classNamePairs = Files.lines(Path.of(url.getPath()))

operator-framework/src/main/java/io/javaoperatorsdk/operator/processing/ControllerAnnotationProcessor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class ControllerAnnotationProcessor extends AbstractProcessor {
3737
public synchronized void init(ProcessingEnvironment processingEnv) {
3838
super.init(processingEnv);
3939
try {
40-
resource = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", "javaoperatorsdk-custom-resources");
40+
resource = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", "javaoperatorsdk/controllers");
4141
} catch (IOException e) {
4242
throw new RuntimeException(e);
4343
}
@@ -50,11 +50,13 @@ public synchronized void init(ProcessingEnvironment processingEnv) {
5050

5151
@Override
5252
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
53-
53+
System.out.println("annotatedElements:");
5454
try {
5555
for (TypeElement annotation : annotations) {
5656
Set<? extends Element> annotatedElements
5757
= roundEnv.getElementsAnnotatedWith(annotation);
58+
System.out.println("annotatedElements:");
59+
System.out.println(annotatedElements);
5860
annotatedElements.stream().filter(element -> element.getKind().equals(ElementKind.CLASS))
5961
.map(e -> (TypeElement) e)
6062
.forEach(e -> this.generateDoneableClass(e, printWriter));

0 commit comments

Comments
 (0)