IHotReloadProjectGenerationPostProcessor.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. namespace SingularityGroup.HotReload.Editor.ProjectGeneration {
  2. /// <summary>
  3. /// Allows to post process Hot Reload's project generation.
  4. /// This should only be needed if you tinker with Unity's project generation as well.
  5. /// Types that inherit from this interface will get created automatically whenever Hot Reload generates project files.
  6. /// Types that implement this interface need to have a public parameterless default constructor.
  7. /// </summary>
  8. public interface IHotReloadProjectGenerationPostProcessor {
  9. /// <summary>
  10. /// Specifies the ordering of the post processor.
  11. /// Post processors with lower callback order get executed first.
  12. /// </summary>
  13. int CallbackOrder { get; }
  14. /// <summary>
  15. /// Use this method to set up state you need for the project generation.
  16. /// Calls to unity API need to happen here and it's values need to be cached.
  17. /// This is the only method that will get executed on the main thread.
  18. /// </summary>
  19. void InitializeOnMainThread();
  20. /// <summary>
  21. /// Gets called whenever Hot Reload generated a project file.
  22. /// <param name="path">The destination file path for the .csproj file</param>
  23. /// <param name="contents">The file contents of the .csproj file</param>
  24. /// </summary>
  25. string OnGeneratedCSProjectThreaded(string path, string contents);
  26. /// <summary>
  27. /// Gets called whenever Hot Reload generated a solution file.
  28. /// <param name="path">The destination file path for the .sln file</param>
  29. /// <param name="contents">The file contents of the .sln file</param>
  30. /// </summary>
  31. string OnGeneratedSlnSolutionThreaded(string path, string contents);
  32. /// <summary>
  33. /// Gets called after Hot Reload project generation is finished.
  34. /// </summary>
  35. void OnGeneratedCSProjectFilesThreaded();
  36. }
  37. }