Automating build process

I am looking for a way to automate the build process.

I have a few data files (text files storing prebuilt character templates). I used to use PostProcessBuildPlayer script, except that its mac only.

Is there a good way to make unity copy files across into the build during the build process that will work on both mac and windows? Without manually dragging the files across each time.

Also is there any best practices in terms of saving and load data written to a file which is created / edited at both run time and in the editor?

Cheers,
Pip

use BuildPipeline.BuildPlayer

Perfect, Thank you!

Turns out this is what I was looking for.

Unfortunately it seems Unity has rushed the documentation and hidden it well.

    public class MyBuildPostprocessor {

        [PostProcessBuild]
        public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) {

            Debug.Log( pathToBuiltProject );

        }

    }

http://docs.unity3d.com/Documentation/ScriptReference/PostProcessBuildAttribute.html

You could also do this without having to script using uTomate. First create two actions:

Then you can combine both actions to an automation plan. You can also create different automation plans for different builds, for example if you need to copy a different set of files depending on the build type. Then you could run this plan with a mouseclick from uTomates main window:

All plans and actions work on all supported operating systems and can be commited to version control so your whole team can use them.