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

package pack/publish ignores some folders #3730

Closed
maakbaas opened this issue Nov 10, 2020 · 8 comments
Closed

package pack/publish ignores some folders #3730

maakbaas opened this issue Nov 10, 2020 · 8 comments
Milestone

Comments

@maakbaas
Copy link

The documentation states:

Publish a package to the registry so that it can be installed by name. All files in the package directory are included if export field is not declared in a package manifest (for example, see export). The next items are automatically excluded:

._*
__*
.DS_Store
.git/
.hg/
.svn/
.pio/
**/.pio/

However, my library (https://github.com/maakbaas/esp8266-iot-framework) contains three folders not listed above html/, docs/, and build/ that are not included in the tarball in PlatformIO 5.0.1. By default the export section in my library.json looks like this:

"export": {
"exclude": [
"node_modules",
".vscode"
]
}

even if I update my library.json export section to what is shown below, or several other iterations, these folders keep getting ignored.

"export": {
"exclude": [
"node_modules",
".vscode"
],
"include": [
"docs/",
"build/
",
]
}

If I rename build/ to build2/, docs/ to docs2/ and html/ to html2/, these will be included in the tarball. Is there another hardcoded list of folder names that is not mentioned in the documentation that will be excluded?

@maakbaas
Copy link
Author

maakbaas commented Nov 10, 2020

Ok, found my answer probably in the EXCLUDE_DEFAULT and EXCLUDE_LIBRARY_EXTRA lists in pack.py.

Should this behavior be made more clear in the documentation? I see this was introduced 2 weeks ago.

From the folders in my initial post, the docs should indeed not be included, and this is not my intention. But in my library I have a few extra_scripts .py files that are now in a folder named build/. Is your recommendation to rename this folder, or is there some way in which I can still include these without renaming the folder?

@ivankravets
Copy link
Member

Thanks! We will update docs.

Have you tried to include things that you need? See https://docs.platformio.org/en/latest/librarymanager/config.html#include

We try to keep libraries in small size and remove unused files in the build process.

@maakbaas
Copy link
Author

Yes, I tried including, but this did not work. Without fully understanding the code in pack.py it seems as if the excludes are applied after the includes, potentially overwriting the includes?

result = ["+<%s>" % p for p in include or ["*", ".*"]]
result += ["-<%s>" % p for p in exclude or []]
result += ["-<%s>" % p for p in exclude_default]

@ivankravets
Copy link
Member

Thanks for the report! PlatformIO Core 5.0.3 is going to be released today.

@maakbaas
Copy link
Author

Thanks for the quick fix!

@ivankravets
Copy link
Member

Did you test it? Please run “pio upgrade —dev”

@ivankravets
Copy link
Member

Double dash before dev

@maakbaas
Copy link
Author

Yes, I can confirm that it works. Thanks a lot!

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

No branches or pull requests

2 participants