forked from erikbra/aspnet.xunit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnx.xunit.proj
90 lines (76 loc) · 3.48 KB
/
dnx.xunit.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<Project DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<UsingTask
AssemblyFile="packages\xunit.buildtasks\tools\CodePlex.MSBuildTasks.dll"
TaskName="CodePlex.MSBuildTasks.RegexReplace"/>
<UsingTask
AssemblyFile="packages\xunit.buildtasks\tools\CodePlex.MSBuildTasks.dll"
TaskName="CodePlex.MSBuildTasks.Zip"/>
<!-- Settings -->
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<TrackFileAccess>false</TrackFileAccess>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)</SolutionDir>
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(SolutionDir)\.nuget\nuget.exe</NuGetExePath>
</PropertyGroup>
<ItemGroup>
<ProjectFiles Include="src\**\project.json" />
</ItemGroup>
<!-- Build server targets -->
<Target Name="CI" DependsOnTargets="PackageRestore;SetVersionNumber;Test;ZipArtifacts" />
<Target Name="PackageRestore" DependsOnTargets="_DownloadNuGet">
<Message Text="Restoring NuGet packages..." Importance="High" />
<Exec Command=""$(NuGetExePath)" install xunit.buildtasks -Source http://www.myget.org/F/b4ff5f68eccf4f6bbfed74f055f88d8f/ -SolutionDir "$(SolutionDir)" -Verbosity quiet -ExcludeVersion" Condition="!Exists('$(SolutionDir)\packages\xunit.buildtasks\')" />
</Target>
<Target Name="Build" DependsOnTargets="PackageRestore">
<Exec Command="powershell -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned tools\dnx-build.ps1" />
</Target>
<Target Name="Test" DependsOnTargets="Build">
<Exec Command="powershell -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned tools\dnx-tests.ps1" />
</Target>
<Target Name="SetVersionNumber">
<RegexReplace
Pattern='99\.99\.99-dev'
Replacement='$(BuildSemanticVersion)'
Files='@(ProjectFiles)'
Condition=" '$(BuildSemanticVersion)' != '' "/>
</Target>
<Target Name='ZipArtifacts'>
<ItemGroup>
<Binaries Include="src\**\*.nupkg" />
</ItemGroup>
<Delete Files="binaries.zip" />
<Zip Files="@(Binaries)" ZipFileName="binaries.zip" StripPath="true" />
</Target>
<Target Name="_DownloadNuGet">
<MakeDir Directories="$(SolutionDir)\.nuget" />
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition="!Exists('$(NuGetExePath)')" />
</Target>
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>