diff options
author | zaaarf <zaaarf@proton.me> | 2023-02-26 21:22:58 +0100 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-02-26 21:22:58 +0100 |
commit | 08e55d42f42a55d1d5e9fc73e0e2cc463380a402 (patch) | |
tree | d1511fe8f834e6b855e043141bcad56d6ec10c11 | |
parent | 96b2bc553664892d476e0ca35a919eb20c7d1cb2 (diff) |
feat: maybe gotten it working, i probably don't need a plugin after all
7 files changed, 6 insertions, 25 deletions
diff --git a/build.gradle b/build.gradle index 24865be..2306529 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'java-gradle-plugin' + id 'java' } group 'ftbsc.lll.processor' @@ -13,13 +13,4 @@ dependencies { implementation 'com.squareup:javapoet:1.13.0' implementation 'ftbsc:lll:0.2.0' implementation 'org.ow2.asm:asm-commons:9.4' //just for the javadocs -} - -gradlePlugin { - plugins { - create("lillero-processor") { - id = "ftbsc.lll.processor" - implementationClass = "ftbsc.lll.processor.Plugin" - } - } }
\ No newline at end of file diff --git a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java index 1839183..1b2cd63 100644 --- a/src/main/java/ftbsc/lll/processor/LilleroProcessor.java +++ b/src/main/java/ftbsc/lll/processor/LilleroProcessor.java @@ -279,7 +279,7 @@ public class LilleroProcessor extends AbstractProcessor { */ private void generateServiceProvider(Set<TypeElement> inj) { try { - FileObject serviceProvider = processingEnv.getFiler().createResource(StandardLocation.SOURCE_OUTPUT, "", "ftbsc.lll.IInjector"); + FileObject serviceProvider = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", "ftbsc.lll.IInjector"); PrintWriter out = new PrintWriter(serviceProvider.openWriter()); inj.forEach(i -> out.println(i.getQualifiedName() + "Injector")); out.close(); diff --git a/src/main/java/ftbsc/lll/processor/Main.java b/src/main/java/ftbsc/lll/processor/Main.java deleted file mode 100644 index 54de47b..0000000 --- a/src/main/java/ftbsc/lll/processor/Main.java +++ /dev/null @@ -1,11 +0,0 @@ -package ftbsc.lll.processor; - -import org.gradle.api.Plugin; -import org.gradle.api.Project; - -public class Main implements Plugin<Project> { - @Override - public void apply(Project project) { - - } -} diff --git a/src/main/java/ftbsc/lll/processor/annotations/Injector.java b/src/main/java/ftbsc/lll/processor/annotations/Injector.java index 32c91c3..df523ac 100644 --- a/src/main/java/ftbsc/lll/processor/annotations/Injector.java +++ b/src/main/java/ftbsc/lll/processor/annotations/Injector.java @@ -16,6 +16,6 @@ import org.objectweb.asm.tree.MethodNode; * @see Patch * @see Target */ -@Retention(RetentionPolicy.SOURCE) +@Retention(RetentionPolicy.CLASS) @java.lang.annotation.Target(ElementType.METHOD) public @interface Injector {} diff --git a/src/main/java/ftbsc/lll/processor/annotations/Patch.java b/src/main/java/ftbsc/lll/processor/annotations/Patch.java index 9b0f5da..80416ae 100644 --- a/src/main/java/ftbsc/lll/processor/annotations/Patch.java +++ b/src/main/java/ftbsc/lll/processor/annotations/Patch.java @@ -11,7 +11,7 @@ import java.lang.annotation.RetentionPolicy; * @see Target * @see Injector */ -@Retention(RetentionPolicy.SOURCE) +@Retention(RetentionPolicy.CLASS) @java.lang.annotation.Target(ElementType.TYPE) public @interface Patch { /** diff --git a/src/main/java/ftbsc/lll/processor/annotations/Target.java b/src/main/java/ftbsc/lll/processor/annotations/Target.java index 14b4e7c..3a1d209 100644 --- a/src/main/java/ftbsc/lll/processor/annotations/Target.java +++ b/src/main/java/ftbsc/lll/processor/annotations/Target.java @@ -13,6 +13,6 @@ import java.lang.annotation.RetentionPolicy; * @see Patch * @see Injector */ -@Retention(RetentionPolicy.SOURCE) +@Retention(RetentionPolicy.CLASS) @java.lang.annotation.Target(ElementType.METHOD) public @interface Target {} diff --git a/src/main/resources/META-INF/gradle/incremental.annotation.processors b/src/main/resources/META-INF/gradle/incremental.annotation.processors new file mode 100644 index 0000000..8f9ef31 --- /dev/null +++ b/src/main/resources/META-INF/gradle/incremental.annotation.processors @@ -0,0 +1 @@ +ftbsc.lll.LilleroProcessor,isolating
\ No newline at end of file |