public static AssemblyTypeInfoGenerator.ClassInfo[] ExtractAssemblyTypeInfo(BuildTarget targetPlatform, bool isEditor, string assemblyPathName, string[] searchDirs) { try { ICompilationExtension compilationExtension = ModuleManager.GetCompilationExtension(ModuleManager.GetTargetStringFromBuildTarget(targetPlatform)); string[] extraAssemblyPaths = compilationExtension.GetCompilerExtraAssemblyPaths(isEditor, assemblyPathName); if (extraAssemblyPaths != null && extraAssemblyPaths.Length > 0) { List <string> stringList = new List <string>((IEnumerable <string>)searchDirs); stringList.AddRange((IEnumerable <string>)extraAssemblyPaths); searchDirs = stringList.ToArray(); } IAssemblyResolver assemblyResolver = compilationExtension.GetAssemblyResolver(isEditor, assemblyPathName, searchDirs); return((assemblyResolver != null ? new AssemblyTypeInfoGenerator(assemblyPathName, assemblyResolver) : new AssemblyTypeInfoGenerator(assemblyPathName, searchDirs)).GatherClassInfo()); } catch (Exception ex) { throw new Exception("ExtractAssemblyTypeInfo: Failed to process " + assemblyPathName + ", " + (object)ex); } }
public static AssemblyTypeInfoGenerator.ClassInfo[] ExtractAssemblyTypeInfo(BuildTarget targetPlatform, bool isEditor, string assemblyPathName, string[] searchDirs) { AssemblyTypeInfoGenerator.ClassInfo[] result; try { string targetStringFromBuildTarget = ModuleManager.GetTargetStringFromBuildTarget(targetPlatform); ICompilationExtension compilationExtension = ModuleManager.GetCompilationExtension(targetStringFromBuildTarget); string[] compilerExtraAssemblyPaths = compilationExtension.GetCompilerExtraAssemblyPaths(isEditor, assemblyPathName); if (compilerExtraAssemblyPaths != null && compilerExtraAssemblyPaths.Length > 0) { List <string> list = new List <string>(searchDirs); list.AddRange(compilerExtraAssemblyPaths); searchDirs = list.ToArray(); } IAssemblyResolver assemblyResolver = compilationExtension.GetAssemblyResolver(isEditor, assemblyPathName, searchDirs); AssemblyTypeInfoGenerator assemblyTypeInfoGenerator; if (assemblyResolver == null) { assemblyTypeInfoGenerator = new AssemblyTypeInfoGenerator(assemblyPathName, searchDirs); } else { assemblyTypeInfoGenerator = new AssemblyTypeInfoGenerator(assemblyPathName, assemblyResolver); } result = assemblyTypeInfoGenerator.GatherClassInfo(); } catch (Exception ex) { throw new Exception(string.Concat(new object[] { "ExtractAssemblyTypeInfo: Failed to process ", assemblyPathName, ", ", ex })); } return(result); }
private static void QueryAssemblyPathsAndResolver(ICompilationExtension compilationExtension, string file, bool editor, out string[] assemblyPaths, out IAssemblyResolver assemblyResolver) { assemblyResolver = compilationExtension.GetAssemblyResolver(editor, file, null); assemblyPaths = compilationExtension.GetCompilerExtraAssemblyPaths(editor, file).ToArray <string>(); }
private static void QueryAssemblyPathsAndResolver(ICompilationExtension compilationExtension, string file, bool editor, out string[] assemblyPaths, out IAssemblyResolver assemblyResolver) { assemblyResolver = compilationExtension.GetAssemblyResolver(editor, file, (string[]) null); assemblyPaths = ((IEnumerable<string>) compilationExtension.GetCompilerExtraAssemblyPaths(editor, file)).ToArray<string>(); }