Add GDNative JSON generator for the builtin API

Which can be used by language bindings to generate code statically. This
is generated as a different file from the class API because it has
different requirements (the builtin types have constructors and don't
have signals), so bindings can better make use of each JSON file without
extra parsing.

This also cleans up a bit the old API generator, mainly initializing
structs and renaming "instanciable" to the more correct "instantiable".

The argument description in help text was updated to better reflect how
it should be used. The <path> argument is mandatory.
This commit is contained in:
George Marques 2021-01-12 14:12:40 -03:00
parent a4aaead346
commit 8a8dbd76b1
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
4 changed files with 462 additions and 75 deletions

View file

@ -1257,6 +1257,15 @@ void NativeScriptLanguage::init() {
}
exit(0);
}
E = args.find("--gdnative-generate-json-builtin-api");
if (E && E->next()) {
if (generate_c_builtin_api(E->next()->get()) != OK) {
ERR_PRINT("Failed to generate C builtin API\n");
}
exit(0);
}
#endif
#ifdef TOOLS_ENABLED