How do I provide tool for different platforms?

I want to provide a tool for different platforms. Namely, I have compiled a custom version of bossac. I am providing it via git repository for Linux: GitHub - Miceuz/tool-bossac-catnip: Basic Open Source SAM-BA Application (BOSSA) updated version for Platformio

In my platformio.ini I specify it like this:

platform_packages = 
  tool-bossac@https://github.com/Miceuz/tool-bossac-catnip

Now I want to also provide windows version. I would like it to be transparent for the user. I.e. I would like it setup so that user does not have to specify different tool packages for linux and windows. How do I do that? Where can I find documentation for all of this - package.json and tool distribution?

Upload your Windows, Linux etc packages to the registry via pio pkg publish and wait for it to be greenlighted, then specify that in the platformio.ini.

For referencing /installing a package:
https://docs.platformio.org/en/latest/core/userguide/pkg/cmd_install.html#package-specifications

For package.json: No good PlatformIO-side documention exists. Adapt the previous package.json of the tool-bossac at least in regards to the version and system fields.

{
  "name": "tool-bossac",
  "version": "1.10700.190624",
  "description": "Basic Open Source SAM-BA Application (BOSSA)",
  "keywords": [
    "tools",
    "uploader"
  ],
  "license": "BSD-3-Clause",
  "system": [
    "linux_armv6l",
    "linux_armv7l",
    "linux_armv8l"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/shumatech/BOSSA"
  }
}

For possible values of system, see https://api.registry.platformio.org/v3/packages/platformio/tool/tool-bossac.

1 Like

Thanks a lot for your response, it was as simple as adding windows binary (having the same name for the binary across different platforms helps) and specifying several systems.

Well that’s kind of a hack, PlatformIO doesn’t expect a combined Linux + Windows package, but… if it work for you.