tasks/build.process.ps1

# Top-level build process control flags
$SkipInit = $false
$SkipVersion = $false
$SkipBuild = $false
$SkipTest = $false
$SkipTestReport = $false
$SkipPackage = $false
$SkipPublish = $false

# Define overall build process
task PreInit
task InitCore ApplyEnvironmentVariableOverrides,DetectBuildServer,RunChecks
task PostInit
task Init -If {!$SkipInit} PreInit,InitCore,PostInit

task PreVersion
task VersionCore GitVersion,SetBuildServerBuildNumber
task PostVersion
task Version -If {!$SkipVersion} Init,PreVersion,VersionCore,PostVersion

task PreBuild
task BuildCore BuildSolution,BuildPython,BuildBicepFiles,BuildPowerBiReports
task PostBuild
task Build -If {!$SkipBuild} Init,Version,PreBuild,BuildCore,PostBuild

task PreTest
task TestCore RunTests,RunTestsWithCoverlet,RunPythonTests,RunPesterTests,ValidateBicepModules
task PostTest
task Test -If {!$SkipTest} Init,PreTest,TestCore,PostTest

task PreTestReport
task TestReportCore
task PostTestReport
task TestReport -If {!$SkipTest -and !$SkipTestReport} Init,PreTestReport,TestReportCore,PostTestReport

task PreAnalysis
task AnalysisCore RunCovenant
task PostAnalysis
task Analysis -If {!$SkipAnalysis} Init,Version,PreAnalysis,AnalysisCore,PostAnalysis

task PrePackage
task PackageCore BuildSolutionPackages,BuildProjectPublishPackages,BuildNuSpecPackages,BuildPythonPackages,BuildContainerImages
task PostPackage
task Package -If {!$SkipPackage} Init,Version,PrePackage,PackageCore,PostPackage

task PrePublish
task PublishCore PublishBicepModules,PublishContainerImages,PublishSolutionPackages,PublishPythonPackages,PublishPowerShellModules,PublishGitHubRelease
task PostPublish
task Publish -If {!$SkipPublish} Init,Version,PrePublish,PublishCore,PostPublish

task RunFirst
task RunLast


task FullBuild RunFirst,
                Init,
                Version,
                Build,
                Test,
                TestReport,
                Analysis,
                Package,
                RunLast

task FullBuildAndPublish RunFirst,
                            Init,
                            Version,
                            Build,
                            Test,
                            TestReport,
                            Analysis,
                            Package,
                            Publish,
                            RunLast