|
1 | 1 | <Project DefaultTargets="UnitTest" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
2 | 2 | <PropertyGroup> |
3 | 3 | <NupkgToolPath>$(RepositoryRoot)src\Packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\tools\</NupkgToolPath> |
4 | | - <LocalRoslyn45FolderName>Roslyn45</LocalRoslyn45FolderName> |
5 | 4 | <LocalRoslyn46FolderName>Roslyn46</LocalRoslyn46FolderName> |
6 | 5 | <LocalRoslyn472FolderName>Roslyn472</LocalRoslyn472FolderName> |
7 | 6 | </PropertyGroup> |
8 | 7 |
|
9 | 8 | <UsingTask TaskName="DownloadRoslynBinaries" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> |
10 | 9 | <ParameterGroup> |
11 | 10 | <NupkgToolPath ParameterType="System.String" Required="true" /> |
12 | | - <LocalRoslyn45FolderName ParameterType="System.String" Required="true" /> |
13 | 11 | <LocalRoslyn46FolderName ParameterType="System.String" Required="true" /> |
14 | 12 | <LocalRoslyn472FolderName ParameterType="System.String" Required="true" /> |
15 | | - <ReferenceRoslyn45NupkgVersion ParameterType="System.String" Required="true" /> |
16 | 13 | <ReferenceRoslyn46NupkgVersion ParameterType="System.String" Required="true" /> |
17 | 14 | <ReferenceRoslyn472NupkgVersion ParameterType="System.String" Required="true" /> |
18 | 15 | </ParameterGroup> |
|
31 | 28 | var roslynNugetBaseUri = "https://api.nuget.org/packages/microsoft.net.compilers.{0}.nupkg"; |
32 | 29 | var roslynPackageName = "microsoft.net.compilers.{0}.nupkg"; |
33 | 30 |
|
34 | | - var targetFilePath = Path.Combine(Path.GetTempPath(), string.Format(roslynPackageName, ReferenceRoslyn45NupkgVersion)); |
35 | | - var targetExtractPath = Path.Combine(Path.GetTempPath(), LocalRoslyn45FolderName); |
36 | | - var packageToolsPath = Path.Combine(NupkgToolPath, LocalRoslyn45FolderName); |
37 | | - if (Directory.Exists(targetExtractPath)) |
38 | | - { |
39 | | - Directory.Delete(targetExtractPath, true); |
40 | | - } |
41 | | - if (Directory.Exists(packageToolsPath)) |
42 | | - { |
43 | | - Directory.Delete(packageToolsPath, true); |
44 | | - } |
45 | | -
|
46 | | - wc.DownloadFile(string.Format(roslynNugetBaseUri, ReferenceRoslyn45NupkgVersion), targetFilePath); |
47 | | - Log.LogMessage("Microsoft.Net.Compilers.{0}.nupkg is downloaded", ReferenceRoslyn45NupkgVersion); |
48 | | - |
49 | | - ZipFile.ExtractToDirectory(targetFilePath, targetExtractPath); |
50 | | - Directory.CreateDirectory(packageToolsPath); |
51 | | - foreach(var file in Directory.GetFiles(Path.Combine(targetExtractPath, "tools"))){ |
52 | | - var fi = new FileInfo(file); |
53 | | - File.Copy(file, Path.Combine(packageToolsPath, fi.Name)); |
54 | | - } |
55 | | -
|
56 | | - targetFilePath = Path.Combine(Path.GetTempPath(), string.Format(roslynPackageName, ReferenceRoslyn46NupkgVersion)); |
57 | | - targetExtractPath = Path.Combine(Path.GetTempPath(), LocalRoslyn46FolderName); |
58 | | - packageToolsPath = Path.Combine(NupkgToolPath, LocalRoslyn46FolderName); |
| 31 | + var targetFilePath = Path.Combine(Path.GetTempPath(), string.Format(roslynPackageName, ReferenceRoslyn46NupkgVersion)); |
| 32 | + var targetExtractPath = Path.Combine(Path.GetTempPath(), LocalRoslyn46FolderName); |
| 33 | + var packageToolsPath = Path.Combine(NupkgToolPath, LocalRoslyn46FolderName); |
59 | 34 | if (Directory.Exists(targetExtractPath)) |
60 | 35 | { |
61 | 36 | Directory.Delete(targetExtractPath, true); |
|
0 commit comments