Writing an updater for my game and reached the point where I would need to scrub the project of old files and folders after update.
I currently use gradle to write a version file for the update process so I thought that may be a good place to write another file that has the desired final state of the project after update.
I could then use walkFileTree to scrub files and directories. Problem is that this doesn’t work for testing other than in the distributed project since that has nothing but the game related files.
I toasted the project once using recursion and an infinite loop that was caused by improper design using relative paths. Basically, I screwed up and set a path that allowed things to move outside the target directory and didn’t realize it till it was to late. In a split second I had a nicely compacted project with every file in it inside one folder. Git saved the project but if that was a delete and it kept going I would of been toast.
I am looking for suggestions on how best to safely approach this so I could test it with the sdk as well as the project itself.
I use lots of logging while building so I can watch the flow but even then things can go wrong very quickly.