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

Add library.json for PlatformIO compatibility #28

Closed
wants to merge 3 commits into from

Conversation

maxgerhardt
Copy link
Contributor

@maxgerhardt maxgerhardt commented Mar 20, 2021

Adds the library.json metadata file to this repository so that tinyfsm can be used in the PlatformIO build system and IDE (website) by means of declaring this repo as a library dependency.

PlatformIO is a versatile Python-based tool and VSCode extension that allows building for over 800 microcontroller boards of all different architectures and frameworks like Arduino, mbed-os, Zephyr, etc.

I've also ported the elevator example to Arduino and tested it on an Arduino Uno: https://github.com/maxgerhardt/tinyfsm-arduino-example

Copy link
Owner

@digint digint left a comment

Choose a reason for hiding this comment

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

thanks for contributing!

please move this to contrib/platformio/library.json (or similar)

I don't want to pollute this "tiny ;-)" project with configs from all sort of IDE's

library.json Outdated Show resolved Hide resolved
library.json Outdated Show resolved Hide resolved
@maxgerhardt
Copy link
Contributor Author

maxgerhardt commented Mar 21, 2021

please move this to contrib/platformio/library.json (or similar)
I don't want to pollute this "tiny ;-)" project with configs from all sort of IDE's

Sadly that can't be done -- the way PlatformIO works when downloading / using a library is that it scans the subfolders for the first occurance of the library manifest file (library.properties from the Arduino IDE or library.json specifically for PlatformIO) and then takes that subfolder as the library. If I were it to place in contrib/platformio/ and there would only be the library.json in it, it would just use that folder, and since the code isn't there, it would fail of course. The file needs to be at the level where the actual library starts, which is usually the top-level. I'd have to file a feature request to get that behavior changed or a field added to it.

But it's also the same with Arduino IDE libraries -- the library.properties file is in the root of the library folder, and noone puts it somewhere else. See e.g. any repository of any library listed at https://www.arduinolibraries.info/. Some PlatformIO users wish to however e.g. use libraries and packages which are nested inside another folder in the repo and expect it to be picked up, hence that behavior.

@digint
Copy link
Owner

digint commented Mar 22, 2021

squashed and merged in: 5030693

Thanks for contributing!

@digint digint closed this Mar 22, 2021
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.

2 participants