-
Notifications
You must be signed in to change notification settings - Fork 33
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
Showing
14 changed files
with
561 additions
and
0 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,5 @@ | ||
root=true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 |
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,3 @@ | ||
# Auto detect text files and perform LF normalization | ||
|
||
* text=auto |
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,109 @@ | ||
$root = $(Get-Item $($MyInvocation.MyCommand.Path)).DirectoryName | ||
|
||
function Install-Dnvm | ||
{ | ||
& where.exe dnvm 2>&1 | Out-Null | ||
if(($LASTEXITCODE -ne 0) -Or ((Test-Path Env:\APPVEYOR) -eq $true)) | ||
{ | ||
Write-Host "DNVM not found" | ||
&{$Branch='dev';iex ((New-Object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))} | ||
|
||
# Normally this happens automatically during install but AppVeyor has | ||
# an issue where you may need to manually re-run setup from within this process. | ||
if($env:DNX_HOME -eq $NULL) | ||
{ | ||
Write-Host "Initial DNVM environment setup failed; running manual setup" | ||
$tempDnvmPath = Join-Path $env:TEMP "dnvminstall" | ||
$dnvmSetupCmdPath = Join-Path $tempDnvmPath "dnvm.ps1" | ||
& $dnvmSetupCmdPath setup | ||
} | ||
} | ||
} | ||
|
||
function Get-DnxVersion | ||
{ | ||
$globalJson = Join-Path $PSScriptRoot "global.json" | ||
$jsonData = Get-Content -Path $globalJson -Raw | ConvertFrom-JSON | ||
return $jsonData.sdk.version | ||
} | ||
|
||
function Restore-Packages | ||
{ | ||
param([string] $DirectoryName) | ||
& dnu restore ("""" + $DirectoryName + """") | ||
} | ||
|
||
function Build-Projects | ||
{ | ||
param($Directory, $pack) | ||
|
||
$DirectoryName = $Directory.DirectoryName | ||
$artifactsFolder = join-path $root "artifacts" | ||
$projectsFolder = join-path $artifactsFolder $Directory.Name | ||
$buildFolder = join-path $projectsFolder "testbin" | ||
$packageFolder = join-path $projectsFolder "packages" | ||
|
||
& dnu build ("""" + $DirectoryName + """") --configuration Release --out $buildFolder; if($LASTEXITCODE -ne 0) { exit 1 } | ||
|
||
if($pack){ | ||
& dnu pack ("""" + $DirectoryName + """") --configuration Release --out $packageFolder; if($LASTEXITCODE -ne 0) { exit 1 } | ||
} | ||
} | ||
|
||
function Test-Projects | ||
{ | ||
param([string] $DirectoryName) | ||
& dnx -p ("""" + $DirectoryName + """") test; if($LASTEXITCODE -ne 0) { exit 2 } | ||
} | ||
|
||
function Remove-PathVariable | ||
{ | ||
param([string] $VariableToRemove) | ||
$path = [Environment]::GetEnvironmentVariable("PATH", "User") | ||
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove } | ||
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User") | ||
$path = [Environment]::GetEnvironmentVariable("PATH", "Process") | ||
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove } | ||
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process") | ||
} | ||
|
||
Push-Location $PSScriptRoot | ||
|
||
$dnxVersion = Get-DnxVersion | ||
|
||
# Clean | ||
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse } | ||
|
||
# Remove the installed DNVM from the path and force use of | ||
# per-user DNVM (which we can upgrade as needed without admin permissions) | ||
Remove-PathVariable "*Program Files\Microsoft DNX\DNVM*" | ||
|
||
# Make sure per-user DNVM is installed | ||
Install-Dnvm | ||
|
||
# Install DNX | ||
dnvm install $dnxVersion -r CoreCLR -NoNative | ||
dnvm install $dnxVersion -r CLR -NoNative | ||
dnvm use $dnxVersion -r CLR | ||
|
||
# Package restore | ||
Get-ChildItem -Path . -Filter *.xproj -Recurse | ForEach-Object { Restore-Packages $_.DirectoryName } | ||
|
||
# Set build number | ||
$env:DNX_BUILD_VERSION = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; | ||
Write-Host "Build number: " $env:DNX_BUILD_VERSION | ||
|
||
# Build/package | ||
Get-ChildItem -Path .\src -Filter *.xproj -Recurse | ForEach-Object { Build-Projects $_ $true } | ||
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Build-Projects $_ $false } | ||
|
||
# Test | ||
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName } | ||
|
||
# Switch to Core CLR | ||
dnvm use $dnxVersion -r CoreCLR | ||
|
||
# Test again | ||
Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName } | ||
|
||
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,3 @@ | ||
2.0.0 | ||
- Moved to new project | ||
- DotNet Core support |
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,36 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.24720.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440B-4129-9F7A-09B42D00397E}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}" | ||
ProjectSection(SolutionItems) = preProject | ||
Build.ps1 = Build.ps1 | ||
global.json = global.json | ||
NuGet.Config = NuGet.Config | ||
README.md = README.md | ||
assets\Serilog.snk = assets\Serilog.snk | ||
EndProjectSection | ||
EndProject | ||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Sinks.Console", "src\Serilog.Sinks.Console\Serilog.Sinks.Console.xproj", "{866A028E-27DB-49A0-AC78-E5FEF247C099}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{866A028E-27DB-49A0-AC78-E5FEF247C099}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{866A028E-27DB-49A0-AC78-E5FEF247C099}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{866A028E-27DB-49A0-AC78-E5FEF247C099}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{866A028E-27DB-49A0-AC78-E5FEF247C099}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{866A028E-27DB-49A0-AC78-E5FEF247C099} = {037440DE-440B-4129-9F7A-09B42D00397E} | ||
EndGlobalSection | ||
EndGlobal |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,6 @@ | ||
{ | ||
"projects": [ "src", "test" ], | ||
"sdk": { | ||
"version": "1.0.0-rc1-final" | ||
} | ||
} |
Oops, something went wrong.