|
30 | 30 |
|
31 | 31 | var targetFilePath = Path.Combine(Path.GetTempPath(), string.Format(roslynPackageName, ReferenceRoslynNupkgVersion)); |
32 | 32 | var targetExtractPath = Path.Combine(Path.GetTempPath(), LocalRoslynFolderName); |
33 | | - var targetPath = Path.Combine(NupkgToolPath, LocalRoslynFolderName); |
| 33 | + var packageToolsPath = Path.Combine(NupkgToolPath, LocalRoslynFolderName); |
34 | 34 | if (Directory.Exists(targetExtractPath)) |
35 | 35 | { |
36 | 36 | Directory.Delete(targetExtractPath, true); |
37 | 37 | } |
38 | | - if (Directory.Exists(targetPath)) |
| 38 | + if (Directory.Exists(packageToolsPath)) |
39 | 39 | { |
40 | | - Directory.Delete(targetPath, true); |
| 40 | + Directory.Delete(packageToolsPath, true); |
41 | 41 | } |
42 | 42 |
|
43 | 43 | wc.DownloadFile(string.Format(roslynNugetBaseUri, ReferenceRoslynNupkgVersion), targetFilePath); |
| 44 | + Log.LogMessage("Microsoft.Net.Compilers.{0}.nupkg is downloaded", ReferenceRoslynNupkgVersion); |
| 45 | + |
44 | 46 | ZipFile.ExtractToDirectory(targetFilePath, targetExtractPath); |
45 | | - Directory.CreateDirectory(targetPath); |
| 47 | + Directory.CreateDirectory(packageToolsPath); |
46 | 48 | foreach(var file in Directory.GetFiles(Path.Combine(targetExtractPath, "tools"))){ |
47 | 49 | var fi = new FileInfo(file); |
48 | | - File.Copy(file, Path.Combine(targetPath, fi.Name)); |
| 50 | + File.Copy(file, Path.Combine(packageToolsPath, fi.Name)); |
49 | 51 | } |
50 | 52 |
|
51 | 53 | targetFilePath = Path.Combine(Path.GetTempPath(), string.Format(roslynPackageName, ReferenceLatestRoslynNupkgVersion)); |
52 | 54 | targetExtractPath = Path.Combine(Path.GetTempPath(), LocalLatestRoslynFolderName); |
53 | | - targetPath = Path.Combine(NupkgToolPath, LocalLatestRoslynFolderName); |
| 55 | + packageToolsPath = Path.Combine(NupkgToolPath, LocalLatestRoslynFolderName); |
54 | 56 | if (Directory.Exists(targetExtractPath)) |
55 | 57 | { |
56 | 58 | Directory.Delete(targetExtractPath, true); |
57 | 59 | } |
58 | | - if (Directory.Exists(targetPath)) |
| 60 | + if (Directory.Exists(packageToolsPath)) |
59 | 61 | { |
60 | | - Directory.Delete(targetPath, true); |
| 62 | + Directory.Delete(packageToolsPath, true); |
61 | 63 | } |
62 | 64 |
|
63 | 65 | wc.DownloadFile(string.Format(roslynNugetBaseUri, ReferenceLatestRoslynNupkgVersion), targetFilePath); |
| 66 | + Log.LogMessage("Microsoft.Net.Compilers.{0}.nupkg is downloaded", ReferenceLatestRoslynNupkgVersion); |
| 67 | +
|
64 | 68 | ZipFile.ExtractToDirectory(targetFilePath, targetExtractPath); |
65 | | - Directory.CreateDirectory(targetPath); |
| 69 | + Directory.CreateDirectory(packageToolsPath); |
66 | 70 | foreach (var file in Directory.GetFiles(Path.Combine(targetExtractPath, "tools"))) |
67 | 71 | { |
68 | 72 | var fi = new FileInfo(file); |
69 | | - File.Copy(file, Path.Combine(targetPath, fi.Name)); |
| 73 | + File.Copy(file, Path.Combine(packageToolsPath, fi.Name)); |
70 | 74 | } |
71 | 75 | } |
72 | 76 | } |
73 | 77 | catch (Exception ex) |
74 | 78 | { |
75 | 79 | Log.LogErrorFromException(ex); |
| 80 | + return false; |
76 | 81 | } |
77 | 82 | return true; |
78 | 83 | ]]> |
|
0 commit comments