提交 495489b9 编写于 作者: J Jared Parsons 提交者: Jared Parsons

Bring the scripts up to date with our powershell guidelines

上级 831f2663
Param(
[string]$version = ""
)
[CmdletBinding(PositionalBinding=$false)]
Param([string]$version = "")
set-strictmode -version 2.0
$ErrorActionPreference="Stop"
Set-StrictMode -version 2.0
$ErrorActionPreference = "Stop"
try {
if ($version -eq "") {
write-host "Need a -version"
Write-Host "Need a -version"
exit 1
}
$rootPath = resolve-path (join-path $PSScriptRoot "..\..\..\")
$repoUtil = join-path $rootPath "Binaries\Debug\Exes\RepoUtil\RepoUtil.exe"
if (-not (test-path $repoUtil)) {
write-host "RepoUtil not found $repoUtil"
$rootPath = Resolve-Path (Join-Path $PSScriptRoot "..\..\..\")
$repoUtil = Join-Path $rootPath "Binaries\Debug\Exes\RepoUtil\RepoUtil.exe"
if (-not (Test-Path $repoUtil)) {
Write-Host "RepoUtil not found $repoUtil"
exit 1
}
$fileList = gc (join-path $PSScriptRoot "files.txt")
$fileList = Get-Content (Join-Path $PSScriptRoot "files.txt")
$shortVersion = $version.Substring(0, $version.IndexOf('.'))
$packageVersion = "15.0.$shortVersion-alpha"
$changeList = @()
write-host "Moving version to $packageVersion"
Write-Host "Moving version to $packageVersion"
foreach ($item in $fileList) {
$name = split-path -leaf $item
$name = Split-Path -leaf $item
$simpleName = [IO.Path]::GetFileNameWithoutExtension($name)
$changeList += "$simpleName $packageVersion"
}
$changeFilePath = [IO.Path]::GetTempFileName()
$changeList -join [Environment]::NewLine | out-file $changeFilePath
write-host (gc -raw $changeFilePath)
$changeList -join [Environment]::NewLine | Out-File $changeFilePath
Write-Host (gc -raw $changeFilePath)
$fullSln = join-path $rootPath "..\Roslyn.sln"
if (test-path $fullSln) {
$fullSln = Join-Path $rootPath "..\Roslyn.sln"
if (Test-Path $fullSln) {
# Running as a part of the full enlisment. Need to add some extra paramteers
$sourcesPath = resolve-path (join-path $rootPath "..")
$sourcesPath = Resolve-Path (Join-Path $rootPath "..")
$generatePath = $rootPath
$configPath = join-path $rootPath "build\config\RepoUtilData.json"
$configPath = Join-Path $rootPath "build\config\RepoUtilData.json"
& $repoUtil -sourcesPath $sourcesPath -generatePath $generatePath -config $configPath change -version $changeFilePath
}
else {
......@@ -48,7 +47,8 @@ try {
}
}
catch [exception] {
write-host $_.Exception
exit -1
catch {
Write-Host $_
Write-Host $_.Exception
exit 1
}
Param(
[string]$version = "26014.00",
[CmdletBinding(PositionalBinding=$false)]
Param( [string]$version = "26014.00",
[string]$branch = "d15rel",
[string]$outPath = $null,
[string]$fakeSign = $null
)
set-strictmode -version 2.0
$ErrorActionPreference="Stop"
Set-StrictMode -version 2.0
$ErrorActionPreference = "Stop"
function Create-Directory([string]$name) {
[IO.Directory]::CreateDirectory($name)
}
# Package a normal DLL into a nuget. Default used for packages that have a simple 1-1
# relationship between DLL and NuGet for only Net46.
function package-normal() {
$baseNuspecPath = join-path $PSScriptRoot "base.nuspec"
$sourceFilePath = join-path $dropPath $item
$filePath = join-path $dllPath $name
if (-not (test-path $sourceFilePath)) {
write-host "Could not locate $sourceFilePath"
$baseNuspecPath = Join-Path $PSScriptRoot "base.nuspec"
$sourceFilePath = Join-Path $dropPath $item
$filePath = Join-Path $dllPath $name
if (-not (Test-Path $sourceFilePath)) {
Write-Host "Could not locate $sourceFilePath"
continue;
}
cp $sourceFilePath $filePath
Copy-Item $sourceFilePath $filePath
& $fakeSign -f $filePath
& $nuget pack $baseNuspecPath -OutputDirectory $packagePath -Properties name=$simpleName`;version=$packageVersion`;filePath=$filePath
}
......@@ -27,75 +31,75 @@ function package-normal() {
# The debugger DLLs have a more complex structure and it's easier to special case
# copying them over.
function copy-debugger() {
$refRootPath = [IO.Path]::GetFullPath((join-path $dropPath "..\..\Debugger\ReferenceDLL"))
$debuggerDllPath = join-path $dllPath "debugger"
$net20Path = join-path $debuggerDllPath "net20"
$net45Path = join-path $debuggerDllPath "net45"
$portablePath = join-path $debuggerDllPath "portable"
$refRootPath = [IO.Path]::GetFullPath((Join-Path $dropPath "..\..\Debugger\ReferenceDLL"))
$debuggerDllPath = Join-Path $dllPath "debugger"
$net20Path = Join-Path $debuggerDllPath "net20"
$net45Path = Join-Path $debuggerDllPath "net45"
$portablePath = Join-Path $debuggerDllPath "portable"
mkdir $debuggerDllPath -ErrorAction SilentlyContinue | out-null
mkdir $net20Path -ErrorAction SilentlyContinue | out-null
mkdir $net45Path -ErrorAction SilentlyContinue | out-null
mkdir $portablePath -ErrorAction SilentlyContinue | out-null
Create-Directory $debuggerDllPath
Create-Directory $net20Path
Create-Directory $net45Path
Create-Directory $portablePath
pushd $debuggerDllPath
Push-Location $debuggerDllPath
try {
$d = join-path $dropPath "..\..\Debugger"
cp (join-path $d "RemoteDebugger\Microsoft.VisualStudio.Debugger.Engine.dll") $net20Path
cp (join-path $d "IDE\Microsoft.VisualStudio.Debugger.Engine.dll") $net45Path
cp (join-path $d "x-plat\coreclr.windows\mcg\Microsoft.VisualStudio.Debugger.Engine.dll") $portablePath
cp (join-path $dropPath "Microsoft.VisualStudio.Debugger.Metadata.dll") $net20Path
cp (join-path $dropPath "Microsoft.VisualStudio.Debugger.Metadata.dll") $portablePath
gci -re -in *.dll | %{ & $fakeSign -f $_ }
$d = Join-Path $dropPath "..\..\Debugger"
Copy-Item (Join-Path $d "RemoteDebugger\Microsoft.VisualStudio.Debugger.Engine.dll") $net20Path
Copy-Item (Join-Path $d "IDE\Microsoft.VisualStudio.Debugger.Engine.dll") $net45Path
Copy-Item (Join-Path $d "x-plat\coreclr.windows\mcg\Microsoft.VisualStudio.Debugger.Engine.dll") $portablePath
Copy-Item (Join-Path $dropPath "Microsoft.VisualStudio.Debugger.Metadata.dll") $net20Path
Copy-Item (Join-Path $dropPath "Microsoft.VisualStudio.Debugger.Metadata.dll") $portablePath
Get-ChildItem -re -in *.dll | %{ & $fakeSign -f $_ }
}
finally {
popd
Pop-Location
}
}
# Used to package debugger nugets
function package-debugger() {
param( [string]$kind )
$debuggerPath = join-path $dllPath "debugger"
$nuspecPath = join-path $PSScriptRoot "$kind.nuspec"
$debuggerPath = Join-Path $dllPath "debugger"
$nuspecPath = Join-Path $PSScriptRoot "$kind.nuspec"
& $nuget pack $nuspecPath -OutputDirectory $packagePath -Properties version=$packageVersion`;debuggerPath=$debuggerPath
}
try {
if ($outPath -eq "") {
write-host "Need an -outPath value"
Write-Host "Need an -outPath value"
exit 1
}
if ($fakeSign -eq "") {
write-host "Need a -fakeSign value"
Write-Host "Need a -fakeSign value"
exit 1
}
$list = gc (join-path $PSScriptRoot "files.txt")
$list = Get-Content (Join-Path $PSScriptRoot "files.txt")
$dropPath = "\\cpvsbuild\drops\VS\$branch\raw\$version\binaries.x86ret\bin\i386"
$nuget = join-path $PSScriptRoot "..\..\..\nuget.exe"
$nuget = Join-Path $PSScriptRoot "..\..\..\nuget.exe"
$shortVersion = $version.Substring(0, $version.IndexOf('.'))
$packageVersion = "15.0.$shortVersion-alpha"
$dllPath = join-path $outPath "Dlls"
$packagePath = join-path $outPath "Packages"
$dllPath = Join-Path $outPath "Dlls"
$packagePath = Join-Path $outPath "Packages"
write-host "Drop path is $dropPath"
write-host "Package version $packageVersion"
write-host "Out path is $outPath"
Write-Host "Drop path is $dropPath"
Write-Host "Package version $packageVersion"
Write-Host "Out path is $outPath"
mkdir $outPath -ErrorAction SilentlyContinue | out-null
mkdir $dllPath -ErrorAction SilentlyContinue | out-null
mkdir $packagePath -ErrorAction SilentlyContinue | out-null
pushd $outPath
Create-Directory $outPath
Create-Directory $dllPath
Create-Directory $packagePath
Push-Location $outPath
try {
copy-debugger
foreach ($item in $list) {
$name = split-path -leaf $item
$name = Split-Path -leaf $item
$simpleName = [IO.Path]::GetFileNameWithoutExtension($name)
write-host "Packing $simpleName"
Write-Host "Packing $simpleName"
switch ($simpleName) {
"Microsoft.VisualStudio.Debugger.Engine" { package-debugger "engine" }
"Microsoft.VisualStudio.Debugger.Metadata" { package-debugger "metadata" }
......@@ -104,10 +108,10 @@ try {
}
}
finally {
popd
Pop-Location
}
}
catch [exception] {
write-host $_.Exception
exit -1
catch {
Write-Host $_
exit 1
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册