public void Compile() { List <IFileNode> localCompileList; bool recompileAll; lock (compileList) { if (typeResolverContext == null) { Action itr = () => { typeResolverContext = GlobalServices.TypeService.GetContextTypeResolver(projectManager); typeResolver = GlobalServices.TypeService.GetTypeResolutionService(projectManager); //hack to ensure that necessary internal state gets initialized typeResolver.GetPathOfAssembly(new AssemblyName("mscorlib.dll")); }; Application.Current.Dispatcher.Invoke(itr); } localCompileList = new List <IFileNode>(compileList); compileList.Clear(); if (localCompileList.Count == 0 && !referencesDirty) { return; } recompileAll = referencesDirty; referencesDirty = false; } var results = new Dictionary <IFileNode, CompileResults>(); foreach (var file in BooProjectNode.GetFileEnumerator(projectManager)) { if (recompileAll || localCompileList.Contains(file)) { // this seemingly redundant variable ensures that each closure below has its own copy of // the file reference. Without it they share the same copy decalred in the loop statemenet // essentially all of them will point to the last element in the loop var localfile = file; results.Add(file, new CompileResults(() => localfile.Url, localfile.GetCompilerInput, () => GlobalServices.LanguageService.GetLanguagePreferences().TabSize)); } else { results.Add(file, file.GetCompileResults()); } } Boo.ASTMapper.CompilerManager.Compile( GlobalServices.LanguageService.GetLanguagePreferences().TabSize, references.Values.Select(ae => ae.GetAssembly(typeResolver.GetAssembly)).Where(a => a != null), results.Values); foreach (var result in results) { result.Key.SetCompilerResults(result.Value); } }
public CompilerManager(BooProjectNode projectManager) { this.projectManager = projectManager; references.Add((uint)VSConstants.VSITEMID.Root, new AssemblyEntry(new AssemblyName("mscorlib"))); }
public AssemblyEntry(ReferenceNode reference, BooProjectNode project) { _reference = reference; _project = project; }
public AssemblyEntry(AssemblyName assemblyName, BooProjectNode project) { _assemblyName = assemblyName; _project = project; }