-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make our repo look like most others by having the standard: - Restore.cmd - Build.cmd - Test.cmd
- Loading branch information
Showing
7 changed files
with
135 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
powershell -noprofile -executionPolicy RemoteSigned -file "%~dp0\build\scripts\build.ps1" -build %* |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@if not defined EchoOn @echo off | ||
powershell -noprofile -executionPolicy RemoteSigned -file "%~dp0\build\scripts\restore-legacy.ps1" %* | ||
@echo off | ||
powershell -noprofile -executionPolicy RemoteSigned -file "%~dp0\build\scripts\build.ps1" -restore %* | ||
|
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,2 @@ | ||
@echo off | ||
powershell -noprofile -executionPolicy RemoteSigned -file "%~dp0\build\scripts\build.ps1" -test %* |
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,71 @@ | ||
# Script to run standard developer operations: restore, build and test. | ||
[CmdletBinding(PositionalBinding=$false)] | ||
param ( | ||
[switch]$build = $false, | ||
[switch]$restore = $false, | ||
[switch]$test = $false, | ||
[switch]$clean = $false, | ||
[switch]$clearPackageCache = $false, | ||
[string]$project = "", | ||
[string]$msbuildDir = "") | ||
|
||
Set-StrictMode -version 2.0 | ||
$ErrorActionPreference="Stop" | ||
|
||
function Print-Usage() { | ||
Write-Host "Build.ps1" | ||
Write-Host "`t-build Run a build operation (default false)" | ||
Write-Hest "`t-restore Run a restore operation (default false)" | ||
Write-Hest "`t-test Run tests (default false)" | ||
Write-Host "`t-clean Do a clean build / restore (default false)" | ||
Write-Host "`t-clearPackageCache Clear package cache before restoring" | ||
Write-Host "`t-project <path> Project the build or restore should target" | ||
Write-Host "`t-msbuildDir <path> MSBuild which should be used" | ||
} | ||
|
||
function Run-Build() { | ||
$buildArgs = "/v:m /m" | ||
if ($clean) { | ||
$buildArgs = "$buildArgs /t:Rebuild" | ||
} | ||
|
||
$target = if ($project -ne "") { $project } else { Join-Path $repoDir "Roslyn.sln" } | ||
$buildArgs = "$buildArgs $target" | ||
|
||
Invoke-Expression "& `"$msbuild`" $buildArgs" | ||
} | ||
|
||
function Run-Test() { | ||
$proj = Join-Path $repoDir "BuildAndTest.proj" | ||
Invoke-Expression "& `"$msbuild`" /v:m /p:SkipCoreClr=true /t:Test $proj" | ||
} | ||
|
||
try { | ||
. (Join-Path $PSScriptRoot "build-utils.ps1") | ||
|
||
$nuget = Ensure-NuGet | ||
if ($msbuildDir -eq "") { | ||
$msbuildDir = Get-MSBuildDir | ||
} | ||
$msbuild = Join-Path $msbuildDir "msbuild.exe" | ||
|
||
if ($restore) { | ||
if ($clearPackageCache) { | ||
Clear-PackageCache | ||
} | ||
|
||
Restore-Pacakages -clean:$clean -msbuildDir $msbuildDir -project:project | ||
} | ||
|
||
if ($build) { | ||
Run-Build | ||
} | ||
|
||
if ($test) { | ||
Run-Test | ||
} | ||
} | ||
catch { | ||
Write-Host $_ | ||
exit 1 | ||
} |
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