Join GitHub today
JSON-RPC: automatically create JSON schema API description #4309
Right now when editing the JSON schema API description of our JSON-RPC API we need to adjust one of the *.json files in xbmc/interfaces/json-rpc and we need to make the same changes in xbmc/interfaces/json-rpc/ServiceDescription.h which is read by the JSON-RPC implementation. But editing that file by hand is very tedious (which is why we have the separate *.json files in the first place). @topfs2 and I have written a tool to do that conversion and it's located at https://github.com/Montellese/jsd_builder. It takes the *.json files, a license.txt and a version.txt file to build the ServiceDescription.h. But right now this is a manual task.
This adds the necessary bits to the win32 build system to automatically create ServiceDescription.h during the build (similar to how it's done for the python code generation).
Obviously this is Gotham + 1.
modified the milestones:
WIP / RFC (code improvements needed),
Pending for inclusion
Apr 26, 2014
@wsnipex: Thanks. I've added some additional linux-magic which I haven't tested yet so please wait with merging. I'm also not 100% sure if we could/should add some additional logic to Xcode like I did for win32. Will have to check how it's done for the python code generation stuff.
I've removed the additional commit I added because it doesn't work. Ideally there'd be some logic in xbmc/interfaces/json-rpc/Makefile that would automatically trigger a re-generation of ServiceDescription.h if one of the *.json files changed. I tried to do it the same as it is done for the python code generation but that caused some problems which are probably due to the fact that codegenerator.mk now contains logic for two different auto-generated things.
jenkins build this please
@wsnipex: Hm looks like this approach doesn't work for osx and android as it tries to cross-compile when being called through xbmc/interfaces/json-rpc/Makefile. Any easy way to get around this? If not we'll just go back to the initial bootstrap-only approach for linux et al.
added a commit
this pull request
Apr 30, 2014
Apr 30, 2014
1 check passed
Jun 2, 2014
@wsnipex - is it by intention to pass CFLAGS to CXX instead of CXXFLAGS and/or CPPFLAGS - also shouldn't it read LDFLAGS instead of LFLAGS? (same below for the .cpp.o branch).