Skip to content

Commit

Permalink
Format only change
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed Jun 23, 2024
1 parent 13f7d50 commit d3eb31c
Showing 1 changed file with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ private static final class Ctx {

Ctx(ProcessingEnvironment env) {
var elements = env.getElementUtils();

this.injectPresent = elements.getTypeElement(Constants.COMPONENT) != null;
this.warnHttp = elements.getTypeElement("io.avaje.http.api.Controller") != null;
this.spiPresent = elements.getTypeElement("io.avaje.spi.internal.ServiceProcessor") != null;

final var jakarta = elements.getTypeElement(Constants.SINGLETON_JAKARTA) != null;

diAnnotation =
(injectPresent
? Constants.COMPONENT
Expand All @@ -50,7 +48,6 @@ static void init(ProcessingEnvironment processingEnv) {
}

static FileObject createMetaInfWriterFor(String interfaceType) throws IOException {

var serviceFile =
CTX.get().spiPresent
? interfaceType.replace("META-INF/services/", "META-INF/generated-services/")
Expand Down Expand Up @@ -93,15 +90,9 @@ static void validateModule(String fqn) {
&& !moduleInfo.containsOnModulePath("io.avaje.validation.plugin");

if (noHttpPlugin) {
logWarn(
module,
"`requires io.avaje.validation.http` must be explicity added or else avaje-inject may fail to detect the default http validator, validator, and method AOP validator",
fqn);
logWarn(module, "`requires io.avaje.validation.http` must be explicity added or else avaje-inject may fail to detect the default http validator, validator, and method AOP validator", fqn);
} else if (noInjectPlugin) {
logWarn(
module,
"`requires io.avaje.validation.plugin` must be explicity added or else avaje-inject may fail to detect the default validator and method AOP validator",
fqn);
logWarn(module, "`requires io.avaje.validation.plugin` must be explicity added or else avaje-inject may fail to detect the default validator and method AOP validator", fqn);
}

} catch (Exception e) {
Expand All @@ -111,21 +102,18 @@ static void validateModule(String fqn) {
}

private static boolean buildPluginAvailable() {

return resource("target/avaje-plugin-exists.txt", "/target/classes")
|| resource("build/avaje-plugin-exists.txt", "/build/classes/java/main");
}

private static boolean resource(String relativeName, String replace) {
try (var inputStream =
new URI(
filer()
.getResource(StandardLocation.CLASS_OUTPUT, "", relativeName)
.toUri()
.toString()
.replace(replace, ""))
.toURL()
.openStream()) {
new URI(filer().getResource(StandardLocation.CLASS_OUTPUT, "", relativeName)
.toUri()
.toString()
.replace(replace, ""))
.toURL()
.openStream()) {

return inputStream.available() > 0;
} catch (IOException | URISyntaxException e) {
Expand Down

0 comments on commit d3eb31c

Please sign in to comment.