Removing/ignoring specific files during build process (i.e. M4A/CAF for Android builds, OGG/WAV for Apple builds)

As we’re all aware, Android devices can’t play M4A or CAF files and require OGG/WAV files in its place, and Apple devices could make better use of M4A/CAF instead of OGG/WAV.  The tiny issue I’m dealing with is when I have to go back and forth to make builds for each device, I’d rather not include all four file types, resulting in a bloated build to send to everyone on TestFlight/Dropbox, etc.  So, with each build, I find myself having to pull the files out of the folder before building.

Is there something in the build.settings file that we can tell Corona to ignore when building for a specific device?  I recall finding a parameter to specify when adding certain plug-ins, i.e. iAds and Game Circle, that only worked on one platform and not the other.  I used to have to cut and paste the plug-in section and add remarks on the top of the file until someone pointed out the supportedPlatforms parameter (thank you, whoever you are!).

settings = { plugins = { ["CoronaProvider.ads.iads"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone = true }, }, ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android = true }, }, } }

Can we do that with files?

Not trying to muddy the waters here, but what if you just used MP3 files for the debug builds, and replace them with the OS-specific files when you build commercially? Maybe you’ve already tried this and it didn’t work out…

If I recall correctly, I don’t know if it was a limitation of Apple or Android or Corona, but I couldn’t play two MP3 sounds simultaneously.  I ended up using two M4A or two OGG files and it works great.  You’ll see it in my new game Feather, where I’m simultaneously playing a vocal version of the track and an instrumental version of the track, and switch back and forth when needed.

FWIW and YMMV of course…

I had an Android-only project, but lite/full versions of assets, and some differences in build.settings between gplay/amazon versions, so 4 unique builds just for Android. What I did was set up some “build scripts” to copy/rename the relevant code/assets from my “master” into individual build-specific directories. Took a couple hours to get it all set up and tested, but saved many headaches, particularly when it came time to do an update and having a single master to edit.

For instance, my master had a “build.settings” which was ONLY used for simulator or debug builds. There was also all four variants of build.settings.[lite|full].[google|amazon] that got copied/renamed. Addl’y the scripts would completely wipe the build-specific directory prior to copy to make sure each build was a “clean” copy from the master.

Not trying to muddy the waters here, but what if you just used MP3 files for the debug builds, and replace them with the OS-specific files when you build commercially? Maybe you’ve already tried this and it didn’t work out…

If I recall correctly, I don’t know if it was a limitation of Apple or Android or Corona, but I couldn’t play two MP3 sounds simultaneously.  I ended up using two M4A or two OGG files and it works great.  You’ll see it in my new game Feather, where I’m simultaneously playing a vocal version of the track and an instrumental version of the track, and switch back and forth when needed.

FWIW and YMMV of course…

I had an Android-only project, but lite/full versions of assets, and some differences in build.settings between gplay/amazon versions, so 4 unique builds just for Android. What I did was set up some “build scripts” to copy/rename the relevant code/assets from my “master” into individual build-specific directories. Took a couple hours to get it all set up and tested, but saved many headaches, particularly when it came time to do an update and having a single master to edit.

For instance, my master had a “build.settings” which was ONLY used for simulator or debug builds. There was also all four variants of build.settings.[lite|full].[google|amazon] that got copied/renamed. Addl’y the scripts would completely wipe the build-specific directory prior to copy to make sure each build was a “clean” copy from the master.