Skip to content
Merged
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
10 changes: 4 additions & 6 deletions src/Sentry.Unity.Editor/Native/SwitchNativeStub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ private static bool Matches(string stub, string template) =>
private static string Normalize(string content) =>
content.Replace("\r\n", "\n").Replace("\r", "\n").TrimEnd();

[InitializeOnLoadMethod]
private static void OnDomainReload() => EditorApplication.delayCall += () => Sync(null);

/// <summary>
/// Syncs the SDK with the state of the game. Adds/removes the stub.
/// </summary>
Expand Down Expand Up @@ -213,7 +210,8 @@ private static string TemplatePath() => Path.GetFullPath(Path.Combine(
internal class SwitchNativeStubWatcher : AssetPostprocessor
{
private static void OnPostprocessAllAssets(
string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths,
bool didDomainReload)
{
var librariesChanged = importedAssets
.Concat(deletedAssets)
Expand All @@ -222,9 +220,9 @@ private static void OnPostprocessAllAssets(
.Any(path => SwitchNativeStub.LibraryFileNames.Any(
library => path.EndsWith(library, StringComparison.Ordinal)));

if (librariesChanged)
if (didDomainReload || librariesChanged)
{
EditorApplication.delayCall += () => SwitchNativeStub.Sync(null);
SwitchNativeStub.Sync(null);
}
}
}
Comment thread
bitsandfoxes marked this conversation as resolved.
5 changes: 5 additions & 0 deletions test/Scripts.Integration.Test/build-project.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ Write-Log "Build method: $buildMethod"
Write-Detail "Output path: $outputPath"
$unityArgs = @("-batchmode", "-projectPath ", "$(GetNewProjectPath)", "-executeMethod", $buildMethod , "-buildPath", $outputPath, "-quit")

if ($Platform -eq "Switch")
{
$unityArgs += @("-buildTarget", "Switch")
}

RunUnityCustom $unityPath $unityArgs

if ($Platform -eq "Android-Export")
Expand Down
Loading