R.swift will discover resources used in your project automatically. To make sure you can continue to use R.swift in the rare case that a file gives problems it is possible to ignore resources.
Create a .rswiftignore
file in the source root of your project, this file will automatically be discovered by R.swift. The format of the file is nearly the same as a .gitignore
file. Wildcards like *
and **
are supported and you can add comments by starting a line with a #
. Explicitly including single or multiple files that are otherwise globally ignored is also supported by starting a pattern with !
.
Note: All patterns are file paths relative to the path of the .rswiftignore
file.
# Ignore a specific font file
fonts/myspecialfont.ttf
# Ignore all tiff and tif files in the images folder
images/*.tif
images/*.tiff
# Ignore all strings files wherever they are
**/*.strings
# Ignore all files containing '.ignore.'
**/*.ignore.*
# Explicitly include a single file
!keepme.ignore.png
# Explicitly include all files containing '.keepme.'
!**/*.keepme.*
It is also possible to call the binary with the --rswiftignore
flag and give a custom location of the ignore file this way.