Skip to content

Commit

Permalink
remove initialize-at-runtime definitions (#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher authored Jul 10, 2024
1 parent 707967a commit 9d8daf8
Showing 1 changed file with 10 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@
import io.micronaut.core.naming.NameUtils;
import io.micronaut.inject.visitor.TypeElementVisitor;
import jakarta.inject.Singleton;

import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Filer;
import javax.annotation.processing.Messager;
Expand All @@ -60,20 +69,7 @@
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
import javax.tools.Diagnostic;
import javax.tools.FileObject;
import javax.tools.JavaFileObject;
import javax.tools.StandardLocation;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Stream;

/**
* An annotation processor that generates the Oracle Cloud SDK integration
Expand Down Expand Up @@ -133,24 +129,6 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
}
}

if (!factoryClassNames.isEmpty()) {
try {
final FileObject nativeImageProps = filer.createResource(
StandardLocation.CLASS_OUTPUT,
"",
"META-INF/native-image/io.micronaut.oraclecloud/micronaut-oraclecloud-sdk/native-image.properties",
e

);
Properties properties = new Properties();
properties.put("Args", "--initialize-at-run-time=" + String.join(",", factoryClassNames));
try (Writer writer = nativeImageProps.openWriter()) {
properties.store(writer, "Generated Native Image Configuration");
}
} catch (IOException ioException) {
messager.printMessage(Diagnostic.Kind.ERROR, "Failed to write native image config: " + ioException.getMessage());
}
}
}
}
return false;
Expand Down

0 comments on commit 9d8daf8

Please sign in to comment.