static void Main(string[] args)
        {
            var projects = args[0]
                           .Split(',')
                           .Select(LoadProject)
                           .ToArray();

            var outFile     = args[1];
            var script      = args[2];
            var mainProject = projects.First();
            var asmInfo     = @"\assemblyinfo.cs";

            var assemblyInfo = mainProject.Compile
                               .FirstOrDefault(x => x.ToLower().EndsWith(asmInfo));

            var mergedReference = projects.SelectMany(x => x.Reference).Distinct();
            var mergedCompile   = projects
                                  .SelectMany(x => x.Compile)
                                  .Where(x => !x.ToLower().EndsWith(asmInfo) || x == assemblyInfo)
                                  .Distinct();
            var mergedCopies = projects.SelectMany(x => x.Copies).Distinct();

            var mergedProject = new Project(
                mainProject.CSProj,
                mergedReference,
                mergedCompile,
                outFile,
                new [] { "MONO", "DEBUG", "TRACE" },
                mergedCopies);

            var generator = new WindowsBuildScriptGenerator();
            var cmd       = generator.CreateScript(mergedProject);

            File.WriteAllText(script, cmd);
        }
        static void Main(string[] args)
        {
            var projects = args[0]
                .Split(',')
                .Select(LoadProject)
                .ToArray();

            var outFile = args[1];
            var script = args[2];
            var mainProject = projects.First();
            var asmInfo = @"\assemblyinfo.cs";

            var assemblyInfo = mainProject.Compile
                .FirstOrDefault(x => x.ToLower().EndsWith(asmInfo));

            var mergedReference = projects.SelectMany(x => x.Reference).Distinct();
            var mergedCompile = projects
                .SelectMany(x => x.Compile)
                .Where(x => !x.ToLower().EndsWith(asmInfo) || x == assemblyInfo)
                .Distinct();
            var mergedCopies = projects.SelectMany(x => x.Copies).Distinct();

            var mergedProject = new Project(
                mainProject.CSProj,
                mergedReference,
                mergedCompile,
                outFile,
                new [] { "MONO", "DEBUG", "TRACE" },
                mergedCopies);

            var generator = new WindowsBuildScriptGenerator();
            var cmd = generator.CreateScript(mergedProject);

            File.WriteAllText(script, cmd);
        }