Search Unity

IPostprocessBuildWithReport doesn't trigger if build errors out

Discussion in 'Testing & Automation' started by Solovykh, Mar 6, 2020.

  1. Solovykh

    Solovykh

    Joined:
    Aug 28, 2017
    Posts:
    59
    Hey there,

    Is it a known issue that IPostprocessBuildWithReport's OnPostprocessBuild doesn't get run if the build errors out?
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Is this question related to testing and automation? in any case, i believe you should always get a callback, even when the build fails (the BuildReport object should contain information about the failure).
     
  3. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
  4. Solovykh

    Solovykh

    Joined:
    Aug 28, 2017
    Posts:
    59
  5. v01pe_

    v01pe_

    Joined:
    Mar 25, 2015
    Posts:
    71
    As the issue was resolved as `By Design`, I researched for alternatives/ workarounds and found a thread, that describes the story behind all this - thanks @bdovas for initiating the discussion. I went ahead and implemented a custom `BuildHandler` script as a workaround.
     
    florinel2102 and Max_Aigner like this.
  6. florinel2102

    florinel2102

    Joined:
    May 21, 2019
    Posts:
    76
    Woth mentioning to add #if UNITY_EDITOR at the beginning of the script . Thanks !