Open dreamer-coding opened 4 years ago
All backends will depend on the available introspection API provided from the Meson build system plus testlogs.json
if needed. Also should implement the following methods from there interface class, generator
and generate_project
.
The backend constructor should take MesonAPI
object as its only argument because it has everything that is needed for IDE project generation at this time, and for how the JSON object should be extracted it should be via loader
.
So far the first backends have been added to the mix via Meson-UI but I feel that I should provide a stable API for anyone who wish to add backends for there favorite IDE. I will look in to this as soon as possible.
Have provided a basic backend implementation class that allows a consistent naming convention between backend implementations.
class BackendImplementionApi:
def __init__(self, meson_api):
self.meson_api = meson_api
@property
def projectinfo(self):
return self.meson_api.get_object(group='projectinfo', extract_method='loader')
@property
def targetsinfo(self):
return self.meson_api.get_object(group='targets', extract_method='loader')
@property
def mesoninfo(self):
return self.meson_api.get_object(group='meson-info', extract_method='loader')
@property
def testinfo(self):
return self.meson_api.get_object(group='tests', extract_method='loader')
@property
def buildoptions(self):
return self.meson_api.get_object(group='buildoptions', extract_method='loader')
@property
def buildsystem_files(self):
return self._meson_api.get_object(group='buildsystem-files', extract_method='loader')
def generator(self):
raise NotImplementedError('IDE Backend "generate" method not iemented!')
def generate_project(self):
raise NotImplementedError('IDE Backend "generate_project" method not iemented!')
def find_includes(self):
pass
def find_definitions(self):
pass
def find_source_files(self):
pass
def find_compiler_args(self):
pass
def find_build_files(self):
pass
I think Meson-UI should have custom backends for IDEs like
eclipse
,qtcreator
,kdevelop
, and more. This feature should extend the currently existing list of backends provided from the Meson build system.Here are some IDEs I'm hoping to get added to the list.
As a suggestion for implementation, I am considering a backend factory.