2016-02-04 00:41:11 +01:00
|
|
|
param(
|
2016-02-10 00:40:22 +01:00
|
|
|
# "" is for default generator on the platform
|
2016-02-04 00:41:11 +01:00
|
|
|
[ValidateSet(
|
|
|
|
"",
|
|
|
|
"Visual Studio 12 2013",
|
|
|
|
"Visual Studio 12 2013 Win64",
|
|
|
|
"Visual Studio 14 2015",
|
|
|
|
"Visual Studio 14 2015 Win64")]
|
2016-02-10 00:40:22 +01:00
|
|
|
[string]$cmakeGenerator = "Visual Studio 12 2013",
|
2016-02-04 02:23:38 +01:00
|
|
|
|
|
|
|
[ValidateSet(
|
|
|
|
"Debug",
|
|
|
|
"Release")]
|
|
|
|
[string]$msbuildConfiguration = "Release"
|
2016-02-04 00:41:11 +01:00
|
|
|
)
|
|
|
|
|
2016-02-03 01:09:58 +01:00
|
|
|
$origPWD = $pwd
|
|
|
|
try
|
|
|
|
{
|
2016-02-04 00:41:11 +01:00
|
|
|
$prechecks = $true
|
|
|
|
# check per-requests
|
|
|
|
if (-not (get-command cmake -ErrorAction SilentlyContinue))
|
|
|
|
{
|
|
|
|
Write-Warning 'cmake not found. You can install it from https://chocolatey.org/packages/cmake.portable'
|
|
|
|
$prechecks = $false
|
|
|
|
}
|
|
|
|
|
|
|
|
if (-not (get-command msbuild -ErrorAction SilentlyContinue))
|
|
|
|
{
|
|
|
|
Write-Warning 'msbuild not found. Install Visual Studio and add msbuild to $env:PATH'
|
|
|
|
$prechecks = $false
|
|
|
|
}
|
|
|
|
|
|
|
|
if (-not (get-command dotnet -ErrorAction SilentlyContinue))
|
|
|
|
{
|
|
|
|
Write-Warning 'dotnet not found. Install it from http://dotnet.github.io/getting-started/'
|
|
|
|
$prechecks = $false
|
|
|
|
}
|
|
|
|
|
|
|
|
if (-not $prechecks)
|
|
|
|
{
|
|
|
|
return
|
|
|
|
}
|
|
|
|
# end per-requests
|
|
|
|
|
2016-02-03 01:09:58 +01:00
|
|
|
$BINFULL = "$pwd/binFull"
|
|
|
|
$BUILD = "$pwd/build"
|
|
|
|
|
|
|
|
mkdir $BINFULL -ErrorAction SilentlyContinue
|
|
|
|
|
|
|
|
# Publish PowerShell
|
|
|
|
cd src\Microsoft.PowerShell.ConsoleHost
|
|
|
|
dotnet publish --framework dnx451 --output $BINFULL
|
|
|
|
|
|
|
|
mkdir $build -ErrorAction SilentlyContinue
|
|
|
|
cd $build
|
|
|
|
|
2016-02-04 00:41:11 +01:00
|
|
|
if ($cmakeGenerator)
|
|
|
|
{
|
|
|
|
cmake -G "$cmakeGenerator" ..\src\powershell-native
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cmake ..\src\powershell-native
|
|
|
|
}
|
2016-02-10 00:40:22 +01:00
|
|
|
|
|
|
|
msbuild powershell.vcxproj /p:Configuration=$msbuildConfiguration
|
2016-02-03 01:09:58 +01:00
|
|
|
|
2016-02-04 02:23:38 +01:00
|
|
|
cp -rec $msbuildConfiguration\* $BINFULL
|
2016-02-03 01:09:58 +01:00
|
|
|
}
|
|
|
|
finally
|
|
|
|
{
|
|
|
|
cd $origPWD
|
|
|
|
}
|