Example #1
0
 public static AssemblyTypeInfoGenerator.ClassInfo[] ExtractAssemblyTypeInfo(BuildTarget targetPlatform, bool isEditor, string assemblyPathName, string[] searchDirs)
 {
     if (CSharpLanguage.GetUseMicrosoftCSharpCompiler(targetPlatform, isEditor, assemblyPathName))
     {
         WSASDK wSASDK = EditorUserBuildSettings.wsaSDK;
         if (wSASDK == WSASDK.UniversalSDK81)
         {
             wSASDK = WSASDK.SDK81;
         }
         string nETCoreFrameworkReferencesDirectory = MicrosoftCSharpCompiler.GetNETCoreFrameworkReferencesDirectory(wSASDK);
         searchDirs = new List <string>(searchDirs)
         {
             nETCoreFrameworkReferencesDirectory
         }.ToArray();
     }
     AssemblyTypeInfoGenerator.ClassInfo[] result;
     try
     {
         AssemblyTypeInfoGenerator assemblyTypeInfoGenerator = new AssemblyTypeInfoGenerator(assemblyPathName, searchDirs);
         result = assemblyTypeInfoGenerator.GatherClassInfo();
     }
     catch (Exception ex)
     {
         throw new Exception(string.Concat(new object[]
         {
             "ExtractAssemblyTypeInfo: Failed to process ",
             assemblyPathName,
             ", ",
             ex
         }));
     }
     return(result);
 }
 /// Extract information about all types in the specified assembly, searchDirs might be used to resolve dependencies.
 static public AssemblyTypeInfoGenerator.ClassInfo[] ExtractAssemblyTypeInfo(BuildTarget targetPlatform, bool isEditor, string assemblyPathName, string[] searchDirs)
 {
     try
     {
         AssemblyTypeInfoGenerator gen = new AssemblyTypeInfoGenerator(assemblyPathName, searchDirs);
         return(gen.GatherClassInfo());
     }
     catch (System.Exception ex)
     {
         throw new Exception("ExtractAssemblyTypeInfo: Failed to process " + assemblyPathName + ", " + ex);
     }
 }