-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add support for multiple configuration to deduplicate examples #1118
base: develop
Are you sure you want to change the base?
Conversation
d2d6b2f
to
f533689
Compare
Ok, so in order to deduplicate more examples we need |
I've prototyped this for some NUCLEO-32 boards, I think it's a good idea to deduplicate all the I2C/SPI examples too. |
2afca50
to
87a6802
Compare
87a6802
to
6221a7b
Compare
6221a7b
to
3125e63
Compare
3125e63
to
7e9a13f
Compare
ok, so I think the deduplication is a good thing, but I don't like the idea of putting everything into the
|
What about a more flat structure? I would prefer no subdirectories over non-obvious subdirectories. |
it's flat like that, the second indentation is already the example folder. I just didn't list all the i2c drivers. |
ah, you mean completely flat? I think it's just too much, particularly because not everything can actually be deduplicated. I currently have 285 examples in this PR (down from 374 on develop), The analog examples can be fairly device specific, so they would be multiple ones like |
I think tags instead of categories are more useful for users (including me) to find an example. But that is not possible to implement using filesystem structures anyway, but we could generate a table of all examples inside |
I'm also a bit skeptical about the impact of deduplication, use of scripting and undocumented magic XML comment syntax for new modm users. The examples are most users' first exposure to modm, and I find it unfavorable to add unnecessary complexity. What do we think about generating the examples completely in a separate repo (e.g. https://github.com/modm-io/modm-examples) for all boards, including the modm repo as submodules and a |
To get users started with their own projects, I created the I hope users are not even gonna notice that there's magic XML syntax in the |
(deleted) |
7e9a13f
to
2935385
Compare
2935385
to
a17f93b
Compare
This adds a simple
project.xml
syntax to generate and compile examples with multiple configurations.This copies the example folder for every configuration inside the
project.xml
into the build folder and then lbuilds and compiles the example. Theproject.xml
syntax is based on XML comments so that the example remains usable manually and should be self-explanatory for anyone using the example.The targets are just any
<extends>.*?</extends>
in theproject.xml
.To support additional configurations that some devices need (see the USB example), any
<option name="...">...</option>
,<module>...</module>
,<collect name="...">...</collect>
, with a comment on top containing the config string will be added to the command line.This is very simple and allows us to "flip" the example matrix from "target -> use case" to "use case -> target", which should also help focus the examples on truly shared APIs.
Do we need negative filters?noexample_check.py
:cc @rleh @chris-durand: What do you think?