Skip to content

Commit a644034

Browse files
committed
Fix annotation processing for Java 24+
1 parent a190806 commit a644034

11 files changed

Lines changed: 89 additions & 14 deletions

File tree

.github/workflows/samples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- run: $MVN install
2020
working-directory: bom
2121
- run: $MVN install
22-
- run: mvn -Denvironment.base=/elemento/samples/music -P prod install
22+
- run: $MVN -Denvironment.base=/elemento/samples/music -P prod install
2323
working-directory: samples
2424
- uses: JamesIves/github-pages-deploy-action@v4.8.0
2525
with:

core/src/main/java/org/jboss/elemento/package-info.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2023 Red Hat
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
/**
217
* Elemento simplifies working with GWT Elemental2 by providing a fluent API for building HTML element hierarchies, typesafe CSS
318
* selectors, and helper methods for common DOM operations.

flow/src/main/java/org/jboss/elemento/flow/package-info.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2023 Red Hat
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
/**
217
* Provides an API for executing asynchronous tasks in parallel, sequentially, or repeatedly based on conditions.
318
*

mathml/src/main/java/org/jboss/elemento/mathml/package-info.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2023 Red Hat
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
/**
217
* Provides support for creating and manipulating MathML (Mathematical Markup Language) elements using a fluent builder API.
318
*

router-processor-cdi/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@
5151

5252
<build>
5353
<plugins>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-compiler-plugin</artifactId>
57+
<configuration>
58+
<annotationProcessorPaths>
59+
<path>
60+
<groupId>com.google.auto.service</groupId>
61+
<artifactId>auto-service</artifactId>
62+
<version>${version.auto.service}</version>
63+
</path>
64+
</annotationProcessorPaths>
65+
</configuration>
66+
</plugin>
5467
<plugin>
5568
<groupId>org.apache.maven.plugins</groupId>
5669
<artifactId>maven-shade-plugin</artifactId>

router-processor-cdi/src/main/java/org/jboss/elemento/router/processor/CdiCodeGenerator.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,22 @@
2222

2323
class CdiCodeGenerator extends CodeGenerator {
2424

25-
private static final String BEAN_MANAGER = "beanManager";
25+
private static final String BEAN_MANAGER_PACKAGE = "org.kie.j2cl.tools.di.core";
26+
private static final String BEAN_MANAGER_CLASS = "BeanManager";
27+
private static final String BEAN_MANAGER_NAME = "beanManager";
2628

2729
@Override
2830
MethodSpec.Builder buildConstructor() {
29-
ClassName beanManagerClass = ClassName.get("org.kie.j2cl.tools.di.core", "BeanManager");
31+
ClassName beanManagerClass = ClassName.get(BEAN_MANAGER_PACKAGE, BEAN_MANAGER_CLASS);
3032
return MethodSpec.constructorBuilder()
3133
.addModifiers(PUBLIC)
32-
.addParameter(beanManagerClass, BEAN_MANAGER)
34+
.addParameter(beanManagerClass, BEAN_MANAGER_NAME)
3335
.addStatement("super()");
3436
}
3537

3638
@Override
3739
void addPlace(MethodSpec.Builder constructor, String placeName, RouteInfo route) {
3840
constructor.addStatement("add($N, () -> $N.lookupBean($L.class).getInstance())",
39-
placeName, BEAN_MANAGER, route.pageClass);
41+
placeName, BEAN_MANAGER_NAME, route.pageClass);
4042
}
4143
}

router-processor-cdi/src/main/java/org/jboss/elemento/router/processor/RouteProcessor.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,11 @@
3333
* new instance of the corresponding Page class.
3434
*/
3535
@AutoService(Processor.class)
36-
@SupportedSourceVersion(SourceVersion.RELEASE_11)
36+
@SupportedSourceVersion(SourceVersion.RELEASE_17)
3737
@SupportedAnnotationTypes({"org.jboss.elemento.router.Loader", "org.jboss.elemento.router.Route"})
3838
@SupportedOptions({"routes.package"})
3939
public class RouteProcessor extends BasicAnnotationProcessor {
4040

41-
@Override
42-
public SourceVersion getSupportedSourceVersion() {
43-
return SourceVersion.RELEASE_11;
44-
}
45-
4641
@Override
4742
protected Iterable<? extends Step> steps() {
4843
return List.of(new LoaderStep(processingEnv), new RouteStep(processingEnv, new CdiCodeGenerator()));

router-processor/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@
7171

7272
<build>
7373
<plugins>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-compiler-plugin</artifactId>
77+
<configuration>
78+
<annotationProcessorPaths>
79+
<path>
80+
<groupId>com.google.auto.service</groupId>
81+
<artifactId>auto-service</artifactId>
82+
<version>${version.auto.service}</version>
83+
</path>
84+
</annotationProcessorPaths>
85+
</configuration>
86+
</plugin>
7487
<plugin>
7588
<groupId>org.apache.maven.plugins</groupId>
7689
<artifactId>maven-shade-plugin</artifactId>

samples/flow/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
<properties>
3535
<npm.skip>false</npm.skip>
36-
<version.patternfly.java>0.4.6</version.patternfly.java>
36+
<version.patternfly.java>0.4.9</version.patternfly.java>
3737
</properties>
3838

3939
<dependencyManagement>

samples/flow/src/main/java/org/jboss/elemento/sample/flow/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
package org.jboss.elemento.sample.flow;
1717

1818
import org.jboss.elemento.By;
19-
import org.patternfly.component.content.ContentType;
2019
import org.patternfly.component.switch_.Switch;
20+
2121
import com.google.gwt.core.client.EntryPoint;
22+
2223
import elemental2.dom.HTMLElement;
2324

2425
import static org.jboss.elemento.Elements.body;
@@ -29,7 +30,6 @@
2930
import static org.patternfly.component.backtotop.BackToTop.backToTop;
3031
import static org.patternfly.component.button.Button.button;
3132
import static org.patternfly.component.content.Content.content;
32-
import static org.patternfly.component.content.ContentType.h1;
3333
import static org.patternfly.component.content.ContentType.p;
3434
import static org.patternfly.component.list.ActionList.actionList;
3535
import static org.patternfly.component.list.ActionListGroup.actionListGroup;

0 commit comments

Comments
 (0)