-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add init script and more contributing guidance
Fixes #85
- Loading branch information
Showing
5 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
powershell.exe -ExecutionPolicy bypass -Command "& '%~dpn0.ps1'" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<# | ||
.SYNOPSIS | ||
Prepares a machine to build and test this project. | ||
#> | ||
Param( | ||
) | ||
|
||
Push-Location $PSScriptRoot | ||
try { | ||
$toolsPath = "$PSScriptRoot\tools" | ||
|
||
# First restore NuProj packages since the solution restore depends on NuProj evaluation succeeding. | ||
gci "$PSScriptRoot\src\project.json" -rec |? { $_.FullName -imatch 'nuget' } |% { | ||
& "$toolsPath\Restore-NuGetPackages.ps1" -Path $_ -Verbosity quiet | ||
} | ||
|
||
& "$toolsPath\Restore-NuGetPackages.ps1" -Path "$PSScriptRoot\src" -Verbosity quiet | ||
|
||
Write-Host "Successfully restored all dependencies" -ForegroundColor Green | ||
} | ||
catch { | ||
Write-Error "Aborting script due to error" | ||
exit $lastexitcode | ||
} | ||
finally { | ||
Pop-Location | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<# | ||
.SYNOPSIS | ||
Downloads the NuGet.exe tool and returns the path to it. | ||
#> | ||
|
||
function Expand-ZIPFile($file, $destination) { | ||
if (!(Test-Path $destination)) { $null = mkdir $destination } | ||
$shell = new-object -com shell.application | ||
$zip = $shell.NameSpace((Resolve-Path $file).Path) | ||
foreach ($item in $zip.items()) { | ||
$shell.Namespace((Resolve-Path $destination).Path).copyhere($item) | ||
} | ||
} | ||
|
||
$binaryToolsPath = "$PSScriptRoot\..\obj\tools" | ||
if (!(Test-Path $binaryToolsPath)) { $null = mkdir $binaryToolsPath } | ||
$nugetPath = "$binaryToolsPath\nuget.exe" | ||
if (!(Test-Path $nugetPath)) { | ||
$NuGetVersion = "3.3.0" | ||
Write-Host "Downloading nuget.exe $NuGetVersion..." -ForegroundColor Yellow | ||
Invoke-WebRequest -Uri "https://dist.nuget.org/win-x86-commandline/v$NuGetVersion/nuget.exe" -OutFile $nugetPath | ||
} | ||
|
||
$nugetPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<# | ||
.SYNOPSIS | ||
Restores NuGet packages. | ||
.PARAMETER Path | ||
The path of the solution, directory, packages.config or project.json file to restore packages from. | ||
If not specified, the current directory is used. | ||
.PARAMETER Verbosity | ||
#> | ||
Param( | ||
[Parameter(Position=1)] | ||
[string]$Path=(Get-Location), | ||
[Parameter()] | ||
[ValidateSet('Quiet','Normal','Detailed')] | ||
[string]$Verbosity='normal' | ||
) | ||
|
||
$nugetPath = & "$PSScriptRoot\Get-NuGetTool.ps1" | ||
|
||
Write-Host "Restoring NuGet packages for $Path" -ForegroundColor Yellow | ||
& $nugetPath restore $Path -MSBuildVersion 14.0 -Verbosity $Verbosity | ||
if ($lastexitcode -ne 0) { throw } |