Exemplo n.º 1
0
 public DocumentBuilder(
     IEnumerable<Assembly> assemblies,
     ImmutableArray<string> postProcessorNames,
     string templateHash,
     string intermediateFolder = null,
     string commitFromSHA = null,
     string commitToSHA = null)
 {
     Logger.LogVerbose("Loading plug-in...");
     using (new LoggerPhaseScope("ImportPlugins", true))
     {
         var assemblyList = assemblies?.ToList();
         _container = GetContainer(assemblyList);
         _container.SatisfyImports(this);
         _currentBuildInfo.CommitFromSHA = commitFromSHA;
         _currentBuildInfo.CommitToSHA = commitToSHA;
         if (intermediateFolder != null)
         {
             _currentBuildInfo.PluginHash = ComputePluginHash(assemblyList);
             _currentBuildInfo.TemplateHash = templateHash;
             _currentBuildInfo.DirectoryName = IncrementalUtility.CreateRandomDirectory(intermediateFolder);
         }
     }
     Logger.LogInfo($"{Processors.Count()} plug-in(s) loaded.");
     foreach (var processor in Processors)
     {
         Logger.LogVerbose($"\t{processor.Name} with build steps ({string.Join(", ", from bs in processor.BuildSteps orderby bs.BuildOrder select bs.Name)})");
     }
     _postProcessors = GetPostProcessor(postProcessorNames);
     _intermediateFolder = intermediateFolder;
     _lastBuildInfo = LoadLastBuildInfo();
 }
Exemplo n.º 2
0
        protected void Compose()
        {
            // Create the container
            var config = new ContainerConfiguration();
            ConfigureContainer(config);
            _container = config.CreateContainer();

            // Compose the application
            _container.SatisfyImports(this);
        }