Farmer allies will automatically upgrade once they are on the field with a swordsmith ally. Swordsmith allies are distinguishable by the fact that they cost 10 upgrade points, and their picture card will be a character holding a hammer. This can be done during a bonus mission as your allies do all the work for you. Simply build a swordsmith and then spam the farmer ally until you have gotten 25 of them spawned and upgraded. Don't worry if you don't do this in one wave, it can be done over multiple waves but can easily be done in one wave.