Skip to content

Commit 05bfda7

Browse files
committed
remove warning in the build
1 parent 9e612b6 commit 05bfda7

3 files changed

Lines changed: 32 additions & 11 deletions

File tree

build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@ tasks.named("sourcesJar") {
270270
dependsOn(copyFlecsNative, tasks.compileJava)
271271
}
272272

273+
tasks.withType<Javadoc>().configureEach {
274+
(options as? StandardJavadocDocletOptions)?.apply {
275+
addBooleanOption("Xdoclint:none", true)
276+
addStringOption("quiet", "-quiet")
277+
}
278+
}
279+
273280
configure<io.github.gradlenexus.publishplugin.NexusPublishExtension> {
274281
repositories {
275282
sonatype {

src/main/java/com/github/elebras1/flecs/processor/FlecsComponentProcessor.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class FlecsComponentProcessor extends AbstractProcessor {
1919
private ComponentCodeGenerator generator;
2020
private ComponentMapGenerator mapGenerator;
2121
private List<TypeElement> processedComponents;
22+
private boolean mapGenerated;
2223

2324
@Override
2425
public synchronized void init(ProcessingEnvironment processingEnv) {
@@ -28,6 +29,7 @@ public synchronized void init(ProcessingEnvironment processingEnv) {
2829
this.generator = new ComponentCodeGenerator();
2930
this.mapGenerator = new ComponentMapGenerator();
3031
this.processedComponents = new ArrayList<>();
32+
this.mapGenerated = false;
3133
}
3234

3335
@Override
@@ -39,15 +41,6 @@ public SourceVersion getSupportedSourceVersion() {
3941
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
4042

4143
if (roundEnv.processingOver()) {
42-
if (!this.processedComponents.isEmpty()) {
43-
try {
44-
JavaFile mapFile = this.mapGenerator.generateComponentMap(this.processedComponents);
45-
mapFile.writeTo(this.filer);
46-
this.messager.printMessage(Diagnostic.Kind.NOTE, "[@FlecsComponent] Generated ComponentMap with " + processedComponents.size() + " components");
47-
} catch (IOException e) {
48-
this.messager.printMessage(Diagnostic.Kind.ERROR, "Failed to generate ComponentMap: " + e.getMessage());
49-
}
50-
}
5144
return false;
5245
}
5346

@@ -69,6 +62,16 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
6962
}
7063
}
7164

65+
if (!this.mapGenerated && !this.processedComponents.isEmpty() && annotations.isEmpty()) {
66+
try {
67+
JavaFile mapFile = this.mapGenerator.generateComponentMap(this.processedComponents);
68+
mapFile.writeTo(this.filer);
69+
this.mapGenerated = true;
70+
} catch (IOException e) {
71+
this.messager.printMessage(Diagnostic.Kind.ERROR, "Failed to generate ComponentMap: " + e.getMessage());
72+
}
73+
}
74+
7275
return true;
7376
}
7477

@@ -85,8 +88,6 @@ private void processRecord(TypeElement recordElement) throws IOException {
8588

8689
JavaFile javaFile = generator.generateComponentClass(recordElement, fields);
8790
javaFile.writeTo(filer);
88-
89-
this.messager.printMessage(Diagnostic.Kind.NOTE, "[@FlecsComponent] Generated: " + recordElement.getQualifiedName());
9091
}
9192

9293
private List<VariableElement> extractRecordComponents(TypeElement recordElement) {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.github.elebras1.flecs.util.internal;
2+
3+
import com.github.elebras1.flecs.annotation.FlecsComponent;
4+
5+
/**
6+
* Internal dummy component to trigger annotation processing.
7+
* Not for direct use.
8+
*/
9+
@FlecsComponent
10+
public record InternalComponent() {
11+
}
12+
13+

0 commit comments

Comments
 (0)