Skip to content

Commit

Permalink
Use Google's auto service to generate service descriptor files
Browse files Browse the repository at this point in the history
Task-number: #22
  • Loading branch information
Paullo612 committed May 24, 2023
1 parent fe38709 commit 0205d33
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
9 changes: 8 additions & 1 deletion compiler/compiler-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
Expand All @@ -52,6 +52,13 @@
<version>${antlr4.version}</version>
</dependency>

<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.1.0</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject-java-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package io.github.paullo612.mlfx.compiler;

import com.google.auto.service.AutoService;
import io.github.paullo612.mlfx.api.CompileFXML;
import io.github.paullo612.mlfx.api.CompiledFXMLLoader;
import io.micronaut.core.annotation.AnnotationMetadata;
Expand All @@ -41,6 +42,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

@AutoService(TypeElementVisitor.class)
public class CompileFXMLVisitor implements TypeElementVisitor<CompileFXML, Object> {

private static boolean MICRONAUT_VERSION_CHECK_DONE;
Expand Down

This file was deleted.

9 changes: 8 additions & 1 deletion compiler/micronaut/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.1.0</version>
<optional>true</optional>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package io.github.paullo612.mlfx.compiler.micronaut;

import com.google.auto.service.AutoService;
import io.github.paullo612.mlfx.api.CompiledFXMLLoader;
import io.github.paullo612.mlfx.api.GeneratedByMLFX;
import io.github.paullo612.mlfx.compiler.CompileFXMLVisitor;
Expand All @@ -36,6 +37,7 @@
import java.util.Set;
import java.util.TreeSet;

@AutoService(TypeElementVisitor.class)
public class CompileFXMLMicronautVisitor implements TypeElementVisitor<GeneratedByMLFX, Object> {

private final Set<ClassElement> services = new TreeSet<>(Comparator.comparing(Element::getName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package io.github.paullo612.mlfx.compiler.micronaut;

import com.google.auto.service.AutoService;
import io.github.paullo612.mlfx.compiler.CompileFXMLVisitor;
import io.micronaut.context.annotation.Executable;
import io.micronaut.core.annotation.AnnotationValue;
Expand All @@ -32,6 +33,7 @@
import java.util.List;
import java.util.Set;

@AutoService(TypeElementVisitor.class)
public class FXMLMicronautVisitor implements TypeElementVisitor<Object, Object> {

private static final String FXML_ANNOTATION = "javafx.fxml.FXML";
Expand Down

This file was deleted.

0 comments on commit 0205d33

Please sign in to comment.