old-meson-ui icon indicating copy to clipboard operation
old-meson-ui copied to clipboard

Consider implementing custom IDE backends

Open dreamer-coding opened this issue 5 years ago • 4 comments

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.

'eclipse', 'qtcreator', 'kdevelop', 'gnome', 'codeblocks', 'cline'

As a suggestion for implementation, I am considering a backend factory.

dreamer-coding avatar Mar 12 '20 08:03 dreamer-coding

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.

dreamer-coding avatar Mar 19 '20 20:03 dreamer-coding

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.

dreamer-coding avatar Mar 19 '20 20:03 dreamer-coding

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.

dreamer-coding avatar Mar 21 '20 15:03 dreamer-coding

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

dreamer-coding avatar Mar 24 '20 19:03 dreamer-coding