Load plugins depending on a target platform

Godot Version

4.3

Question

I have two target platforms: android and linux.

I also have to make a plugin for both of them.

Is it possible to load android plugin (uses kotlin, java code, built with gradle) when exporting to android and load linux plugin (.so, built by scons) version when running on linux?

I know that scons can built C++ for android, but my plugin uses kotlin and other stuff from android stack.

Any help is appreciated!

gdextensions should be packed and loaded automatically for each relevant platform.

If you are trying to avoid certain calls you can check if OS.get_name() == "Android":