Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove roslyn nupkg ref * Set default value for RoslynToolPath only when it's not set
- Loading branch information
Showing
12 changed files
with
135 additions
and
47 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -12,4 +12,5 @@ PublishProfiles/ | |
.vs | ||
.build/ | ||
.testPublish/ | ||
msbuild.* | ||
msbuild.* | ||
src/**/tools/Roslyn*/ |
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
4 changes: 3 additions & 1 deletion
4
...ers.DotNetCompilerPlatform/build/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props
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
5 changes: 5 additions & 0 deletions
5
...rPlatform/build/net45/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Extensions.props
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,5 @@ | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<RoslynToolPath Condition=" '$(RoslynToolPath)' == '' ">$(MSBuildThisFileDirectory)..\..\tools\roslyn45</RoslynToolPath> | ||
</PropertyGroup> | ||
</Project> |
5 changes: 5 additions & 0 deletions
5
...rPlatform/build/net46/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Extensions.props
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,5 @@ | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<RoslynToolPath Condition=" '$(RoslynToolPath)' == '' ">$(MSBuildThisFileDirectory)..\..\tools\roslynlatest</RoslynToolPath> | ||
</PropertyGroup> | ||
</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
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,18 +1,82 @@ | ||
<Project DefaultTargets="UnitTest" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<!-- Update NuGet Package version for nightly build--> | ||
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.nuproj'"> | ||
<NuGetPackageVersion Condition="'$(UpdateNightlyPackages)' == 'true'">$(NuGetPackageVersion)-b$(VersionBuild)</NuGetPackageVersion> | ||
<PropertyGroup> | ||
<NupkgToolPath>$(RepositoryRoot)src\Packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\tools\</NupkgToolPath> | ||
<LocalRoslynFolderName>Roslyn45</LocalRoslynFolderName> | ||
<LocalLatestRoslynFolderName>RoslynLatest</LocalLatestRoslynFolderName> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<NuGetInstallScripts Include="$(RepositoryRootEx)src\Packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\tools\*.ps1"/> | ||
</ItemGroup> | ||
|
||
<Target Name="CopyInstallScripts"> | ||
<Copy SourceFiles="@(NuGetInstallScripts)" | ||
DestinationFolder="$(AssemblyPath)" | ||
/> | ||
</Target> | ||
|
||
<UsingTask TaskName="DownloadRoslynBinaries" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> | ||
<ParameterGroup> | ||
<NupkgToolPath ParameterType="System.String" Required="true" /> | ||
<LocalRoslynFolderName ParameterType="System.String" Required="true" /> | ||
<LocalLatestRoslynFolderName ParameterType="System.String" Required="true" /> | ||
<ReferenceRoslynNupkgVersion ParameterType="System.String" Required="true" /> | ||
<ReferenceLatestRoslynNupkgVersion ParameterType="System.String" Required="true" /> | ||
</ParameterGroup> | ||
<Task> | ||
<Reference Include="System" /> | ||
<Reference Include="System.IO.Compression.FileSystem" /> | ||
<Using Namespace="System.IO" /> | ||
<Using Namespace="System.IO.Compression" /> | ||
<Using Namespace="System.Net" /> | ||
<Code Type="Fragment" Language="cs"> | ||
<![CDATA[ | ||
try | ||
{ | ||
using (var wc = new WebClient()) | ||
{ | ||
var roslynNugetBaseUri = "https://api.nuget.org/packages/microsoft.net.compilers.{0}.nupkg"; | ||
var roslynPackageName = "microsoft.net.compilers.{0}.nupkg"; | ||
var targetFilePath = Path.Combine(Path.GetTempPath(), string.Format(roslynPackageName, ReferenceRoslynNupkgVersion)); | ||
var targetExtractPath = Path.Combine(Path.GetTempPath(), LocalRoslynFolderName); | ||
var targetPath = Path.Combine(NupkgToolPath, LocalRoslynFolderName); | ||
if (Directory.Exists(targetExtractPath)) | ||
{ | ||
Directory.Delete(targetExtractPath, true); | ||
} | ||
if (Directory.Exists(targetPath)) | ||
{ | ||
Directory.Delete(targetPath, true); | ||
} | ||
wc.DownloadFile(string.Format(roslynNugetBaseUri, ReferenceRoslynNupkgVersion), targetFilePath); | ||
ZipFile.ExtractToDirectory(targetFilePath, targetExtractPath); | ||
Directory.CreateDirectory(targetPath); | ||
foreach(var file in Directory.GetFiles(Path.Combine(targetExtractPath, "tools"))){ | ||
var fi = new FileInfo(file); | ||
File.Copy(file, Path.Combine(targetPath, fi.Name)); | ||
} | ||
targetFilePath = Path.Combine(Path.GetTempPath(), string.Format(roslynPackageName, ReferenceLatestRoslynNupkgVersion)); | ||
targetExtractPath = Path.Combine(Path.GetTempPath(), LocalLatestRoslynFolderName); | ||
targetPath = Path.Combine(NupkgToolPath, LocalLatestRoslynFolderName); | ||
if (Directory.Exists(targetExtractPath)) | ||
{ | ||
Directory.Delete(targetExtractPath, true); | ||
} | ||
if (Directory.Exists(targetPath)) | ||
{ | ||
Directory.Delete(targetPath, true); | ||
} | ||
wc.DownloadFile(string.Format(roslynNugetBaseUri, ReferenceLatestRoslynNupkgVersion), targetFilePath); | ||
ZipFile.ExtractToDirectory(targetFilePath, targetExtractPath); | ||
Directory.CreateDirectory(targetPath); | ||
foreach (var file in Directory.GetFiles(Path.Combine(targetExtractPath, "tools"))) | ||
{ | ||
var fi = new FileInfo(file); | ||
File.Copy(file, Path.Combine(targetPath, fi.Name)); | ||
} | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
Log.LogErrorFromException(ex); | ||
} | ||
return true; | ||
]]> | ||
</Code> | ||
</Task> | ||
</UsingTask> | ||
</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