public void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) { if (target == BuildTarget.WSAPlayer) { AddInternetClientCapability(pathToBuiltProject); AddHelperCodeToUWPProject(pathToBuiltProject); if (PlayerSettings.GetScriptingBackend(BuildTargetGroup.WSA) == ScriptingImplementation.IL2CPP) { // Fix System.Diagnostics.Debug IL2CPP implementation. FixIl2CppLogging(pathToBuiltProject); } } if (target == BuildTarget.iOS && PBXProjectWrapper.PBXProjectIsAvailable && PlistDocumentWrapper.PlistDocumentIsAvailable) { var pbxProject = new PBXProjectWrapper(pathToBuiltProject); // Update project. OnPostprocessProject(pbxProject); pbxProject.WriteToFile(); // Update Info.plist. var settings = AppCenterSettingsContext.SettingsInstance; var infoPath = pathToBuiltProject + "/Info.plist"; var info = new PlistDocumentWrapper(infoPath); OnPostprocessInfo(info, settings); info.WriteToFile(); // Update capabilities (if possible). if (ProjectCapabilityManagerWrapper.ProjectCapabilityManagerIsAvailable) { var capabilityManager = new ProjectCapabilityManagerWrapper(pbxProject.ProjectPath, PBXProjectWrapper.GetUnityTargetName(), pbxProject.GetUnityTargetGuid()); OnPostprocessCapabilities(capabilityManager, settings); capabilityManager.WriteToFile(); } } if (target == BuildTarget.Android) { // No linking/unlinking in case module isn't added. if (AppCenter.Distribute != null) { LinkModule(AppCenterSettingsContext.SettingsInstance.UseDistribute, "distribute"); } if (AppCenter.Analytics != null) { LinkModule(AppCenterSettingsContext.SettingsInstance.UseAnalytics, "analytics"); } if (AppCenter.Crashes != null) { LinkModule(AppCenterSettingsContext.SettingsInstance.UseCrashes, "crashes"); } if (AppCenter.Push != null) { LinkModule(AppCenterSettingsContext.SettingsInstance.UsePush, "push"); } } }
public void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) { if (target == BuildTarget.WSAPlayer) { AddInternetClientCapability(pathToBuiltProject); AddHelperCodeToUWPProject(pathToBuiltProject); if (PlayerSettings.GetScriptingBackend(BuildTargetGroup.WSA) == ScriptingImplementation.IL2CPP) { // Fix System.Diagnostics.Debug IL2CPP implementation. FixIl2CppLogging(pathToBuiltProject); } } if (target == BuildTarget.iOS && PBXProjectWrapper.PBXProjectIsAvailable && PlistDocumentWrapper.PlistDocumentIsAvailable) { var pbxProject = new PBXProjectWrapper(pathToBuiltProject); // Update project. OnPostprocessProject(pbxProject); pbxProject.WriteToFile(); // Update Info.plist. var settings = AppCenterSettingsContext.SettingsInstance; var infoPath = pathToBuiltProject + "/Info.plist"; var info = new PlistDocumentWrapper(infoPath); OnPostprocessInfo(info, settings); info.WriteToFile(); // Update capabilities (if possible). if (ProjectCapabilityManagerWrapper.ProjectCapabilityManagerIsAvailable) { var capabilityManager = new ProjectCapabilityManagerWrapper(pbxProject.ProjectPath, PBXProjectWrapper.GetUnityTargetName(), pbxProject.GetUnityTargetGuid()); OnPostprocessCapabilities(capabilityManager, settings); capabilityManager.WriteToFile(); } } }