Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically update link.xml by LinkerProcessor #547

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions com.onesignal.unity.core/Editor/LinkerProcessor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.UnityLinker;

namespace OneSignalSDK
{
public class LinkerProcessor : IUnityLinkerProcessor
{
private const string XmlGuid = "b7ef312023e648bebcd07161e965b0d6";

public int callbackOrder => 0;

public string GenerateAdditionalLinkXmlFile(BuildReport report, UnityLinkerBuildPipelineData data)
{
var assetPath = AssetDatabase.GUIDToAssetPath(XmlGuid);
return Path.GetFullPath(assetPath);
}

#if !UNITY_2021_1_OR_NEWER
public void OnBeforeRun(BuildReport report, UnityLinkerBuildPipelineData data)
{
}

public void OnAfterRun(BuildReport report, UnityLinkerBuildPipelineData data)
{
}
#endif
}
}
3 changes: 3 additions & 0 deletions com.onesignal.unity.core/Editor/LinkerProcessor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 0 additions & 61 deletions com.onesignal.unity.core/Editor/SetupSteps/LinkXMLStep.cs

This file was deleted.

11 changes: 0 additions & 11 deletions com.onesignal.unity.core/Editor/SetupSteps/LinkXMLStep.cs.meta

This file was deleted.