-
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.
reflect-config.json generation capability
- Loading branch information
Showing
10 changed files
with
260 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# native-helper-graalvm generation configuration | ||
--- | ||
reflectConfigJsonOutputPath: src/main/resources/META-INF/native-image/reflect-config.json | ||
createParentDirectory: true | ||
generate: | ||
- className: org.fugerit.java.nhg.reflect.config.Entry | ||
mode: getters | ||
- className: org.fugerit.java.nhg.reflect.config.EntryCondition | ||
mode: getters | ||
- className: org.fugerit.java.nhg.reflect.config.EntryField | ||
mode: getters | ||
- className: org.fugerit.java.nhg.reflect.config.EntryMethod | ||
mode: getters | ||
- className: org.fugerit.java.nhg.config.model.NativeHelperConfig | ||
mode: getters_setters | ||
typeReachable: org.fugerit.java.nhg.config.NativeHelperFacade | ||
- className: org.fugerit.java.nhg.config.model.GenerateConfig | ||
mode: getters_setters | ||
typeReachable: org.fugerit.java.nhg.config.NativeHelperFacade |
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
139 changes: 139 additions & 0 deletions
139
src/main/resources/META-INF/native-image/reflect-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 |
---|---|---|
@@ -0,0 +1,139 @@ | ||
[ { | ||
"name" : "org.fugerit.java.nhg.reflect.config.Entry", | ||
"fields" : [ ], | ||
"methods" : [ { | ||
"name" : "<init>", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "<init>", | ||
"parameterTypes" : [ "java.lang.String" ] | ||
}, { | ||
"name" : "getClass", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getCondition", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getFields", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getMethods", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getName", | ||
"parameterTypes" : [ ] | ||
} ] | ||
}, { | ||
"name" : "org.fugerit.java.nhg.reflect.config.EntryCondition", | ||
"fields" : [ ], | ||
"methods" : [ { | ||
"name" : "<init>", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "<init>", | ||
"parameterTypes" : [ "java.lang.String" ] | ||
}, { | ||
"name" : "getClass", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getTypeReachable", | ||
"parameterTypes" : [ ] | ||
} ] | ||
}, { | ||
"name" : "org.fugerit.java.nhg.reflect.config.EntryField", | ||
"fields" : [ ], | ||
"methods" : [ { | ||
"name" : "<init>", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "<init>", | ||
"parameterTypes" : [ "java.lang.String" ] | ||
}, { | ||
"name" : "getClass", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getName", | ||
"parameterTypes" : [ ] | ||
} ] | ||
}, { | ||
"name" : "org.fugerit.java.nhg.reflect.config.EntryMethod", | ||
"fields" : [ ], | ||
"methods" : [ { | ||
"name" : "<init>", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "<init>", | ||
"parameterTypes" : [ "java.lang.String" ] | ||
}, { | ||
"name" : "getClass", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getName", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getParameterTypes", | ||
"parameterTypes" : [ ] | ||
} ] | ||
}, { | ||
"condition" : { | ||
"typeReachable" : "org.fugerit.java.nhg.config.NativeHelperFacade" | ||
}, | ||
"name" : "org.fugerit.java.nhg.config.model.NativeHelperConfig", | ||
"fields" : [ ], | ||
"methods" : [ { | ||
"name" : "<init>", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getClass", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getGenerate", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getReflectConfigJsonOutputPath", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "setCreateParentDirectory", | ||
"parameterTypes" : [ "boolean" ] | ||
}, { | ||
"name" : "setGenerate", | ||
"parameterTypes" : [ "java.util.List" ] | ||
}, { | ||
"name" : "setReflectConfigJsonOutputPath", | ||
"parameterTypes" : [ "java.lang.String" ] | ||
} ] | ||
}, { | ||
"condition" : { | ||
"typeReachable" : "org.fugerit.java.nhg.config.NativeHelperFacade" | ||
}, | ||
"name" : "org.fugerit.java.nhg.config.model.GenerateConfig", | ||
"fields" : [ ], | ||
"methods" : [ { | ||
"name" : "<init>", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getClass", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getClassName", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getMode", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "getTypeReachable", | ||
"parameterTypes" : [ ] | ||
}, { | ||
"name" : "setClassName", | ||
"parameterTypes" : [ "java.lang.String" ] | ||
}, { | ||
"name" : "setMode", | ||
"parameterTypes" : [ "java.lang.String" ] | ||
}, { | ||
"name" : "setSkipConstructors", | ||
"parameterTypes" : [ "boolean" ] | ||
}, { | ||
"name" : "setTypeReachable", | ||
"parameterTypes" : [ "java.lang.String" ] | ||
} ] | ||
} ] |
27 changes: 27 additions & 0 deletions
27
src/test/java/test/org/fugerit/java/nhg/TestGenerateLibraryConfiguration.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,27 @@ | ||
package test.org.fugerit.java.nhg; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.fugerit.java.nhg.GenerateReflectConfig; | ||
import org.fugerit.java.nhg.config.NativeHelperFacade; | ||
import org.fugerit.java.nhg.config.model.NativeHelperConfig; | ||
import org.fugerit.java.nhg.reflect.config.Entry; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
import java.io.StringWriter; | ||
import java.util.List; | ||
|
||
@Slf4j | ||
class TestGenerateLibraryConfiguration { | ||
|
||
private static final String NATIVE_HELPER_CONFIG_PATH = "src/main/config/native-helper-config.yaml"; | ||
|
||
@Test | ||
void generateLibraryConfiguration() throws IOException { | ||
// reads configuration | ||
NativeHelperConfig config = NativeHelperFacade.loadAndGenerate( NATIVE_HELPER_CONFIG_PATH ); | ||
Assertions.assertNotNull( config ); | ||
} | ||
|
||
} |
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,15 @@ | ||
#Sample native helper config file | ||
--- | ||
generate: | ||
- className: org.fugerit.java.nhg.reflect.config.Entry | ||
skipConstructors: true | ||
mode: getters | ||
- className: org.fugerit.java.nhg.reflect.config.EntryCondition | ||
skipConstructors: true | ||
mode: getters | ||
- className: org.fugerit.java.nhg.reflect.config.EntryField | ||
skipConstructors: true | ||
mode: getters | ||
- className: org.fugerit.java.nhg.reflect.config.EntryMethod | ||
skipConstructors: true | ||
mode: getters |