Separate out index generation for swift files

This will allow us to arbitrarily pass in lists of files and generate
indexes for them in JJB macros.

Change-Id: Ied3bd3161a2cd75f63bb17731e5d3af9d6d8a630
Merge "Separate out index generation for swift files"