Example #1
0
        public static AssemblyBinaryBuildResult FromFile(string locationLib, string locationSymbols = null, string[] assets = null)
        {
            if (!System.IO.File.Exists(locationLib))
                return null;

            AssemblyBinaryBuildResult bin = new AssemblyBinaryBuildResult();
            try
            {
                bin.LibraryPath = locationLib;
                bin.library = System.IO.File.ReadAllBytes(locationLib);
                bin.Name = Path.GetFileName(locationLib);
                if (locationSymbols != null)
                {
                    if (!System.IO.File.Exists(locationSymbols))
                        Console.WriteLine("symbols file not found: {0}", locationSymbols);
                    else
                    {
                        bin.symbols = System.IO.File.ReadAllBytes(locationSymbols);
                        bin.SymbolsPath = locationSymbols;
                    }
                }
                if (assets != null && assets.Length > 0)
                {
                    bin.assets = assets;
                    bin.assetsRoot = Path.GetPathRoot(assets[0]);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("unhandled exception while gathering build result: lib:'{0}'; msg: {1}", locationLib, e.Message);
                return null;
            }
            return bin;
        }
Example #2
0
        public static AssemblyBinaryBuildResult FromFile(string locationLib, string locationSymbols = null, string[] assets = null)
        {
            if (!System.IO.File.Exists(locationLib))
            {
                return(null);
            }

            AssemblyBinaryBuildResult bin = new AssemblyBinaryBuildResult();

            try
            {
                bin.LibraryPath = locationLib;
                bin.library     = System.IO.File.ReadAllBytes(locationLib);
                bin.Name        = Path.GetFileName(locationLib);
                if (locationSymbols != null)
                {
                    if (!System.IO.File.Exists(locationSymbols))
                    {
                        Console.WriteLine("symbols file not found: {0}", locationSymbols);
                    }
                    else
                    {
                        bin.symbols     = System.IO.File.ReadAllBytes(locationSymbols);
                        bin.SymbolsPath = locationSymbols;
                    }
                }
                if (assets != null && assets.Length > 0)
                {
                    bin.assets     = assets;
                    bin.assetsRoot = Path.GetPathRoot(assets[0]);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("unhandled exception while gathering build result: lib:'{0}'; msg: {1}", locationLib, e.Message);
                return(null);
            }
            return(bin);
        }