Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: find_apps support customer app class (RDT-589) #88

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

ydc-0
Copy link
Contributor

@ydc-0 ydc-0 commented Nov 16, 2023

I needs some specific features in my project:

  • Building eco versions with different folder names
  • Pre process magic sdkconfig files

I was able to achieve them in this way with this PR:

class MyApp(CMakeApp):
    ECO_VERSION_PLACEHOLDER = '@e'  # replace it with the ECO version
    _eco: str

    def __init__(self, *args, **kwargs):
        if 'eco' not in kwargs:
            kwargs['eco'] = ''
        super().__init__(*args, **kwargs)

    def _initialize_hook(self, **kwargs):
        self._eco = kwargs['eco']

    def _expand(self, path: str) -> str:
        path = super()._expand(path)
        return path.replace(self.ECO_VERSION_PLACEHOLDER, self._eco)

    def _process_sdkconfig_files(self):
        import jinja2
        ...
        pass


apps = find_apps('xxx', build_system=MyApp, xxx)
apps = _filter_or_duplicate(apps)
build_apps(apps, xxxx)

@github-actions github-actions bot changed the title Feature: find_apps support customer app class Feature: find_apps support customer app class (RDT-589) Nov 16, 2023
@ydc-0 ydc-0 force-pushed the main branch 3 times, most recently from 1c26d4d to c63638d Compare November 16, 2023 16:51
@ydc-0 ydc-0 marked this pull request as ready for review November 17, 2023 06:47
Copy link
Member

@hfudev hfudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for your PR @xd-ydchen

CHANGELOG.md Outdated Show resolved Hide resolved
idf_build_apps/finder.py Show resolved Hide resolved
@hfudev hfudev merged commit 2c9b5f1 into espressif:main Nov 20, 2023
6 checks passed
@hfudev
Copy link
Member

hfudev commented Nov 20, 2023

Thank you @xd-ydchen !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants