Skip to content

Commit

Permalink
Restores correct Bootstrap.ps1 script....
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-spinelli committed Apr 18, 2016
1 parent 1e2089f commit 6181a96
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions CodeCakeBuilder/Bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@ if (!(Test-Path $builderDir -PathType Container)) {
$solutionDir = Join-Path $builderDir ".."
}

# Ensures that CodeCakeBuilder project exists.
$builderProj = Join-Path $builderDir "CodeCakeBuilder.csproj"
if (!(Test-Path $builderProj)) {
Throw "Could not find CodeCakeBuilder.csproj"
}
# Ensures that packages.config file exists.
$builderPackageConfig = Join-Path $builderDir "packages.config"
if (!(Test-Path $builderPackageConfig)) {
Throw "Could not find packages.config"
}

# Find MSBuild 4.0.
$dotNetVersion = "4.0"
$regKey = "HKLM:\software\Microsoft\MSBuild\ToolsVersions\$dotNetVersion"
$regProperty = "MSBuildToolsPath"
$msbuildExe = join-path -path (Get-ItemProperty $regKey).$regProperty -childpath "msbuild.exe"
if (!(Test-Path $msbuildExe)) {
Throw "Could not find msbuild.exe"
}


# Tools directory is for nuget.exe but it may be used to
# contain other utilities.
$toolsDir = Join-Path $builderDir "Tools"
Expand All @@ -27,3 +48,7 @@ if (!(Test-Path $nugetExe)) {
Throw "Could not find NuGet.exe"
}
}

&$nugetExe restore $builderPackageConfig -SolutionDirectory $solutionDir
&$msbuildExe $builderProj /p:Configuration=Release

0 comments on commit 6181a96

Please sign in to comment.