Skip to content

Commit

Permalink
Merge pull request dotnet#10928 from chcosta/compiler
Browse files Browse the repository at this point in the history
Consume Roslyn Compiler 2.0.0-beta3
(cherry picked from commit 8512621)
  • Loading branch information
MattGal authored and dagood committed Aug 24, 2016
1 parent 6f62cf0 commit 541d7ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 59 deletions.
55 changes: 4 additions & 51 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
<InputOSGroup Condition="'$(InputOSGroup)'==''">$(OSEnvironment)</InputOSGroup>
</PropertyGroup>

<!-- Build Tools Versions -->
<PropertyGroup>
<RoslynVersion>1.0.0-rc3-20150510-01</RoslynVersion>
<RoslynPackageName>Microsoft.Net.ToolsetCompilers</RoslynPackageName>
</PropertyGroup>

<!-- Informs build tools to apply .NET Framework metadata if not a test project -->
<PropertyGroup>
<IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
Expand All @@ -55,14 +49,9 @@

<!-- Input Directories -->
<PackagesDir Condition="'$(PackagesDir)'==''">$(ProjectDir)packages/</PackagesDir>
<ToolRuntimePath Condition="'$(ToolRuntimePath)'==''">$(ProjectDir)Tools/</ToolRuntimePath>
<ToolsDir Condition="'$(UseToolRuntimeForToolsDir)'=='true'">$(ToolRuntimePath)</ToolsDir>
<ToolsDir Condition="'$(ToolsDir)'==''">$(ProjectDir)Tools/</ToolsDir>
<DotnetCliPath Condition="'$(DotnetCliPath)'==''">$(ToolRuntimePath)dotnetcli/</DotnetCliPath>
<OverrideToolHost>$(DotnetCliPath)dotnet</OverrideToolHost>
<BuildToolsTaskDir Condition="'$(BuildToolsTargets45)' == 'true'">$(ToolsDir)net45/</BuildToolsTaskDir>
<BuildToolsTaskDir Condition="'$(BuildToolsTaskDir)'==''">$(ToolsDir)</BuildToolsTaskDir>
<UseRoslynCompilers Condition="'$(UseRoslynCompilers)'=='' and '$(OSEnvironment)'!='Windows_NT'">false</UseRoslynCompilers>
<ToolRuntimePath Condition="'$(ToolRuntimePath)'==''">$(ToolsDir)</ToolRuntimePath>
</PropertyGroup>

<Import Project="$(ToolRuntimePath)BuildVersion.targets" Condition="Exists('$(ToolRuntimePath)BuildVersion.targets')" />
Expand All @@ -71,12 +60,6 @@
<GenFacadesArgs>-ignoreBuildAndRevisionMismatch</GenFacadesArgs>
</PropertyGroup>

<!-- Use Roslyn Compilers to build -->
<PropertyGroup Condition="'$(UseRoslynCompilers)'!='false'">
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>
<Import Project="$(ToolRuntimePath)/net45/roslyn/build/Microsoft.Net.Compilers.props" Condition="'$(UseRoslynCompilers)'!='false' AND Exists('$(ToolRuntimePath)/net45/roslyn/build/Microsoft.Net.Compilers.props')" />

<!-- Import Build tools common props file where repo-independent properties are found -->
<Import Project="$(ToolsDir)Build.Common.props" Condition="Exists('$(ToolsDir)Build.Common.props')" />

Expand Down Expand Up @@ -158,37 +141,6 @@
<RestorePackages>false</RestorePackages>
</PropertyGroup>

<!--
On Unix we always use a version of Roslyn we restore from NuGet and we have to work around some known issues.
-->
<PropertyGroup Condition="'$(OsEnvironment)'=='Unix'">
<RoslynPackageDir>$(PackagesDir)/$(RoslynPackageName).$(RoslynVersion)/</RoslynPackageDir>
<RoslynPropsFile>$(RoslynPackageDir)build/Microsoft.Net.ToolsetCompilers.props</RoslynPropsFile>

<!--
Portable PDBs are now supported in Linux and OSX with .Net Core MSBuild.
-->
<DebugType>Portable</DebugType>

<!--
Delay signing with the ECMA key currently doesn't work.
https://github.com/dotnet/roslyn/issues/2444
-->
<UseECMAKey>false</UseECMAKey>

<!--
Full signing with Open key doesn't work with Portable Csc.
https://github.com/dotnet/roslyn/issues/8210
-->
<UseOpenKey>false</UseOpenKey>

<!--
Mono currently doesn't include VB targets for portable, notably /lib/mono/xbuild/Microsoft/Portable/v4.5/Microsoft.Portable.VisualBasic.targets.
Fixed in https://github.com/mono/mono/pull/1726.
-->
<IncludeVbProjects>false</IncludeVbProjects>
</PropertyGroup>

<PropertyGroup>
<!-- By default make all libraries to be AnyCPU but individual projects can override it if they need to -->
<Platform>AnyCPU</Platform>
Expand Down Expand Up @@ -592,6 +544,7 @@
<SkipTests Condition="'$(SkipTests)'=='' and ('$(OsEnvironment)'=='Windows_NT' and '$(TargetsWindows)'!='true' and '$(OSGroup)'!='AnyOS')">true</SkipTests>
</PropertyGroup>

<Import Project="$(RoslynPropsFile)" Condition="'$(OsEnvironment)'=='Unix' and Exists('$(RoslynPropsFile)')" />

<!-- Use Roslyn Compilers to build -->
<Import Project="$(RoslynPropsFile)" Condition="'$(OSEnvironment)'!='Unix' and Exists('$(RoslynPropsFile)') and '$(UseRoslynCompilers)'!='false'" />
<Import Project="$(RoslynPropsFile)" Condition="'$(OSEnvironment)'=='Unix' and Exists('$(RoslynPropsFile)')" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -173,27 +173,27 @@ public async Task TestSchedulerUsage()
{
var scheduler = new ConcurrentExclusiveSchedulerPair().ExclusiveScheduler;

var sync = new ActionBlock<int>(_ => Assert.Equal(scheduler.Id, TaskScheduler.Current.Id),
var actionBlockSync = new ActionBlock<int>(_ => Assert.Equal(scheduler.Id, TaskScheduler.Current.Id),
new ExecutionDataflowBlockOptions
{
TaskScheduler = scheduler,
SingleProducerConstrained = singleProducerConstrained
});
sync.PostRange(0, 10);
sync.Complete();
await sync.Completion;
actionBlockSync.PostRange(0, 10);
actionBlockSync.Complete();
await actionBlockSync.Completion;

var async = new ActionBlock<int>(_ => {
var actionBlockAsync = new ActionBlock<int>(_ => {
Assert.Equal(scheduler.Id, TaskScheduler.Current.Id);
return Task.FromResult(0);
}, new ExecutionDataflowBlockOptions
{
TaskScheduler = scheduler,
SingleProducerConstrained = singleProducerConstrained
});
async.PostRange(0, 10);
async.Complete();
await async.Completion;
actionBlockAsync.PostRange(0, 10);
actionBlockAsync.Complete();
await actionBlockAsync.Completion;
}
}

Expand Down

0 comments on commit 541d7ed

Please sign in to comment.