コード例 #1
0
        private static int ParsedOk(Options options)
        {
            int buildNumber = FindBuildNumber(options.BuildNumber);

            string workDir = Environment.CurrentDirectory;

            using (Repository repo = OpenRepository(workDir))
            {
                IServiceProvider serviceProvider = Setup(options: options, repo: repo);

                IDiagnosticLogger logging         = serviceProvider.GetRequiredService <IDiagnosticLogger>();
                IVersionDetector  versionDetector = serviceProvider.GetRequiredService <IVersionDetector>();

                NuGetVersion version = versionDetector.FindVersion(buildNumber);

                ApplyVersion(version: version, serviceProvider: serviceProvider);

                if (logging.IsErrored)
                {
                    Console.WriteLine();
                    Console.WriteLine(logging.Errors > 1 ? $"Found {logging.Errors} Errors" : $"Found {logging.Errors} Error");

                    return(ERROR);
                }

                return(SUCCESS);
            }
        }
コード例 #2
0
 protected BaseOutputController(OutputContext context,
                                IAction initializer,
                                IVersionDetector inputVersionDetector,
                                IVersionDetector outputVersionDetector)
 {
     Context               = context;
     Initializer           = initializer;
     InputVersionDetector  = inputVersionDetector;
     OutputVersionDetector = outputVersionDetector;
 }
コード例 #3
0
 public AdoOutputController(
     OutputContext context,
     IAction initializer,
     IVersionDetector inputVersionDetector,
     IVersionDetector outputVersionDetector,
     IConnectionFactory cf) : base(context, initializer, inputVersionDetector, outputVersionDetector)
 {
     _cf        = cf;
     _stopWatch = new Stopwatch();
 }
コード例 #4
0
 public SolrOutputController(
     OutputContext context,
     IAction initializer,
     IVersionDetector inputVersionDetector,
     IVersionDetector outputVersionDetector,
     ISolrReadOnlyOperations <Dictionary <string, object> > solr
     ) : base(
         context,
         initializer,
         inputVersionDetector,
         outputVersionDetector
         )
 {
     _solr = solr;
 }
コード例 #5
0
 public ElasticOutputController(
     OutputContext context,
     IAction initializer,
     IVersionDetector inputVersionDetector,
     IVersionDetector outputVersionDetector,
     IElasticLowLevelClient client
     ) : base(
         context,
         initializer,
         inputVersionDetector,
         outputVersionDetector
         )
 {
     _client    = client;
     _stopWatch = new Stopwatch();
 }
コード例 #6
0
 public LuceneOutputController(
     OutputContext context,
     IAction initializer,
     IVersionDetector inputVersionDetector,
     IVersionDetector outputVersionDetector,
     SearcherFactory searcherFactory,
     IndexReaderFactory readerFactory
     ) : base(
         context,
         initializer,
         inputVersionDetector,
         outputVersionDetector
         )
 {
     _searcherFactory = searcherFactory;
     _readerFactory   = readerFactory;
     _stopWatch       = new Stopwatch();
 }
コード例 #7
0
 public MigrationsService(IVersionDetector versionDetector)
 {
     this.versionDetector = versionDetector;
 }