-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[GR-54241] Introduce reachability-metadata.json to replace the various existing -config.json files #9048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[GR-54241] Introduce reachability-metadata.json to replace the various existing -config.json files #9048
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
362 changes: 362 additions & 0 deletions
362
docs/reference-manual/native-image/assets/reachability-metadata-schema-v1.0.0.json
This file contains hidden or 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,362 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2019-09/schema", | ||
"$id": "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/reachability-metadata-schema-v1.0.0.json", | ||
"title": "JSON schema for the reachability metadata used by GraalVM Native Image", | ||
"type": "object", | ||
"default": {}, | ||
"properties": { | ||
"comment": { | ||
"title": "A comment applying to the whole file (e.g., generation date, author, etc.)", | ||
"oneOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"default": "" | ||
}, | ||
"reflection": { | ||
"title": "Metadata to ensure elements are reachable through reflection", | ||
"$ref": "#/$defs/reflection" | ||
}, | ||
"jni": { | ||
"title": "Metadata to ensure elements are reachable through JNI", | ||
"$ref": "#/$defs/reflection" | ||
}, | ||
"serialization": { | ||
"title": "Metadata for types that are serialized or deserialized at run time. The types must extend 'java.io.Serializable'.", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Enables serializing and deserializing objects of the class specified by <type>", | ||
"type": "object", | ||
"properties": { | ||
"reason": { | ||
"title": "Reason for the type's inclusion in the serialization metadata", | ||
"$ref": "#/$defs/reason" | ||
}, | ||
"condition": { | ||
"title": "Condition under which the class should be registered for serialization", | ||
"$ref": "#/$defs/condition" | ||
}, | ||
"type": { | ||
"title": "Type descriptor of the class that should be registered for serialization", | ||
"$ref": "#/$defs/type" | ||
}, | ||
"customTargetConstructorClass": { | ||
"title": "Fully qualified name of the class whose constructor should be used to serialize the class specified by <type>", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"resources": { | ||
"title": "Metadata to ensure resources are available", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Resource that should be available", | ||
"type": "object", | ||
"properties": { | ||
"reason": { | ||
"title": "Reason for the resource's inclusion in the metadata", | ||
"$ref": "#/$defs/reason" | ||
}, | ||
"condition": { | ||
"title": "Condition under which the resource should be registered for runtime access", | ||
"$ref": "#/$defs/condition" | ||
}, | ||
"module": { | ||
"title": "Module containing the resource", | ||
"type": "string", | ||
"default": "" | ||
}, | ||
"glob": { | ||
"title": "Resource name or pattern matching multiple resources (accepts * and ** wildcards)", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"glob" | ||
], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"bundles": { | ||
"title": "Metadata to ensure resource bundles are available", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Resource bundle that should be available", | ||
"type": "object", | ||
"properties": { | ||
"reason": { | ||
"title": "Reason for the resource bundle's inclusion in the metadata", | ||
"$ref": "#/$defs/reason" | ||
}, | ||
"condition": { | ||
"title": "Condition under which the resource bundle should be registered for runtime access", | ||
"$ref": "#/$defs/condition" | ||
}, | ||
"name": { | ||
"title": "Name of the resource bundle", | ||
"type": "string" | ||
}, | ||
"locales": { | ||
"title": "List of locales that should be registered for this resource bundle", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"name" | ||
], | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"required": [], | ||
"additionalProperties": false, | ||
|
||
"$defs": { | ||
"reflection": { | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Elements that should be registered for reflection for a specified type", | ||
"type": "object", | ||
"properties": { | ||
"reason": { | ||
"title": "Reason for the element's inclusion", | ||
"$ref": "#/$defs/reason" | ||
}, | ||
"condition": { | ||
"title": "Condition under which the class should be registered for reflection", | ||
"$ref": "#/$defs/condition" | ||
}, | ||
"type": { | ||
"title": "Type descriptor of the class that should be registered for reflection", | ||
"$ref": "#/$defs/type" | ||
}, | ||
"methods": { | ||
"title": "List of methods that should be registered for the type declared in <type>", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Method descriptor of the method that should be registered for reflection", | ||
"$ref": "#/$defs/method" | ||
} | ||
}, | ||
"fields": { | ||
"title": "List of class fields that can be read or written to for the type declared in <type>", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Field descriptor of the field that should be registered for reflection", | ||
"$ref": "#/$defs/field" | ||
} | ||
}, | ||
"allDeclaredMethods": { | ||
"title": "Register all declared methods from the type for reflective invocation", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allDeclaredFields": { | ||
"title": "Register all declared fields from the type for reflective access", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allDeclaredConstructors": { | ||
"title": "Register all declared constructors from the type for reflective invocation", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allPublicMethods": { | ||
"title": "Register all public methods from the type for reflective invocation", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allPublicFields": { | ||
"title": "Register all public fields from the type for reflective access", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allPublicConstructors": { | ||
"title": "Register all public constructors from the type for reflective invocation", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"unsafeAllocated": { | ||
"title": "Allow objects of this class to be instantiated with a call to jdk.internal.misc.Unsafe#allocateInstance or JNI's AllocObject", | ||
"type": "boolean", | ||
"default": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"jni": { | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Elements that should be registered for JNI for a specified type", | ||
"type": "object", | ||
"properties": { | ||
"reason": { | ||
"title": "Reason for the element's inclusion", | ||
"$ref": "#/$defs/reason" | ||
}, | ||
"condition": { | ||
"title": "Condition under which the class should be registered for JNI", | ||
"$ref": "#/$defs/condition" | ||
}, | ||
"type": { | ||
"title": "Type descriptor of the class that should be registered for JNI", | ||
"$ref": "#/$defs/type" | ||
}, | ||
"methods": { | ||
"title": "List of methods that should be registered for the type declared in <type>", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Method descriptor of the method that should be registered for JNI", | ||
"$ref": "#/$defs/method" | ||
} | ||
}, | ||
"fields": { | ||
"title": "List of class fields that can be read or written to for the type declared in <type>", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Field descriptor of the field that should be registered for JNI", | ||
"$ref": "#/$defs/field" | ||
} | ||
}, | ||
"allDeclaredMethods": { | ||
"title": "Register all declared methods from the type for JNI access", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allDeclaredFields": { | ||
"title": "Register all declared fields from the type for JNI access", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allDeclaredConstructors": { | ||
"title": "Register all declared constructors from the type for JNI access", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allPublicMethods": { | ||
"title": "Register all public methods from the type for JNI access", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allPublicFields": { | ||
"title": "Register all public fields from the type for JNI access", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"allPublicConstructors": { | ||
"title": "Register all public constructors from the type for JNI access", | ||
"type": "boolean", | ||
"default": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"reason": { | ||
"type": "string", | ||
"default": [] | ||
}, | ||
"condition": { | ||
"title": "Condition used by GraalVM Native Image metadata files", | ||
"type": "object", | ||
"properties": { | ||
"typeReached": { | ||
"title": "Type descriptor of a class that must be reached in order to enable the corresponding registration", | ||
"$ref": "#/$defs/type" | ||
} | ||
}, | ||
"required": [ | ||
"typeReached" | ||
], | ||
"additionalProperties": false | ||
}, | ||
"type": { | ||
"title": "Type descriptors used by GraalVM Native Image metadata files", | ||
"oneOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"proxy": { | ||
"title": "List of interfaces defining the proxy class", | ||
"type": "array", | ||
"default": [], | ||
"items": { | ||
"title": "Fully qualified name of the interface defining the proxy class", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"proxy" | ||
], | ||
"additionalProperties": false | ||
} | ||
] | ||
}, | ||
"method": { | ||
"title": "Method descriptors used by GraalVM Native Image metadata files", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Method name that should be registered for this class", | ||
"type": "string" | ||
}, | ||
"parameterTypes": { | ||
"default": [], | ||
"items": { | ||
"title": "List of the method's parameter types", | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
} | ||
}, | ||
"required": [ | ||
"name" | ||
], | ||
"additionalProperties": false | ||
}, | ||
"field": { | ||
"title": "Field descriptors used by GraalVM Native Image metadata files", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"title": "Name of the field that should be registered for reflection", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"name" | ||
], | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is defined as type
string
but has a default value of anarray
.What do you think about using:
like in
comment
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zakkak we will implement your proposal in the follow-up PR. Your proposal seems more accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vjovanov, I just noticed that this is still not "fixed"
https://github.com/oracle/graal/blob/860c9092a33f3e493b7d0a7b02e81987e8817bd4/docs/reference-manual/native-image/assets/reachability-metadata-schema-v1.1.0.json#L465C6-L468
Shall I open a PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, I'll open it as I also need to: bump the version, ship the schema file with GraalVM and backport all of that to 25.