Esempio n. 1
0
        private static PastelContext CompilePastelContexts(ProjectConfig rootConfig)
        {
            Dictionary <string, ProjectConfig> configsLookup = new Dictionary <string, ProjectConfig>();

            string[] contextPaths = GetContextsInDependencyOrder(rootConfig, configsLookup);
            Dictionary <string, PastelContext> contexts = new Dictionary <string, PastelContext>();

            foreach (string contextPath in contextPaths)
            {
                ProjectConfig config  = configsLookup[contextPath];
                PastelContext context = GetContextForConfigImpl(config, contexts, new HashSet <string>());
                context.CompileCode(config.Source, System.IO.File.ReadAllText(config.Source));
                context.FinalizeCompilation();
            }
            return(contexts[rootConfig.Path]);
        }