Java SDK for Platform IO

Is there Java SDK for platformio?

It would be great to have something like that for CLion plugin.

PlatformIO is for C/C++ development for microcontrollers. I don’t see how Java or CLion fits into that :wink:

2 Likes

It is perfectly fits here.

Unfortunately, neither Atom or VCS provides essential tools for software development - specifically Refactoring tools.

CLion is the IDE that has those tools, but current integration with PlatformIO is not grate. Specifically I cannot create PlatformIO projects from IDE, I cannot run tests with IDE support(not build targets), etc.

Next, CLion is the C/C++ IDE that is written in Java, and PlatformIO plugin for CLion must be written in Java(to be precise Kotlin, but anyway). Currently PlatformIO core is available only via command line calls that is not the best way of calling functionality from Java.

So having Java SDK for PlatformIO Core would simplify CLion plugin development.

Now I’m starting to see where you are going…
you are proposing a PlatformIO “IDE” plugin for CLion just like there is one for VSC and Atom, right?

I don’t know whether creating more plugins for more editors is wise. People have different preferences in editors and providing a plugin for each would be quiet the effort.

One of your arguments are the missing refactoring tools in VSC. Visual Studio Code uses the C/C++ extension which is currently working on supporting more refactoring functions, see here.

Further, I don’t see what you mean by “Java SDK for PlatformIO”. Why would you need that to develop a plugin in Java that works in CLion and calls the PIO CLI?

There is PlatformIO Core (CLI) which you can call from your Java application using subprocessing. For example,

Runtime runTime = Runtime.getRuntime();           
String executablePath = "platformio";
Process process = runTime.exec(executablePath);
1 Like

Thomseeen

:slight_smile: Unfortunately I am spoiled by commercial IDE and list of available tools/ways to refactor code mentioned in that topic is too primitive and not sufficient

ivankravets
That of course works, but the result of it will be some text output(json) that I have to parse and hope that this format won’t be changed in the next versions. It would be much easier to write something like

PlatformIO pio = PlatformIO.instance();
Board board = pio.findBoard("uno);
pio.createProject(board);

I think using CLI is good option. The CLI has not been changed since 2014 year. We only extend it. So, use it with confident.

Good, last question here.

Will platformio boards --json-output give me always the same result if I do not upgrade CLI version?

Yes, we even don’t have plans to change it in future.