diff --git a/build.psake.ps1 b/build.psake.ps1 index 43484e4..3af2756 100644 --- a/build.psake.ps1 +++ b/build.psake.ps1 @@ -34,19 +34,21 @@ Task Clean -depends Init -requiredVariables ReleasePath, TestPath, AnalyzePath { } # Compile C# solutions -Task Compile -depends Clean -requiredVariables SourcePath, SourceNames, MSBuildPath { +Task Compile -depends Clean -requiredVariables SourceEnabled, SourcePath, SourceNames, MSBuildPath { - if (Test-Path -Path $SourcePath) + if (!$SourceEnabled) { - if ($Env:Path -notlike "*$MSBuildPath*") - { - $Env:Path = "$MSBuildPath;$Env:Path" - } + return + } - foreach ($sourceName in $SourceNames) - { - MSBuild.exe "$SourcePath\$sourceName.sln" /target:Build /p:Configuration=Release - } + if ($Env:Path -notlike "*$MSBuildPath*") + { + $Env:Path = "$MSBuildPath;$Env:Path" + } + + foreach ($sourceName in $SourceNames) + { + MSBuild.exe "$SourcePath\$sourceName.sln" /target:Build /p:Configuration=Release } } diff --git a/build.settings.ps1 b/build.settings.ps1 index c3b64e9..d1824d0 100644 --- a/build.settings.ps1 +++ b/build.settings.ps1 @@ -4,8 +4,9 @@ Properties { $ModulePath = Join-Path -Path $PSScriptRoot -ChildPath 'Modules' $ModuleNames = Get-ChildItem -Path $ModulePath | Select-Object -ExpandProperty 'BaseName' -First 1 - $SourcePath = Join-Path -Path $PSScriptRoot -ChildPath 'Sources' - $SourceNames = Get-ChildItem -Path $SourcePath -Filter '*.sln' | Select-Object -ExpandProperty 'BaseName' -First 1 + $SourceEnabled = $true + $SourcePath = Join-Path -Path $PSScriptRoot -ChildPath 'Sources' + $SourceNames = Get-ChildItem -Path $SourcePath -Filter '*.sln' | Select-Object -ExpandProperty 'BaseName' -First 1 $ReleasePath = Join-Path -Path $PSScriptRoot -ChildPath 'bin'