-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade svm, annotation for reflection (#2070)
* Upgrade svm libraries. Annotation for reflection in native image. Signed-off-by: Tomas Langer <tomas.langer@oracle.com> * Missed required class. Signed-off-by: Tomas Langer <tomas.langer@oracle.com> Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
- Loading branch information
1 parent
05e89c5
commit 093ec0d
Showing
10 changed files
with
330 additions
and
136 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
common/common/src/main/java/io/helidon/common/Reflected.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,39 @@ | ||
/* | ||
* Copyright (c) 2020 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.common; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* A type annotated with this annotation will be added to native image with reflection support for all methods | ||
* and fields (including private). | ||
* A method or field annotated with this method will be added for reflection. | ||
* <p> | ||
* This is an alternative to GraalVM native-image's {@code reflect-config.json} file, specific to Helidon. | ||
* Processing of this annotation requires {@code io.helidon.integrations.graal:helidon-graal-native-image-extension} | ||
* on the classpath when building native image. | ||
* <p> | ||
* Constructors annotated with this annotation would only be added for reflection if either a field | ||
* or a method is annotated as well (this is current limitation of API of native image). | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR}) | ||
public @interface Reflected { | ||
} |
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
9 changes: 0 additions & 9 deletions
9
...-image/io.helidon.examples.dbclient/helidon-examples-dbclient-pokemon/reflect-config.json
This file was deleted.
Oops, something went wrong.
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
4 changes: 3 additions & 1 deletion
4
...grations/db/ojdbc/src/main/resources/META-INF/helidon/native-image/reflection-config.json
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"classes": [ | ||
"org.hibernate.dialect.Oracle10gDialect" | ||
"org.hibernate.dialect.Oracle10gDialect", | ||
"oracle.jdbc.logging.annotations.Supports", | ||
"oracle.jdbc.logging.annotations.Feature" | ||
] | ||
} |
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
Oops, something went wrong.