Skip to content

Commit

Permalink
Rephrase psake script so that only intended entry points are declared…
Browse files Browse the repository at this point in the history
… as 'task', while all other operations are declared as 'function'.
  • Loading branch information
plioi committed Jun 7, 2016
1 parent 03e0ecf commit c7666af
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ task Package -depends Test {
write-host " tools\NuGet push package\Parsley.$version.nupkg"
}

task Test -depends Compile {
task Test {
generate-assembly-info
generate-license
compile-solution

$testRunners = @(gci src\packages -rec -filter xunit.console.exe)

if ($testRunners.Length -ne 1)
Expand All @@ -43,12 +47,12 @@ task Test -depends Compile {
}
}

task Compile -depends AssemblyInfo, License {
function compile-solution {
exec { msbuild /t:clean /v:q /nologo /p:Configuration=$configuration src\Parsley.sln }
exec { msbuild /t:build /v:q /nologo /p:Configuration=$configuration src\Parsley.sln }
}

task AssemblyInfo {
function generate-assembly-info {
$assemblyVersion = $version
if ($assemblyVersion.Contains("-")) {
$assemblyVersion = $assemblyVersion.Substring(0, $assemblyVersion.IndexOf("-"))
Expand Down Expand Up @@ -80,7 +84,7 @@ using System.Runtime.InteropServices;
}
}

task License {
function generate-license {
$copyright = get-copyright

regenerate-file "LICENSE.txt" @"
Expand Down

0 comments on commit c7666af

Please sign in to comment.