Skip to content

Experimenting with extern generation for Defold Lua API

Notifications You must be signed in to change notification settings

hxdefold/hxdefold-extern-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hxdefold-extern-gen

Tool used for automatically generating Haxe externs from the Defold API documentation. The main defold API definitions are provided at d.defold.com in JSON format, however the extensions APIs are not. Therefore this tool fetches and parses the HTML pages directly.

Note that the API documentation is somewhat incomplete, so in cases where a type cannot be determined automatically, it is left with a placeholder UNKNOWN to be fixed manually. Treat this tool only as the first step in generating externs. All the classes are created, along with the correct enums and documentations; but the final touches are left up to the user.

Usage

The following example shows how to generate externs for the Facebook API.

hxdefold-extern-gen https://defold.com/extension-facebook/api/ defold.extensions.facebook Facebook gen/defold/extensions/facebook

This will generate the extern Facebook class in the file gen/defold/extensions/facebook/Facebook.hx, and any necessary enums in their own separate files under the same folder.

About

Experimenting with extern generation for Defold Lua API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages