graal-reflection-configuration-generator

Automatically generate graal reflection configuration json

License

License

Categories

Categories

Configuration Application Layer Libs config Graal Native Development Tools
GroupId

GroupId

com.mageddo.nativeimage
ArtifactId

ArtifactId

graal-reflection-configuration-generator
Last Version

Last Version

2.0.2
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

graal-reflection-configuration-generator
Automatically generate graal reflection configuration json
Project URL

Project URL

https://github.com/mageddo/graal-reflection-configuration-generator.git
Source Code Management

Source Code Management

https://github.com/mageddo/graal-reflection-configuration-generator.git

Download graal-reflection-configuration-generator

Dependencies

compile (1)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.9.8

Project Modules

There are no modules declared in this project.

Archived

I wrote a annotatation processor instead, take a look https://github.com/mageddo-projects/annotation-processing-tools/tree/master/reflection-config-generator

Graal Reflection Configuration Generator provides an easy way to geenrate GraalVM reflection config files, configure the plugin on your gradle project, annotate the desired class class with @RuntimeReflection run the gradle build then you're done.

See an example app

Using

Gradle dependencies

dependencies {
  compileOnly("com.mageddo.nativeimage:reflection-config-generator:2.1.1")
  annotationProcessor("com.mageddo.nativeimage:reflection-config-generator:2.1.1")
}

Consider the following example

package com.acme;

import nativeimage.Reflection;

@Reflection(declaredConstructors = true, declaredFields = true)
public class Fruit {
  private String name;
  private String color;   
}

it will automatically configure reflection for Fruit props when compiling using native-image generating a json like

[
  {
    "name" : "com.acme.Fruit",
    "allDeclaredConstructors" : true,
    "allPublicConstructors" : false,
    "allDeclaredMethods" : false,
    "allPublicMethods" : false,
    "allPublicFields" : false,
    "allDeclaredFields" : true
  }
]

Versions

Version
2.0.2