Exemple #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("-appxbuild"))
            //{
            //    Build.SetupBuildEnvironment(true);
            //
            //    if (!Build.BuildSolution("SystemInformer.sln",
            //        BuildFlags.Build32bit | BuildFlags.Build64bit |
            //        BuildFlags.BuildVerbose | BuildFlags.BuildApi
            //        ))
            //        return;
            //
            //    if (!Build.CopyKernelDriver(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.BuildAppxPackage(
            //        BuildFlags.Build32bit | BuildFlags.Build64bit | BuildFlags.BuildVerbose
            //        );
            //
            //    Build.ShowBuildStats();
            //}
            else if (ProgramArgs.ContainsKey("-phapppub_gen"))
            {
                Build.BuildPublicHeaderFiles();
            }
            else if (ProgramArgs.ContainsKey("-sdk"))
            {
                Build.CopyKernelDriver(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug
                    );

                Build.BuildSdk(
                    BuildFlags.Build32bit | BuildFlags.Build64bit |
                    BuildFlags.BuildDebug | BuildFlags.BuildVerbose
                    );
            }
            else if (ProgramArgs.ContainsKey("-cleansdk"))
            {
                if (!Build.BuildSolution("SystemInformer.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("SystemInformer.sln",
                                         BuildFlags.Build32bit | BuildFlags.Build64bit |
                                         BuildFlags.BuildVerbose | BuildFlags.BuildApi
                                         ))
                {
                    return;
                }

                if (!Build.CopyKernelDriver(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);

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

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

                if (!Build.CopyKernelDriver(
                        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);

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

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

                if (!Build.CopyKernelDriver(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);

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

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

                if (!Build.CopyKernelDriver(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);
        }