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

samples: migrate includes to contain <zephyr/...> prefix #45388

Conversation

gmarull
Copy link
Member

@gmarull gmarull commented May 5, 2022

In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:

from pathlib import Path
import re

EXTENSIONS = ("c", "h", "cpp", "rst")

for p in Path(".").glob("samples/**/*"):
    if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
        continue

    content = ""
    with open(p) as f:
        for line in f:
            m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
            if (m and
                not m.group(2).startswith("zephyr/") and
                (Path(".") / "include" / "zephyr" / m.group(2)).exists()):
                content += (
                    m.group(1) +
                    "#include <zephyr/" + m.group(2) +">" +
                    m.group(3) + "\n"
                )
            else:
                content += line

    with open(p, "w") as f:
        f.write(content)

Signed-off-by: Gerard Marull-Paretas gerard.marull@nordicsemi.no

In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:

```python
from pathlib import Path
import re

EXTENSIONS = ("c", "h", "cpp", "rst")

for p in Path(".").glob("samples/**/*"):
    if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
        continue

    content = ""
    with open(p) as f:
        for line in f:
            m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
            if (m and
                not m.group(2).startswith("zephyr/") and
                (Path(".") / "include" / "zephyr" / m.group(2)).exists()):
                content += (
                    m.group(1) +
                    "#include <zephyr/" + m.group(2) +">" +
                    m.group(3) + "\n"
                )
            else:
                content += line

    with open(p, "w") as f:
        f.write(content)
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
laxiLang pushed a commit to laxiLang/zephyr that referenced this pull request May 30, 2022
In order to bring consistency in-tree, migrate all kernel code to the
new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
laxiLang pushed a commit to laxiLang/zephyr that referenced this pull request May 30, 2022
In order to bring consistency in-tree, migrate all subsystems code to
the new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
laxiLang pushed a commit to laxiLang/zephyr that referenced this pull request May 30, 2022
Linker files were not migrated with the new <zephyr/...> prefix.  Note
that the conversion has been scripted, refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
laxiLang pushed a commit to laxiLang/zephyr that referenced this pull request May 30, 2022
Assembler files were not migrated with the new <zephyr/...> prefix.
Note that the conversion has been scripted, refer to zephyrproject-rtos#45388 for more
details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate Bridle core to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all subsys to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all samples to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all Bridle components
to the new prefix <bridle/...>. Note that this was done to be in sync
with Zephyr, refer to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate Bridle core to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all subsys to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all samples to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all Bridle components
to the new prefix <bridle/...>. Note that this was done to be in sync
with Zephyr, refer to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate Bridle core to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all subsys to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all samples to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
rexut added a commit to tiacsys/bridle that referenced this pull request Feb 27, 2023
In order to bring consistency in-tree, migrate all Bridle components
to the new prefix <bridle/...>. Note that this was done to be in sync
with Zephyr, refer to zephyrproject-rtos/zephyr#45388 for more details.

issues: #60

Signed-off-by: Stephan Linz <linz@li-pro.net>
@gmarull gmarull deleted the migrate-zephyr-include-path-samples branch April 24, 2023 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants