RealityStop / Bolt.Addons.Community

A community-driven project for extending Unity Bolt
MIT License
251 stars 34 forks source link

Build temporary files in case stay after Build Cancel, need cleanup #51

Open hsandt opened 2 years ago

hsandt commented 2 years ago

When cancelling a Build, the Temporary-Build folder and its link.xml and meta files remain. This is because BuildHelper.cs PackagesLinkXmlExtractor.OnPostprocessBuild is not called.

I found a way to plug build cancel events on https://answers.unity.com/questions/1724656/how-to-get-a-callback-when-build-was-canceled.html

Could you try to implement this? It looks like checking the build result is not that easy, so instead of clearing files in some extra event only if build was cancelled, maybe just move the content of OnPostprocessBuild to the custom cleanup method called in the finally block, as to centralize cleanup.