microsoft / gdk-unity-package

The Unity package for PC GDK developers.
Other
52 stars 18 forks source link

ProjectName_BackUpThisFolder_ButDontShipItWithYourGame included in package #57

Closed MonsterArtur1 closed 2 years ago

MonsterArtur1 commented 3 years ago

A directory called ProjectName_BackUpThisFolder_ButDontShipItWithYourGame is generated inside build folder automatically by unity. Inside there are all pdbs from il2cpp project. (here is unity doc https://docs.unity3d.com/Manual/WindowsPlayerIL2CPPBuildProducedFiles.html?_ga=2.74103953.2055947039.1598316643-1897641508.1594776991)

The default build script should move this directory, before creating layout.xml file (or ignore this dir). Now layout.xml includes those files in package.

payzer commented 3 years ago

Thank you for pointing that out. We'll look into fixing that.

lassade commented 3 years ago

I solved this by including 2 steps before creating layout and after packing calling DebugSymbols(true) and DebugSymbols(false) respectively

bool DebugSymbols(bool removeOrInclude)
        {
            try
            {
                var backupFolderPath = $"{Application.productName}_BackUpThisFolder_ButDontShipItWithYourGame";
                var originalFolderPath = @$"{buildOutputFolderPath}\{Win32OutputDirectory}\{backupFolderPath}";
                var tempFolderPath = @$"{buildOutputFolderPath}\{backupFolderPath}";
                if (removeOrInclude)
                {
                    Directory.Move(originalFolderPath, tempFolderPath);
                }
                else
                {
                    Directory.Move(tempFolderPath, originalFolderPath);
                }
                return true;
            }
            catch (Exception e)
            {
                UnityEngine.Debug.LogException(e);
                return false;
            }
        }
payzer commented 3 years ago

Thank you for sharing your solution. I'm sure it will be useful to many others and us as we look to solve it in the plugin.

tculotta commented 2 years ago

Thanks for bringing this to our attention and sharing your solution. This has now been fixed here #72 included in the most recent release.