internal static ScriptCompilerBase CreateCompilerInstance(ScriptAssembly scriptAssembly, EditorScriptCompilationOptions options, string tempOutputDirectory)
        {
            if (scriptAssembly.Files.Length == 0)
            {
                throw new ArgumentException("Cannot compile ScriptAssembly with no files");
            }

            return(CSharpSupportedLanguage.CreateCompiler(scriptAssembly, options, tempOutputDirectory));
        }
示例#2
0
 internal static ScriptCompilerBase CreateCompilerInstance(MonoIsland island, bool buildingForEditor, BuildTarget targetPlatform, bool runUpdater)
 {
     if (island._files.Length == 0)
     {
         throw new ArgumentException("Cannot compile MonoIsland with no files");
     }
     using (List <SupportedLanguage> .Enumerator enumerator = ScriptCompilers._supportedLanguages.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             SupportedLanguage current = enumerator.Current;
             if (current.GetExtensionICanCompile() == island.GetExtensionOfSourceFiles())
             {
                 return(current.CreateCompiler(island, buildingForEditor, targetPlatform, runUpdater));
             }
         }
     }
     throw new ApplicationException(string.Format("Unable to find a suitable compiler for sources with extension '{0}' (Output assembly: {1})", (object)island.GetExtensionOfSourceFiles(), (object)island._output));
 }