Confused about something in the Submission Guide FAQs.

I noticed that one of the questions is:

Do I need to create plugins for platforms that are not supported, such as Windows and OSX?

And the answer says “At a minimum you will need to supply a LUA plugin stub for all platforms (including plugin versions for Windows and OSX)”. If I am building a plugin which is Android only, why do I need to need to create something for all platforms?

Or have I misunderstood what is being said here?

AlanPlantPot - yes, you need to create stub files for all the other 3 platforms. The stub files are very simple - I’ll ask one of the guys to post an example.

Here it is:

https://github.com/coronalabs/plugins-lua-template/blob/master/shared/plugin_PLUGIN_NAME.lua

Ah ok.
So if my plugin had 3 functions, for example init(), show() and hide(), in these stubs I would override the function calls on unsupported platforms to just print “myplugin is only supported on Android” or something similar.

That seems correct.  You don’t want your plugin to crash unsupported platforms, so make sure they all have the function calls, they just don’t do anything where they are not supported.

In addition, do the stubs need metadata.lua files included with them?

I would presume not, as for example my iOS stub isn’t actually using a static library or framework, it’s just placeholder functions saying “not available on iOS”.

Though I better check first though. If they are needed with the stub files, how should they look?

You are correct, you do not need a metadata.lua file for the stubs.

You need lua stub files for Windows and Mac if they are not supported on those platforms. The stubs would display a message on the console saying the plugin is not available for the platform.

For device builds on iOS or Android, you don’t include the folder for the unsupported platform. So if you only support Android platforms, you would not include the iOS folder. When you include a Android folder, it also works for Amazon and Nook. If your plugin doesn’t work for Amazon or Nook, you include an “android-amazon” or “android-nook” folder with a “.empty” file. (This looks like an empty directory to our server and will not build for that platform.)

AlanPlantPot - yes, you need to create stub files for all the other 3 platforms. The stub files are very simple - I’ll ask one of the guys to post an example.

Here it is:

https://github.com/coronalabs/plugins-lua-template/blob/master/shared/plugin_PLUGIN_NAME.lua

Ah ok.
So if my plugin had 3 functions, for example init(), show() and hide(), in these stubs I would override the function calls on unsupported platforms to just print “myplugin is only supported on Android” or something similar.

That seems correct.  You don’t want your plugin to crash unsupported platforms, so make sure they all have the function calls, they just don’t do anything where they are not supported.

In addition, do the stubs need metadata.lua files included with them?

I would presume not, as for example my iOS stub isn’t actually using a static library or framework, it’s just placeholder functions saying “not available on iOS”.

Though I better check first though. If they are needed with the stub files, how should they look?

You are correct, you do not need a metadata.lua file for the stubs.

You need lua stub files for Windows and Mac if they are not supported on those platforms. The stubs would display a message on the console saying the plugin is not available for the platform.

For device builds on iOS or Android, you don’t include the folder for the unsupported platform. So if you only support Android platforms, you would not include the iOS folder. When you include a Android folder, it also works for Amazon and Nook. If your plugin doesn’t work for Amazon or Nook, you include an “android-amazon” or “android-nook” folder with a “.empty” file. (This looks like an empty directory to our server and will not build for that platform.)