예제 #1
0
        public static void DupFinderFromConfig(this ICakeContext context, FilePath configFile)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var runner = new DupFinderRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log);

            runner.RunFromConfig(configFile);
        }
예제 #2
0
        public static void DupFinder(this ICakeContext context, IEnumerable <FilePath> files, DupFinderSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var runner = new DupFinderRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log);

            runner.Run(files, settings);
        }
예제 #3
0
        public static void DupFinder(this ICakeContext context, string pattern, DupFinderSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (pattern == null)
            {
                throw new ArgumentNullException("pattern");
            }
            var sourceFiles = context.Globber.Match(pattern).OfType <FilePath>();

            var runner = new DupFinderRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Globber);

            runner.Run(sourceFiles, settings);
        }
예제 #4
0
        public static void DupFinder(this ICakeContext context, GlobPattern pattern, DupFinderSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (pattern == null)
            {
                throw new ArgumentNullException(nameof(pattern));
            }

            var sourceFiles = context.Globber.GetFiles(pattern).ToArray();

            if (sourceFiles.Length == 0)
            {
                context.Log.Verbose("The provided pattern did not match any files.");
                return;
            }

            var runner = new DupFinderRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log);

            runner.Run(sourceFiles, settings);
        }