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

Refactor examples #146

Merged
merged 8 commits into from
Mar 16, 2023
Merged

Refactor examples #146

merged 8 commits into from
Mar 16, 2023

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Mar 10, 2023

  • have a examples-util crate to make the example code look a bit less scary
  • have an examples-esp32XX folder for each target
    • this way no modifications of Cargo.toml is needed for C2/C3 etc.
    • it's easier to run the examples

All of the examples-esp32XX contain the exact same Rust code. In theory we could use symlinks but that would make things really hard for Windows users. So yes - this adds a lot of duplicate code but as long as we all know we just need to copy the same file in different locations it should be fine. We just shouldn't start to change the files individually

Also, those folders contain all the examples for all targets - even if it's not supported. IMHO it's easier to keep the files in sync this way and it's not worse than before since nothing was holding anyone back from trying to compile an example even if it's unsupported.

Closes #145

@bjoernQ bjoernQ marked this pull request as draft March 10, 2023 17:10
@bjoernQ
Copy link
Contributor Author

bjoernQ commented Mar 10, 2023

Obviously I forgot to change the CI workflows - converted into a draft PR for now

@bjoernQ bjoernQ marked this pull request as ready for review March 13, 2023 08:40
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Oops, this dropped off my radar, sorry! LGTM, nice to not need to change Cargo.toml when testing all the examples :D.

@bjoernQ bjoernQ merged commit 76ba312 into main Mar 16, 2023
@bjoernQ bjoernQ deleted the refactor-examples branch March 16, 2023 07:24
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.

Refactor Examples
2 participants