Exemplo n.º 1
0
        static bool WeaveAssemblies(IEnumerable <string> assemblies, IEnumerable <string> dependencies, string outputDir, string unityEngineDLLPath, string mirrorNetDLLPath)
        {
            WeavingFailed = false;
            WeaveLists    = new WeaverLists();

            using (AssemblyDefinition unityAssembly = AssemblyDefinition.ReadAssembly(unityEngineDLLPath))
                using (AssemblyDefinition mirrorAssembly = AssemblyDefinition.ReadAssembly(mirrorNetDLLPath))
                {
                    WeaverTypes.SetupUnityTypes(unityAssembly, mirrorAssembly);

                    try
                    {
                        foreach (string asm in assemblies)
                        {
                            if (!Weave(asm, unityAssembly, mirrorAssembly, dependencies, unityEngineDLLPath, mirrorNetDLLPath, outputDir))
                            {
                                return(false);
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Log.Error("Exception :" + e);
                        return(false);
                    }
                }
            return(true);
        }