fossillogic / meson-ui

Meson-UI is an open-source build GUI meant to be both extremely fast and, even more importantly, as user-friendly as possible. 💻
Apache License 2.0
24 stars 1 forks source link

Consider implementing custom IDE backends #1

Open dreamer-coding opened 4 years ago

dreamer-coding commented 4 years ago

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 commented 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.

dreamer-coding commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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