forked from helidon-io/helidon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4.x: Inject update - collateral (helidon-io#8281)
* Introduction of codegen modules * Refactoring of modules to use new builder codegen (remove use of config metadata for builders) * Deprecated old processor modules (such as builder processor) Co-authored-by: Daniel Kec <daniel.kec@oracle.com> Co-authored-by: Jeff Trent <jeff.trent@oracle.com> Co-authored-by: David Kral <david.kral@oracle.com> Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
- Loading branch information
1 parent
601fbad
commit 2553fdb
Showing
294 changed files
with
22,724 additions
and
902 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2022, 2024 Oracle and/or its affiliates. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>io.helidon.builder</groupId> | ||
<artifactId>helidon-builder-project</artifactId> | ||
<version>4.0.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>helidon-builder-codegen</artifactId> | ||
<name>Helidon Builder Code Generator</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.helidon.common</groupId> | ||
<artifactId>helidon-common-types</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.codegen</groupId> | ||
<artifactId>helidon-codegen</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.codegen</groupId> | ||
<artifactId>helidon-codegen-class-model</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>hamcrest-all</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
33 changes: 33 additions & 0 deletions
33
builder/codegen/src/main/java/io/helidon/builder/codegen/AnnotationDataBlueprint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2023, 2024 Oracle and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.helidon.builder.codegen; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import io.helidon.common.types.TypeName; | ||
|
||
record AnnotationDataBlueprint( | ||
boolean prototypePublic, | ||
boolean builderPublic, | ||
boolean createFromConfigPublic, | ||
boolean createEmptyPublic, | ||
boolean isFactory, | ||
Set<TypeName> extendsList, | ||
String javadoc, | ||
List<TypeName> typeArguments) { | ||
} |
41 changes: 41 additions & 0 deletions
41
builder/codegen/src/main/java/io/helidon/builder/codegen/AnnotationDataConfigured.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 2023, 2024 Oracle and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.helidon.builder.codegen; | ||
|
||
import io.helidon.common.types.Annotation; | ||
import io.helidon.common.types.TypeInfo; | ||
|
||
record AnnotationDataConfigured(boolean configured, String rootPrefix, boolean isRoot) { | ||
static AnnotationDataConfigured create(TypeInfo typeInfo) { | ||
boolean configured = false; | ||
boolean isRoot = false; | ||
String prefix = null; | ||
|
||
if (typeInfo.hasAnnotation(Types.PROTOTYPE_CONFIGURED)) { | ||
configured = true; | ||
|
||
Annotation annotation = typeInfo.annotation(Types.PROTOTYPE_CONFIGURED); | ||
// if the annotation is present, the value has to be defined (may be empty string) | ||
prefix = annotation.stringValue().orElse(null); | ||
if (prefix != null) { | ||
isRoot = annotation.booleanValue("root").orElse(true); | ||
} | ||
} | ||
|
||
return new AnnotationDataConfigured(configured, prefix, isRoot); | ||
} | ||
} |
Oops, something went wrong.