Example #1
0
        public static void Main(string[] args)
        {
            ProgramArgs = ParseArgs(args);

            if (!Build.InitializeBuildEnvironment())
            {
                return;
            }

            if (ProgramArgs.ContainsKey("-cleanup"))
            {
                Build.CleanupBuildEnvironment();
                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-phapppub_gen"))
            {
                Build.BuildPublicHeaderFiles();
            }
            else if (ProgramArgs.ContainsKey("-sdk"))
            {
                Build.CopyKProcessHacker(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug
                    );

                Build.BuildSdk(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                    );
            }
            else if (ProgramArgs.ContainsKey("-cleansdk"))
            {
                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                Build.BuildSdk(
                    BuildFlags.Build32bit |
                    BuildFlags.Build64bit |
                    BuildFlags.BuildVerbose
                    );

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-bin"))
            {
                Build.SetupBuildEnvironment(false);

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }
                if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.CopyEtwTraceGuidsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-debug"))
            {
                Build.SetupBuildEnvironment(true);

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildDebug | BuildFlags.BuildVerbose |
                                         BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSdk(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                        ))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildDebug | BuildFlags.BuildVerbose |
                                         BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.BuildDebug))
                {
                    return;
                }
                if (!Build.CopySidCapsFile(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.CopyEtwTraceGuidsFile(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-appveyor"))
            {
                Build.SetupBuildEnvironment(true);

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    Environment.Exit(1);
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    Environment.Exit(1);
                }

                if (!Build.CopyTextFiles())
                {
                    Environment.Exit(1);
                }
                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    Environment.Exit(1);
                }
                if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }
                if (!Build.CopyEtwTraceGuidsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildBinZip())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildSetupExe())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildPdbZip())
                {
                    Environment.Exit(1);
                }
                //if (!Build.BuildSdkZip())
                //    Environment.Exit(1);
                //if (!Build.BuildSrcZip())
                //    Environment.Exit(1);
                //if (!Build.BuildChecksumsFile())
                //    Environment.Exit(1);
                if (!Build.BuildDeployUploadArtifacts())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildDeployUpdateConfig())
                {
                    Environment.Exit(1);
                }
            }
            else
            {
                Build.SetupBuildEnvironment(true);

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }
                if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }
                if (!Build.CopyEtwTraceGuidsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }
                if (!Build.BuildSetupExe())
                {
                    return;
                }
                Build.BuildPdbZip();
                Build.BuildSdkZip();
                //Build.BuildSrcZip();
                Build.BuildChecksumsFile();
                Build.ShowBuildStats();
            }

            Environment.Exit(Environment.ExitCode);
        }
Example #2
0
        public static void Main(string[] args)
        {
            ProgramArgs = ParseArgs(args);

            if (!Build.InitializeBuildEnvironment())
            {
                return;
            }

            if (ProgramArgs.ContainsKey("-cleanup"))
            {
                if (Restart("-cleanup"))
                {
                    return;
                }

                Build.CleanupBuildEnvironment();
                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-phapppub_gen"))
            {
                Build.BuildPublicHeaderFiles();
            }
            else if (ProgramArgs.ContainsKey("-graph"))
            {
                Build.ShowBuildEnvironment("changelog", true);

                if (Win32.GetConsoleMode(Win32.GetStdHandle(Win32.STD_OUTPUT_HANDLE), out ConsoleMode mode))
                {
                    Win32.SetConsoleMode(Win32.GetStdHandle(Win32.STD_OUTPUT_HANDLE), mode | ConsoleMode.ENABLE_VIRTUAL_TERMINAL_PROCESSING);
                }

                Console.WriteLine(Build.GetBuildLogString());

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-sdk"))
            {
                Build.CopyKProcessHacker(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug
                    );

                Build.BuildSdk(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                    );
            }
            else if (ProgramArgs.ContainsKey("-cleansdk"))
            {
                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                Build.BuildSdk(
                    BuildFlags.Build32bit |
                    BuildFlags.Build64bit |
                    BuildFlags.BuildVerbose
                    );

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-bin"))
            {
                Build.ShowBuildEnvironment("bin", false);
                Build.CopyKeyFiles();

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(
                        BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSdk(
                        BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }
                if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-debug"))
            {
                Build.ShowBuildEnvironment("debug", true);
                Build.CopyKeyFiles();

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildDebug | BuildFlags.BuildVerbose |
                                         BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSdk(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                        ))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildDebug | BuildFlags.BuildVerbose |
                                         BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.BuildDebug))
                {
                    return;
                }
                if (!Build.CopySidCapsFile(
                        BuildFlags.Build32bit | BuildFlags.Build64bit |
                        BuildFlags.BuildDebug | BuildFlags.BuildVerbose))
                {
                    return;
                }

                Build.ShowBuildStats();
            }
            else if (ProgramArgs.ContainsKey("-appveyor"))
            {
                Build.ShowBuildEnvironment("nightly", true);
                Build.CopyKeyFiles();

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    Environment.Exit(1);
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    Environment.Exit(1);
                }

                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    Environment.Exit(1);
                }
                if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildBinZip())
                {
                    Environment.Exit(1);
                }
                //if (!Build.BuildWebSetupExe())
                //    Environment.Exit(1);
                if (!Build.BuildSetupExe())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildPdbZip())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildSdkZip())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildSrcZip())
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildChecksumsFile())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildUpdateSignature())
                {
                    Environment.Exit(1);
                }

                if (!Build.BuildDeployUploadArtifacts())
                {
                    Environment.Exit(1);
                }
                if (!Build.BuildDeployUpdateConfig())
                {
                    Environment.Exit(1);
                }
            }
            else
            {
                Build.ShowBuildEnvironment("release", true);
                Build.CopyKeyFiles();

                if (!Build.BuildSolution("ProcessHacker.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKProcessHacker(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyWow64Files(BuildFlags.None))
                {
                    return;
                }
                if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
                {
                    return;
                }

                if (!Build.BuildBinZip())
                {
                    return;
                }
                if (!Build.BuildSetupExe())
                {
                    return;
                }
                Build.BuildPdbZip();
                Build.BuildSdkZip();
                Build.BuildSrcZip();

                Build.ShowBuildStats();
            }
            //else if (ProgramArgs.ContainsKey("-appxbuild"))
            //{
            //    Build.ShowBuildEnvironment("appx", true, true);
            //    Build.CopyKeyFiles();
            //
            //    if (!Build.BuildSolution("ProcessHacker.sln",
            //        BuildFlags.Build32bit | BuildFlags.Build64bit |
            //        BuildFlags.BuildVerbose | BuildFlags.BuildApi
            //        ))
            //        return;
            //
            //    if (!BuildSdk(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
            //        return;
            //
            //    if (!Build.BuildSolution("plugins\\Plugins.sln",
            //        BuildFlags.Build32bit | BuildFlags.Build64bit |
            //        BuildFlags.BuildVerbose | BuildFlags.BuildApi
            //        ))
            //        return;
            //
            //    if (!Build.CopyWow64Files(BuildFlags.None))
            //        return;
            //    if (!Build.CopySidCapsFile(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose))
            //        return;
            //
            //    Build.BuildAppxPackage(BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose);
            //
            //    Build.ShowBuildStats();
            //}
            //else if (ProgramArgs.ContainsKey("-appxmakecert"))
            //{
            //    if (Restart("-appxmakecert"))
            //        return;
            //
            //    Build.ShowBuildEnvironment("appxcert", true);
            //
            //    Build.BuildAppxSignature();
            //
            //    Build.ShowBuildStats();
            //}
        }