-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc393d9
commit f174b0b
Showing
3 changed files
with
51 additions
and
24 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 |
---|---|---|
@@ -1,25 +1,6 @@ | ||
# build folders | ||
[Bb]in/ | ||
[Oo]bj/ | ||
|
||
# build results | ||
[Dd]ebug/ | ||
[Rr]elease/ | ||
|
||
# user-specific files | ||
.vs/ | ||
*.suo | ||
*.user | ||
*.sln.docstates | ||
|
||
# ncrunch | ||
*.crunchsolution* | ||
*.ncrunchsolution* | ||
*.ncrunchproject* | ||
|
||
# nuget | ||
packages/ | ||
|
||
# other | ||
*.[Cc]ache | ||
project.lock.json | ||
.vscode/ | ||
bin/ | ||
obj/ | ||
build/tools/ | ||
artifacts/ |
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.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0\build.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,44 @@ | ||
# Get the root project directory. | ||
$root = Resolve-Path (Join-Path $PSScriptRoot '..') | ||
|
||
# Set up the tools directory. | ||
$toolsDir = "$root\build\tools" | ||
if ((Test-Path -path $toolsDir) -eq $false) { | ||
New-Item $toolsDir -Type Directory | Out-Null | ||
} | ||
|
||
# Set up the output directory. | ||
$outputDir = "$root\artifacts" | ||
if ((Test-Path -path $outputDir) -eq $false) { | ||
New-Item $outputDir -Type Directory | Out-Null | ||
} | ||
|
||
# Find or download NuGet. | ||
$nuget = "$toolsDir\nuget.exe" | ||
if ((Test-Path $nuget) -eq $false) { | ||
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile $nuget | ||
} | ||
|
||
# Find or download VSWhere. | ||
$vswhere = "$toolsDir\vswhere\tools\vswhere.exe" | ||
if ((Test-Path $vswhere) -eq $false) { | ||
& $nuget install vswhere -ExcludeVersion -OutputDirectory $toolsDir | ||
} | ||
|
||
# Find VS using VSWhere | ||
$vs = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath | ||
if ((Test-Path $vs) -eq $false) { | ||
throw 'Could not find VS installation' | ||
} | ||
|
||
# Locate MSBuild using resolved VS path. | ||
$msbuild = Resolve-Path "$vs\MSBuild\*\Bin\MSBuild.exe" | ||
if ((Test-Path $msbuild) -eq $false) { | ||
throw 'Could not find MSBuild' | ||
} | ||
|
||
# Set MSBuild alias. | ||
Set-Alias MSBuild $msbuild | ||
|
||
# Build and pack. | ||
MSBuild "/t:Restore;Build;Pack" "/p:Configuration=Release,OutputPath=$outputDir" "$root\src\NGuard\NGuard.csproj" |