HTTP within pre/post export?

Thanks very much for implementing pre/post export methods! I have a question about the timing around these methods. Does export kick off immediately once the pre- method has completed? Also, does the Unity process get terminated immediately after the post- method completes?

The reason I’m asking is because I’d like to communicate with a web server as part of a custom pre or post-build step (building and then uploading some asset bundles). This would involve HTTP, and I’m not aware of any blocking interface to that in Unity.

I already have a solution for making HTTP calls in the editor that involves an ‘EditorCoroutine’ wrapper to run IEnumerators in a similar fashion to StartCoroutine(). I figure this route will cause issues though, unless there’s a way I can signal that I’ve finished my work some time after the initial pre-export method call completes.

Any ideas how I might be able to pull this one off? :slight_smile:

Hi @steve.salmond , thanks for the kind words!

Here is the basic order of operations:

  • Unity Cloud Build Pre-export methods run
  • Export process happens
  • Methods marked the built-in PostProcessBuildAttribute are called
  • Unity Cloud Build Post-export methods run
  • [unity ends]
  • (iOS) Xcode processes project
  • Done!

Hope this helps!

Thanks hypeNate, that’s pretty much how I imagined it. I suppose then that there is no easy way to wait on tasks in steps 1, 3 or 4 that might take some time to complete (such as HTTP get/post). I will probably have to cook up a Jenkins server to do my Asset Bundle building.

Cheers,
Steve

Over a year later, is there a way to do this within Unity’s build system yet? It seems like a necessity for any decent sized studio to be able to have non-blocking method in build scripts, especially http requests.