Exemple #1
0
        public override bool Execute()
        {
            var result = ExpressionHasherWriter.Write(this.InputFiles.Select(c => c.ItemSpec).ToArray());

            File.WriteAllText(this.OutputFile.ItemSpec, result);

            return(true);
        }
Exemple #2
0
        public void TestHasher()
        {
            var paths = Directory.EnumerateFiles(@"..\..\..\..\src\Shaolinq", "*.cs", SearchOption.AllDirectories)
                        .Where(c => !Path.GetFileName(c).StartsWith("Generated")).ToArray();

            var s = ExpressionHasherWriter.Write(paths);

            Console.WriteLine(s);
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            string output = null;
            string writer = null;

            string[] input = null;

            for (var i = 0; i < args.Length; i++)
            {
                var arg = args[i];

                if (arg == "-writer")
                {
                    writer = args[++i];
                }
                else if (arg == "-output")
                {
                    output = args[++i];
                }
                else
                {
                    input = new string[args.Length - i];

                    Array.Copy(args, i, input, 0, args.Length - i);

                    break;
                }
            }

            if (writer == "comparer")
            {
                ExpressionComparerWriter.Write(input, output);
            }
            else if (writer == "hasher")
            {
                ExpressionHasherWriter.Write(input, output);
            }
        }
Exemple #4
0
        public static void Write(string[] sourcePaths, string outputFile)
        {
            var result = new ExpressionHasherWriter(sourcePaths).Write();

            File.WriteAllText(outputFile, result);
        }