forked from jeremymeng/PartsUnlimited
-
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.
Adding scripts to build website and unit test project on VSTS build s…
…ystem.
- Loading branch information
Showing
11 changed files
with
108 additions
and
149 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory=$True)] [string] $BuildConfiguration | ||
) | ||
|
||
#Install dnvm | ||
& scripts/Install-Dnvm.ps1 | ||
|
||
# Restore and build projects | ||
& scripts/Call-Dnu.ps1 restore .\src | ||
& scripts/Call-Dnu.ps1 build .\src\PartsUnlimitedWebsite --configuration $BuildConfiguration |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
#Add dnu to path | ||
Write-Verbose "Add dnu to path for this session." | ||
Invoke-Expression "$env:USERPROFILE\.dnx\bin\dnvm.ps1 use default" | ||
|
||
# Temporarily, add web tools to path, if not already included. | ||
$pathToWebTools = "$env:VS140COMNTOOLS..\IDE\Extensions\Microsoft\Web Tools\External\" | ||
if (!$env:Path.Contains($pathToWebTools)){ | ||
Write-Verbose "Adding '$pathToWebTools' to path for this session." | ||
$env:Path += ";$pathToWebTools" | ||
} | ||
Write-Debug "Current Path: $env:Path" | ||
|
||
#Setting npm loglevel to 'error' to avoid build failures due to package warnings. | ||
Write-Verbose "Setting npm log level to 'error'" | ||
$env:npm_config_loglevel="error" | ||
|
||
#Call dnu | ||
Write-Verbose "Executing: dnu $args" | ||
& dnu $args |
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,15 @@ | ||
#Add dnu to path | ||
Write-Verbose "Add dnx to path for this session." | ||
Invoke-Expression "$env:USERPROFILE\.dnx\bin\dnvm.ps1 use default" | ||
|
||
# Temporarily, add web tools to path, if not already included. | ||
$pathToWebTools = "$env:VS140COMNTOOLS..\IDE\Extensions\Microsoft\Web Tools\External\" | ||
if (!$env:Path.Contains($pathToWebTools)){ | ||
Write-Verbose "Adding '$pathToWebTools' to path for this session." | ||
$env:Path += ";$pathToWebTools" | ||
} | ||
Write-Debug "Current Path: $env:Path" | ||
|
||
#Call dnu | ||
Write-Verbose "Executing: dnx $args" | ||
& dnx $args |
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,19 @@ | ||
# bootstrap DNVM into this session. | ||
Write-Debug "Install DNVM into this session." | ||
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))} | ||
# load up the global.json so we can find the DNX version | ||
$globalJson = Get-Content -Path $PSScriptRoot\global.json -Raw -ErrorAction Ignore | ConvertFrom-Json -ErrorAction Ignore | ||
if($globalJson.sdk.version) | ||
{ | ||
Write-Debug = "Using $globalJson.sdk.version" | ||
$dnxVersion = $globalJson.sdk.version | ||
} | ||
else | ||
{ | ||
Write-Warning "Unable to locate global.json to determine target version. Using 'latest'." | ||
$dnxVersion = "latest" | ||
} | ||
|
||
# Install DNVM. Alias as 'default' for so projects are built with this version later. | ||
& $env:USERPROFILE\.dnx\bin\dnvm.ps1 install $dnxVersion -Persistent -Alias default | ||
|
48 changes: 20 additions & 28 deletions
48
test/PartsUnlimited.UnitTests/PartsUnlimited.UnitTests.xproj
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,29 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" /> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>0c64e1a0-7791-457b-bd8a-60cba4979702</ProjectGuid> | ||
<RootNamespace>PartsUnlimited</RootNamespace> | ||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> | ||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<AssemblyName>PartsUnlimited.UnitTests</AssemblyName> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> | ||
</ItemGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
<ProjectExtensions> | ||
<VisualStudio> | ||
<UserProperties project_1json__JSONSchema="http://www.asp.net/media/4878834/project.json" /> | ||
</VisualStudio> | ||
</ProjectExtensions> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" /> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>0c64e1a0-7791-457b-bd8a-60cba4979702</ProjectGuid> | ||
<RootNamespace>PartsUnlimited.UnitTests</RootNamespace> | ||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> | ||
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> | ||
</ItemGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
</Project> |
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,16 +1,22 @@ | ||
{ | ||
"version": "1.0.0-*", | ||
"dependencies": { | ||
"xunit": "2.1.0-*", | ||
"xunit.runner.dnx": "2.1.0-*", | ||
"NSubstitute": "1.8.1", | ||
"PartsUnlimitedWebsite": "" | ||
}, | ||
"commands": { | ||
"test": "xunit.runner.dnx" | ||
}, | ||
"frameworks": { | ||
"dnx451": { } | ||
} | ||
} | ||
|
||
{ | ||
"authors": [ | ||
"Microsoft" | ||
], | ||
"license": "MIT", | ||
"description": "Parts Unlimited unit tests", | ||
"version": "1.0.0-*", | ||
"dependencies": { | ||
"xunit": "2.1.0", | ||
"xunit.runner.dnx": "2.1.0-rc1-build204", | ||
"xunit.runner.visualstudio": "2.1.0-rc1-build1124", | ||
"NSubstitute": "1.8.1", | ||
"PartsUnlimitedWebsite": "" | ||
}, | ||
"commands": { | ||
"test": "xunit.runner.dnx" | ||
}, | ||
"frameworks": { | ||
"dnx451": { } | ||
} | ||
} | ||
|