Search Unity

Custom Build Pipeline: Get generated build files

Discussion in 'Scripting' started by BinaryCats, Jan 17, 2019.

  1. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    317
    Hi,

    I have a custom build pipeline, and I would like to get a list of all the files (/directories) of the files generated by the build. Basically all the files that where copied from the staging area to the buildDirectory

    I can not get a list of all the files inside the build destination directory, because there could be erroneous files inside that folder which where not generated by the build.

    Does anybody know a method of getting these files?

    Thanks in advance

    p.s. Im disappointed that the custom build pipeline forum does not have a forum for this type of stuff
     
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,539
    I don't know a way to get that list from Unity specifically.

    But to accomplish it, I'd build to an empty folder (just create a temp one somewhere), build there. Get the list with the usual .net Directory/File static class methods. Then when done move it to the final build folder that has those old files in it.

    ...

    Another way is to get the list of all files in the build directory before building. Build to that directory. Then compare the new files to it. Any file that didn't exist of course is new, and any file that 'changed' is also new.
     
  3. BinaryCats

    BinaryCats

    Joined:
    Feb 8, 2016
    Posts:
    317
    Thank you for your reply

    I was trying to avoid your first solution, as it would need to move the the files to the intended destination directory

    I will probably have to do your second solution, thanks.

    I kinda wish unity allowed us to build and not move from the staging area to destination directory, hence giving us a complete build output for us to do what we wished with