Skip to content

Commit

Permalink
reflect-config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Mar 24, 2024
1 parent 6e31c49 commit ede7f39
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
[ {
"name" : "org.fugerit.java.emp.sm.service.ServiceMessage",
"methods" : [ {
"name" : "toString",
"name" : "<init>",
"parameterTypes" : [ ]
}, {
"name" : "equals",
"parameterTypes" : [ "java.lang.Object" ]
}, {
"name" : "getClass",
"parameterTypes" : [ ]
}, {
"name" : "getCode",
"parameterTypes" : [ ]
}, {
"name" : "getSeverity",
Expand All @@ -10,10 +19,13 @@
"name" : "getText",
"parameterTypes" : [ ]
}, {
"name" : "setText",
"parameterTypes" : [ "java.lang.String" ]
"name" : "hashCode",
"parameterTypes" : [ ]
}, {
"name" : "getCode",
"name" : "notify",
"parameterTypes" : [ ]
}, {
"name" : "notifyAll",
"parameterTypes" : [ ]
}, {
"name" : "setCode",
Expand All @@ -22,43 +34,52 @@
"name" : "setSeverity",
"parameterTypes" : [ "java.lang.String" ]
}, {
"name" : "wait",
"parameterTypes" : [ "long", "int" ]
"name" : "setText",
"parameterTypes" : [ "java.lang.String" ]
}, {
"name" : "toString",
"parameterTypes" : [ ]
}, {
"name" : "wait",
"parameterTypes" : [ ]
}, {
"name" : "wait",
"parameterTypes" : [ "long" ]
}, {
"name" : "wait",
"parameterTypes" : [ "long", "int" ]
} ]
}, {
"name" : "org.fugerit.java.emp.sm.service.ServiceResponse",
"methods" : [ {
"name" : "<init>",
"parameterTypes" : [ ]
}, {
"name" : "equals",
"parameterTypes" : [ "java.lang.Object" ]
}, {
"name" : "hashCode",
"name" : "getClass",
"parameterTypes" : [ ]
}, {
"name" : "getClass",
"name" : "getErrors",
"parameterTypes" : [ ]
}, {
"name" : "notify",
"name" : "getInfos",
"parameterTypes" : [ ]
}, {
"name" : "notifyAll",
"name" : "getSuccess",
"parameterTypes" : [ ]
}, {
"name" : "<init>",
"name" : "getWarnings",
"parameterTypes" : [ ]
} ]
}, {
"name" : "org.fugerit.java.emp.sm.service.ServiceResponse",
"methods" : [ {
"name" : "getErrors",
}, {
"name" : "hashCode",
"parameterTypes" : [ ]
}, {
"name" : "getInfos",
"name" : "notify",
"parameterTypes" : [ ]
}, {
"name" : "getSuccess",
"name" : "notifyAll",
"parameterTypes" : [ ]
}, {
"name" : "setErrors",
Expand All @@ -69,41 +90,20 @@
}, {
"name" : "setSuccess",
"parameterTypes" : [ "java.util.List" ]
}, {
"name" : "getWarnings",
"parameterTypes" : [ ]
}, {
"name" : "setWarnings",
"parameterTypes" : [ "java.util.List" ]
}, {
"name" : "wait",
"parameterTypes" : [ "long", "int" ]
"name" : "toString",
"parameterTypes" : [ ]
}, {
"name" : "wait",
"parameterTypes" : [ ]
}, {
"name" : "wait",
"parameterTypes" : [ "long" ]
}, {
"name" : "equals",
"parameterTypes" : [ "java.lang.Object" ]
}, {
"name" : "toString",
"parameterTypes" : [ ]
}, {
"name" : "hashCode",
"parameterTypes" : [ ]
}, {
"name" : "getClass",
"parameterTypes" : [ ]
}, {
"name" : "notify",
"parameterTypes" : [ ]
}, {
"name" : "notifyAll",
"parameterTypes" : [ ]
}, {
"name" : "<init>",
"parameterTypes" : [ ]
"name" : "wait",
"parameterTypes" : [ "long", "int" ]
} ]
} ]
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.fugerit.java.nhg.GenerateReflectConfig;
import org.fugerit.java.nhg.ReflectConfigUtil;
import org.fugerit.java.nhg.reflect.config.Entry;
import org.fugerit.java.nhg.reflect.config.EntryHelper;
import org.fugerit.java.nhg.reflect.config.EntryMethod;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
Expand All @@ -19,12 +20,6 @@
@Slf4j
class TestGenerateNative {

private Entry addInit( Entry entry ) {
EntryMethod initMethod = new EntryMethod( "<init>" );
entry.getMethods().add( initMethod );
return entry;
}

@Test
void generateNative() throws IOException {
String basePath = "src/main/resources/META-INF/native-image";
Expand All @@ -35,8 +30,8 @@ void generateNative() throws IOException {
log.info( "{} path : {}", reflectConfig.getName(), reflectConfig.getCanonicalPath() );
ReflectConfigUtil util = ReflectConfigUtil.ALL_METHODS;
List<Entry> entries = Arrays.asList(
this.addInit( util.toEntry( ServiceMessage.class ) ),
this.addInit( util.toEntry( ServiceResponse.class ) )
EntryHelper.fixedOrder( EntryHelper.addDefaultInit( util.toEntry( ServiceMessage.class ) ) ),
EntryHelper.fixedOrder( EntryHelper.addDefaultInit( util.toEntry( ServiceResponse.class ) ) )
);
try (FileWriter writer = new FileWriter( reflectConfig )){
GenerateReflectConfig config = new GenerateReflectConfig();
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<maven.compiler.target>${java-version-compliance}</maven.compiler.target>
<maven.compiler.release>${java-version-compliance}</maven.compiler.release>
<fj-version>8.5.3</fj-version>
<native-helper-graalvm-version>1.1.0</native-helper-graalvm-version>
<native-helper-graalvm-version>1.1.1</native-helper-graalvm-version>
<microprofile-openapi-api-version>3.1.1</microprofile-openapi-api-version>
<fj-service-helper-version>${project.version}</fj-service-helper-version>
<emp-service-model-version>${fj-service-helper-version}</emp-service-model-version>
Expand Down

0 comments on commit ede7f39

Please sign in to comment.