Skip to content

Commit 267a487

Browse files
committed
Add DeadRegions tool projects to solution
Also updates the rest of the projects to use the common build.props file in the repository root. Strange thing to note is: I started getting a 'CS1985: Cannot await in the body of a catch block' error in AnalysisEngine.RegionRemoval.cs but not consistently. So I've fixed that line.
1 parent cf4f7cf commit 267a487

File tree

8 files changed

+33
-98
lines changed

8 files changed

+33
-98
lines changed

build.props

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<OutputPath Condition="'$(OutputPath)' == ''">$(MsBuildThisFileDirectory)bin\$(Configuration)\</OutputPath>
8-
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(MsBuildThisFileDirectory)bin\obj\$(Configuration)\</IntermediateOutputPath>
7+
<OutDir Condition="'$(OutDir)' == ''">$(MsBuildThisFileDirectory)bin\</OutDir>
8+
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(MsBuildThisFileDirectory)obj\$(MsBuildProjectName)\$(Configuration)\</IntermediateOutputPath>
9+
<OutputPath Condition="'$(OutputPath)' == ''">$(IntermediateOutputPath)</OutputPath>
910
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1011
<FileAlignment>512</FileAlignment>
12+
<RestorePackages>true</RestorePackages>
1113
</PropertyGroup>
1214

1315
<!-- Configuration specific properties -->

src/CodeFormatter.sln

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnitConverter", "XUnitConv
1818
EndProject
1919
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XUnitConverter.Tests", "XUnitConverter.Tests\XUnitConverter.Tests.csproj", "{BA4C1700-8A72-4F33-AF67-0E60F324E521}"
2020
EndProject
21+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.DeadRegionAnalysis", "Microsoft.DotNet.DeadRegionAnalysis\Microsoft.DotNet.DeadRegionAnalysis.csproj", "{27F04393-37FD-4D02-B574-0084BB7F6A59}"
22+
EndProject
23+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.DeadRegionAnalysis.Tests", "Microsoft.DotNet.DeadRegionAnalysis.Tests\Microsoft.DotNet.DeadRegionAnalysis.Tests.csproj", "{7C57FD95-030E-48B2-B369-6694BB922C8C}"
24+
EndProject
25+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeadRegions", "DeadRegions\DeadRegions.csproj", "{B65D5F61-64BF-4219-863C-74C2744AE8FC}"
26+
EndProject
2127
Global
2228
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2329
Debug|Any CPU = Debug|Any CPU
@@ -44,6 +50,18 @@ Global
4450
{BA4C1700-8A72-4F33-AF67-0E60F324E521}.Debug|Any CPU.Build.0 = Debug|Any CPU
4551
{BA4C1700-8A72-4F33-AF67-0E60F324E521}.Release|Any CPU.ActiveCfg = Release|Any CPU
4652
{BA4C1700-8A72-4F33-AF67-0E60F324E521}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{27F04393-37FD-4D02-B574-0084BB7F6A59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54+
{27F04393-37FD-4D02-B574-0084BB7F6A59}.Debug|Any CPU.Build.0 = Debug|Any CPU
55+
{27F04393-37FD-4D02-B574-0084BB7F6A59}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{27F04393-37FD-4D02-B574-0084BB7F6A59}.Release|Any CPU.Build.0 = Release|Any CPU
57+
{7C57FD95-030E-48B2-B369-6694BB922C8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58+
{7C57FD95-030E-48B2-B369-6694BB922C8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
59+
{7C57FD95-030E-48B2-B369-6694BB922C8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
60+
{7C57FD95-030E-48B2-B369-6694BB922C8C}.Release|Any CPU.Build.0 = Release|Any CPU
61+
{B65D5F61-64BF-4219-863C-74C2744AE8FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62+
{B65D5F61-64BF-4219-863C-74C2744AE8FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
63+
{B65D5F61-64BF-4219-863C-74C2744AE8FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
64+
{B65D5F61-64BF-4219-863C-74C2744AE8FC}.Release|Any CPU.Build.0 = Release|Any CPU
4765
EndGlobalSection
4866
GlobalSection(SolutionProperties) = preSolution
4967
HideSolutionNode = FALSE

src/CodeFormatter/CodeFormatter.csproj

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
44
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
75
<ProjectGuid>{B0E1A988-F762-459D-AD0D-56A3CF4FFF3F}</ProjectGuid>
86
<OutputType>Exe</OutputType>
97
<AppDesignerFolder>Properties</AppDesignerFolder>
108
<RootNamespace>CodeFormatter</RootNamespace>
119
<AssemblyName>CodeFormatter</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
1410
</PropertyGroup>
11+
<!-- Default configurations to help VS understand -->
1512
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<PlatformTarget>AnyCPU</PlatformTarget>
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
2413
</PropertyGroup>
2514
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26-
<PlatformTarget>AnyCPU</PlatformTarget>
27-
<DebugType>pdbonly</DebugType>
28-
<Optimize>true</Optimize>
29-
<OutputPath>bin\Release\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
3315
</PropertyGroup>
3416
<ItemGroup>
3517
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/Microsoft.DotNet.CodeFormatting.Tests/Microsoft.DotNet.CodeFormatting.Tests.csproj

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.0.99.9-build1021\build\net20\xunit.runner.visualstudio.props')" />
4-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
55
<PropertyGroup>
6-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
86
<ProjectGuid>{D4D6FF88-0586-43C7-BDE4-D336EB25E7AA}</ProjectGuid>
97
<OutputType>Library</OutputType>
108
<AppDesignerFolder>Properties</AppDesignerFolder>
119
<RootNamespace>Microsoft.DotNet.CodeFormatting.Tests</RootNamespace>
1210
<AssemblyName>Microsoft.DotNet.CodeFormatting.Tests</AssemblyName>
13-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
1511
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
16-
<RestorePackages>true</RestorePackages>
1712
</PropertyGroup>
13+
<!-- Default configurations to help VS understand -->
1814
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19-
<DebugSymbols>true</DebugSymbols>
20-
<DebugType>full</DebugType>
21-
<Optimize>false</Optimize>
22-
<OutputPath>bin\Debug\</OutputPath>
23-
<DefineConstants>DEBUG;TRACE</DefineConstants>
24-
<ErrorReport>prompt</ErrorReport>
25-
<WarningLevel>4</WarningLevel>
2615
</PropertyGroup>
2716
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
3417
</PropertyGroup>
3518
<ItemGroup>
3619
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/Microsoft.DotNet.CodeFormatting/Microsoft.DotNet.CodeFormatting.csproj

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
44
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
75
<ProjectGuid>{D535641F-A2D7-481C-930D-96C02F052B95}</ProjectGuid>
86
<OutputType>Library</OutputType>
97
<AppDesignerFolder>Properties</AppDesignerFolder>
108
<RootNamespace>Microsoft.DotNet.CodeFormatting</RootNamespace>
119
<AssemblyName>Microsoft.DotNet.CodeFormatting</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
1410
</PropertyGroup>
11+
<!-- Default configurations to help VS understand -->
1512
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<DebugSymbols>true</DebugSymbols>
17-
<DebugType>full</DebugType>
18-
<Optimize>false</Optimize>
19-
<OutputPath>bin\Debug\</OutputPath>
20-
<DefineConstants>DEBUG;TRACE</DefineConstants>
21-
<ErrorReport>prompt</ErrorReport>
22-
<WarningLevel>4</WarningLevel>
2313
</PropertyGroup>
2414
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25-
<DebugType>pdbonly</DebugType>
26-
<Optimize>true</Optimize>
27-
<OutputPath>bin\Release\</OutputPath>
28-
<DefineConstants>TRACE</DefineConstants>
29-
<ErrorReport>prompt</ErrorReport>
30-
<WarningLevel>4</WarningLevel>
3115
</PropertyGroup>
3216
<ItemGroup>
3317
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

src/Microsoft.DotNet.DeadRegionAnalysis/AnalysisEngine.RegionRemoval.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public partial class AnalysisEngine
3939
catch (Exception)
4040
{
4141
var changesString = new StringBuilder();
42-
var syntaxTree = await info.Document.GetSyntaxTreeAsync(cancellationToken);
42+
var syntaxTree = info.Document.GetSyntaxTreeAsync(cancellationToken).Result;
4343

4444
foreach (var change in changes)
4545
{

src/XUnitConverter.Tests/XUnitConverter.Tests.csproj

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="..\packages\xunit.runner.visualstudio.2.0.0-rc1-build1030\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.0.0-rc1-build1030\build\net20\xunit.runner.visualstudio.props')" />
4-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
55
<PropertyGroup>
6-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
86
<ProjectGuid>{BA4C1700-8A72-4F33-AF67-0E60F324E521}</ProjectGuid>
97
<OutputType>Library</OutputType>
108
<AppDesignerFolder>Properties</AppDesignerFolder>
119
<RootNamespace>XUnitConverter.Tests</RootNamespace>
1210
<AssemblyName>XUnitConverter.Tests</AssemblyName>
13-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
1511
<NuGetPackageImportStamp>2f07db9d</NuGetPackageImportStamp>
1612
</PropertyGroup>
13+
<!-- Default configurations to help VS understand -->
1714
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
2515
</PropertyGroup>
2616
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<DebugType>pdbonly</DebugType>
28-
<Optimize>true</Optimize>
29-
<OutputPath>bin\Release\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
3317
</PropertyGroup>
3418
<ItemGroup>
3519
<Reference Include="Microsoft.CodeAnalysis">

src/XUnitConverter/XUnitConverter.csproj

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.props))\build.props" />
44
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
75
<ProjectGuid>{81B0FF57-C128-4F6B-83C7-94DBAF261582}</ProjectGuid>
86
<OutputType>Exe</OutputType>
97
<AppDesignerFolder>Properties</AppDesignerFolder>
108
<RootNamespace>XUnitConverter</RootNamespace>
119
<AssemblyName>XUnitConverter</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
1410
</PropertyGroup>
11+
<!-- Default configurations to help VS understand -->
1512
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<PlatformTarget>AnyCPU</PlatformTarget>
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
2413
</PropertyGroup>
2514
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26-
<PlatformTarget>AnyCPU</PlatformTarget>
27-
<DebugType>pdbonly</DebugType>
28-
<Optimize>true</Optimize>
29-
<OutputPath>bin\Release\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
3315
</PropertyGroup>
3416
<ItemGroup>
3517
<Reference Include="Microsoft.CodeAnalysis">

0 commit comments

Comments
 (0)