From 25a52ae3d7a7f81545587a6bb3e2cf685b012886 Mon Sep 17 00:00:00 2001 From: Claudio Spizzi Date: Thu, 20 Jul 2017 23:52:50 +0200 Subject: [PATCH] Update build script --- build.psake.ps1 | 22 ++++++++++++---------- build.settings.ps1 | 5 +++-- 2 files changed, 15 insertions(+), 12 deletions(-) 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'