New Feature: Excluding Files from Builds

Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0

While we just posted a tutorial on Understanding “build.settings” a few days ago, we’d like to update it and notify the developer community of a new feature in Corona: the ability to exclude certain files from your app builds!

Excluding Files

In the previous tutorial we discussed four primary sub-tables which can be included within the build.settings file, covering orientation, iOS settings, Android settings, and plugins. Now, utilizing Daily Build #2364 or later, you can add another table called excludeFiles which allows for selective exclusion of specific files or pattern-matched files on a global or per-platform basis.

Here’s an example:

Many apps won’t need this feature, but more sophisticated apps can utilize it, resulting in a reduced app bundle size, especially if it uses larger device-specific media files like audio or video. You can even include a folder in your project to hold original artwork, promotional files, and other items that you use when developing your project, but don’t want to include in the final product delivered to users.

The excludeFiles table may contain three sub-tables:

  • all — exclude these files regardless of the platform.
  • iphone — exclude these files for iOS devices.
  • android — exclude these files for Android devices.

There’s only one simple pattern matching option: an asterisk (*) which is considered a “wildcard” that can be placed anywhere in the string. This asterisk matches anything including the slash (/) that separates folders. For instance: *.png would match every PNG file, even in folders.


Because the pattern matching can be too aggressive if used carelessly, it’s imperative that you check your built app bundles and make sure that all intended files are included (and that all files intended for exclusion are actually excluded). You should also monitor the console carefully during the build process and watch for any alerts that may indicate an issue with the exclusion process.

In Summary

This feature is now available to all subscribers, and for future reference, the excludeFiles feature is documented in the Project Build Settings guide.

Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0
Rob Miracle

Rob Miracle creates mobile apps for his own enjoyment and the amusement of others. He serves the Corona Community in the forums, on the blog, and at local events.

This entry has 14 replies

  1. Jon says:

    Very nice, thanks for that.

  2. Joe says:

    Nice feature. It’s very usable especially when I started to use two differents set of audio files for iOS & Android recently.

  3. Andreas says:

    That’s perfect! I always had to copy files around to build for the different platforms (e.g. in iOS I use a tutorial video clip, on Android because of some problems with video on some older devices I use static bitmaps for the tutorials).

    Now there is one less thing to take care of when I build updates, and that’s great!

    Thanks & best,

  4. dingo says:

    good addition, thanks!

  5. Thomas says:

    Thanks, cool addition. This allows me to keep my Photoshop and Texturepacker source files in the project folder, but still build without them.

  6. Pablo says:

    Thanks!! Nice feature!!

  7. Satheesh says:

    Good feature!

  8. Lerg says:


  9. Chris says:

    Good Future!
    Especially if you keep all your *.psd files in your current project!

  10. JCH_APPLE says:

    Very useful feature. I’m using fireworks and layered PNG that I flatten when ready, I can now keep them in the same folder and exclude them very easily. Congrats for this (

  11. Ed Maurina says:

    Good job guys! This is a lot of help for those of us who target many stores. I know I often ended up with one final version of my game per store simply to keep the different assets separated. i.e. The code was the same, but I used different assets for different stores and devices sold via those stores (Google Play, Amazon, Apple, …)

    Oh, and now I can keep my source images in the folders. This is awesome! I used to have to keep a sources folder separate from the project. No more!

    So, thanks!

  12. Kerem says:

    Great job!!! Thanks much for this feature.

  13. Michael says:

    Will this also Support plugins ?

  14. Rob Miracle says:

    Plugins are excluded on a plugin-by-plugin using the supportedPlatforms key. For instance with iAds, since it’s iOS only:

    settings =
    plugins =
    [“”] =
    publisherId = “com.coronalabs”,
    supportedPlatforms = { iphone=true, [“iphone-sim”]=true },
    This feature is just about excluding files that are in your project folder.