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

            if (ProgramArgs.ContainsKey("-cleanup"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }


                Build.CleanupBuildEnvironment();
                return;
            }
            else if (ProgramArgs.ContainsKey("-updaterev"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.ShowBuildEnvironment(false);
                Build.UpdateHeaderFileVersion();
                return;
            }
            else if (ProgramArgs.ContainsKey("-phapppub_gen"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.BuildPublicHeaderFiles();
                return;
            }
            else if (ProgramArgs.ContainsKey("-sign"))
            {
                Build.BuildKphSignatureFile(false);
                return;
            }
            else if (ProgramArgs.ContainsKey("-sdk"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

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

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

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

                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

                Build.ShowBuildStats(false);
                return;
            }
            else if (ProgramArgs.ContainsKey("-cleansdk"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                if (!Build.BuildSolution("ProcessHacker.sln", true, false, true))
                {
                    return;
                }

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

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

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

                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

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

                Build.ShowBuildEnvironment(false);
                Build.BuildSecureFiles();

                if (!Build.BuildSolution("ProcessHacker.sln", true, false, true))
                {
                    return;
                }

                if (!Build.BuildKphSignatureFile(false))
                {
                    return;
                }

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

                if (!Build.CopyKProcessHacker(false))
                {
                    return;
                }

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

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

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

                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", true, false, true))
                {
                    return;
                }

                if (!Build.CopyWow64Files(false))
                {
                    return;
                }

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

                Build.ShowBuildStats(false);
            }
            else if (ProgramArgs.ContainsKey("-debug"))
            {
                if (!Build.InitializeBuildEnvironment(true))
                {
                    return;
                }

                Build.ShowBuildEnvironment(true);
                Build.BuildSecureFiles();

                if (!Build.BuildSolution("ProcessHacker.sln", true, true, true))
                {
                    return;
                }

                if (!Build.BuildKphSignatureFile(true))
                {
                    return;
                }
                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyKProcessHacker(true))
                {
                    return;
                }

                if (!Build.CopyPluginSdkHeaders())
                {
                    return;
                }
                if (!Build.CopyVersionHeader())
                {
                    return;
                }
                if (!Build.FixupResourceHeader())
                {
                    return;
                }
                if (!Build.CopyLibFiles(true))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", true, true, true))
                {
                    return;
                }

                if (!Build.CopyWow64Files(true))
                {
                    return;
                }

                Build.ShowBuildStats(true);
            }
            else if (ProgramArgs.ContainsKey("-release"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.ShowBuildEnvironment(false);
                Build.BuildSecureFiles();

                if (!Build.BuildSolution("ProcessHacker.sln", true, false, true))
                {
                    return;
                }

                if (!Build.BuildKphSignatureFile(false))
                {
                    return;
                }
                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyKProcessHacker(false))
                {
                    return;
                }

                if (!Build.CopyPluginSdkHeaders())
                {
                    return;
                }
                if (!Build.CopyVersionHeader())
                {
                    return;
                }
                if (!Build.FixupResourceHeader())
                {
                    return;
                }
                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", true, false, true))
                {
                    return;
                }

                if (!Build.CopyWow64Files(false))
                {
                    return;
                }

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

                Build.BuildSdkZip();

                Build.BuildSrcZip();
            }
            else if (ProgramArgs.ContainsKey("-appveyor"))
            {
                if (!Build.InitializeBuildEnvironment(false))
                {
                    return;
                }

                Build.ShowBuildEnvironment(false);
                Build.BuildSecureFiles();

                if (!Build.BuildSolution("ProcessHacker.sln", true, false, true))
                {
                    return;
                }

                if (!Build.BuildKphSignatureFile(false))
                {
                    return;
                }
                if (!Build.CopyTextFiles())
                {
                    return;
                }
                if (!Build.CopyKProcessHacker(false))
                {
                    return;
                }

                if (!Build.CopyPluginSdkHeaders())
                {
                    return;
                }
                if (!Build.CopyVersionHeader())
                {
                    return;
                }
                if (!Build.FixupResourceHeader())
                {
                    return;
                }
                if (!Build.CopyLibFiles(false))
                {
                    return;
                }

                if (!Build.BuildSolution("plugins\\Plugins.sln", true, false, true))
                {
                    return;
                }

                if (!Build.CopyWow64Files(false))
                {
                    return;
                }

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

                if (!Build.BuildChecksumsFile())
                {
                    return;
                }
                if (!Build.BuildUpdateSignature())
                {
                    return;
                }

                if (Build.AppveyorUploadBuildFiles())
                {
                    Build.WebServiceUpdateConfig();
                }
            }
            else
            {
                Console.WriteLine("Invalid arguments.\n");
            }
        }