public override bool Execute()
        {
            var result = ExpressionComparerWriter.Write(this.InputFiles.Select(c => c.ItemSpec).ToArray());

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

            return(true);
        }
示例#2
0
        public static void Write(string[] sourcePaths, string outputPath)
        {
            Console.WriteLine(Environment.CurrentDirectory);

            var result = new ExpressionComparerWriter(sourcePaths).Write();

            File.WriteAllText(outputPath, result);
        }
示例#3
0
        public void TestWriter()
        {
            var paths = Directory.EnumerateFiles(@"..\..\..\..\src\Shaolinq", "*.cs", SearchOption.AllDirectories)
                        .Where(c => !Path.GetFileName(c).StartsWith("Generated")).ToArray();

            var s = ExpressionComparerWriter.Write(paths);

            Console.WriteLine(s);
        }
示例#4
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);
            }
        }