blob: b1d6dfacaf2bfad791004b55f8a1916476252492 (
plain)
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
91
92
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="dir.props" />
<!-- Inline task to bootstrap the build to enable downloading nuget.exe -->
<UsingTask TaskName="DownloadFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
<ParameterGroup>
<Address ParameterType="System.String" Required="true"/>
<FileName ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System" />
<Code Type="Fragment" Language="cs">
<![CDATA[
var directory = System.IO.Path.GetDirectoryName(FileName);
System.IO.Directory.CreateDirectory(directory);
var client = new System.Net.WebClient();
client.Proxy = System.Net.WebRequest.DefaultWebProxy;
client.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
client.DownloadFile(Address, FileName);
]]>
</Code>
</Task>
</UsingTask>
<Target Name="_RestoreBuildTools"
BeforeTargets="Build"
Inputs="$(BuildToolsTargetInputs)"
Outputs="$(BuildToolsTargetOutputs)"
>
<!-- Download latest nuget.exe -->
<DownloadFile
Condition="!Exists($(NuGetToolPath))"
Address="http://nuget.org/nuget.exe"
FileName="$(NuGetToolPath)" />
<!-- Restore build tools -->
<Exec
StandardOutputImportance="Low"
Command=""$(NuGetToolPath)" install " $(SourceDir).nuget\packages.config " -o " $(ToolsDir) " $(NuGetConfigCommandLine)" />
<Touch Files="$(BuildToolsInstallSemaphore)" AlwaysCreate="true" />
</Target>
<!-- Setup Nuget properties -->
<ItemGroup>
<NuSpecSrcs Include="$(PackagesDir)Microsoft.DotNet.CoreCLR.nuspec" />
<NuSpecSrcs Condition="'$(Configuration)'=='Release'" Include="$(PackagesDir)Microsoft.DotNet.CoreCLR.Development.nuspec" />
<NuSpecSrcs Condition="'$(Configuration)'=='Debug'" Include="$(PackagesDir)Microsoft.DotNet.CoreCLR.Debug.Development.nuspec" />
</ItemGroup>
<ItemGroup>
<!-- Backslash appended, see note in dir.props about the PackagesBinDir property -->
<NuSpecs Include="$(PackagesBinDir)\Microsoft.DotNet.CoreCLR.nuspec" />
<NuSpecs Condition="'$(Configuration)'=='Release'" Include="$(PackagesBinDir)\Microsoft.DotNet.CoreCLR.Development.nuspec" />
<NuSpecs Condition="'$(Configuration)'=='Debug'" Include="$(PackagesBinDir)\Microsoft.DotNet.CoreCLR.Debug.Development.nuspec" />
</ItemGroup>
<!-- Generate Microsoft.Dotnet.CoreCLR nuget package and associated development package -->
<Target Name="BuildNuGetPackages" AfterTargets="MovePDB" Condition="'$(BuildNugetPackage)' != 'false'">
<MakeDir Directories="$(PackagesBinDir)" Condition="!Exists('$(PackagesBinDir)')" />
<Copy SourceFiles="@(NuSpecSrcs)" DestinationFolder="$(PackagesBinDir)" />
<Exec Command=""$(NuGetToolPath)" pack "%(NuSpecs.Identity)" -NoPackageAnalysis -NoDefaultExcludes -OutputDirectory "$(PackagesBinDir)"" />
</Target>
<ItemGroup>
<PDBSToMove Include="$(BinDir)mscorlib.pdb"/>
</ItemGroup>
<PropertyGroup>
<MscorlibPDBPath>$(BinDir)mscorlib.pdb</MscorlibPDBPath>
</PropertyGroup>
<Target Name="MovePDB" AfterTargets="Build">
<Move Condition="Exists($(MscorlibPDBPath))"
SourceFiles="@(PDBSToMove)"
DestinationFolder="$(BinDir)PDB"
/>
</Target>
<!-- Build mscorlib -->
<ItemGroup>
<Project Include="src\mscorlib\mscorlib.csproj" />
</ItemGroup>
<Import Project="dir.traversal.targets" />
<!-- Override clean from dir.traversal.targets and just remove the full BinDir -->
<Target Name="Clean">
<Delete Files="$(BinDir)mscorlib.*" />
</Target>
</Project>
|