Skip to content

Conversation

KingOfGerrit
Copy link

Please, add support of PlatformIO.
All files that needed prepared.

@martinmoene
Copy link
Owner

Thanks for your contribution.

Before I continue, I'd like to inform myself a little on PlatformIO.

Two suggestions right away:

  1. Add the license to the library.json file: "license": "BSL-1.0",.
  2. Add a terminating newline to both files.

@martinmoene
Copy link
Owner

PlatformIO, Creating Library reads:

PlatformIO has a built-in Library Management where developers can declare project dependencies and PlatformIO will automatically manage them (install, build, update). It doesn’t have any requirements for a library source code structure. The only requirement is a library manifest file - library.json, library.properties, or module.json. It must be located in the root of a library.

We highly recommend using library.json for better compatibility and avoiding any issues.

Thus I'm inclined to think it is perhaps not such a good idea to also include library.properties. See also Library.json or library.properties, which one takes precedence. It is however verywell possible that I'm not aware of its importance otherwise.


Notes to self:

  • The version number in library.json (and library.properties) must be updated by script/update-version.py.
  • See Configuration, library.json in the PlatformIO documentation.
  • Check for more keywords to add, other entries.
  • The library must be published to the PlatformIO Registry using pio package publish command. Every time when you modify a source code of a library you will need to increment the “version” field in library.json manifest and re-publish again.

Arduino IDE seems to uses library.properties, see e.g. Making your libraries available to Arduino IDE users by Steve Kemp.

@martinmoene
Copy link
Owner

Publishing to the PlatformIO Registry using the pio package publish command:

  • In VSCode, open PlatformIO .
  • Open terminal via Miscellaneous > PlatformIOCore CLI.
  • Open PlatformIO local webpage via command: pio home.
  • On webpage, right-top click account icon.
  • Click GitHub to login via GitHub authentication.
  • In terminal, issue Ctrl+c to exit PlatformIO Home.
  • In terminal, make sure, the proper default folder is selected (.../optional-lite)
  • In terminal, issue pio package publish.

martinmoene added a commit that referenced this pull request Jun 3, 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