Exemplo n.º 1
0
        static string[] BuildFilesParameterString(PerforceFiles files, DateTime from, DateTime to)
        {
            const string pathFormat = "{0}/.../*.{1}@{2:yyyy/MM/dd:hh:mm},@{3:yyyy/MM/dd:hh:mm}";
            var paths = new List<string>();

            foreach (var path in files.IncludedPaths)
            {
                paths.AddRange(files.IncludedExtensions.Select(extension => string.Format(pathFormat, path, extension, from, to)));
            }

            return paths.ToArray();
        }
Exemplo n.º 2
0
        static string[] BuildFilesParameterString(PerforceFiles files)
        {
            const string pathFormat = "{0}/.../*.{1}";
            var paths = new List<string>();

            foreach (var path in files.IncludedPaths)
            {
                paths.AddRange(files.IncludedExtensions.Select(extension => string.Format(pathFormat, path, extension)));
            }

            return paths.ToArray();
        }
Exemplo n.º 3
0
        public PerforceSource(PerforceFiles files)
        {
            var serverSpecification = ConfigurationManager.AppSettings["ServerSpecification"];
            var workspace = ConfigurationManager.AppSettings["Workspace"];
            var username = ConfigurationManager.AppSettings["Username"];

            var connection = new PerforceConnection
            {
                ServerSpecification = serverSpecification,
                UserName = username,
                Workspace = workspace
            };

            _connection = connection;
            _files = files;
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            var files = new PerforceFiles
            {
                IncludedExtensions = new[] { "cs" },
                IncludedPaths = new[] { "//Dispensing/Dispensing/Branches/Development/Station/Med/src/Dispensing.UI.Win.Med" }
            };

            var source = new PerforceSource(files);

            var calculator = new RiskFactorCalculator();
            var from = DateTime.Now.AddMonths(-2);
            var to = DateTime.Now;

            System.Console.WriteLine("Calculating...");
            var results = calculator.Calculate(source, from, to);

            System.Console.WriteLine("Saving...");
            var target = new MongoTarget();
            target.SaveResults(results);

            System.Console.WriteLine("Done");
            System.Console.ReadKey();
        }