未验证 提交 e051790e 编写于 作者: T Tomáš Matoušek 提交者: GitHub

Project cleanup (#35403)

* Remove RoslynProjectType

* Remove ToolsVersion, namespace from Project tags

* Remove updating of MSBuildAllProjects

* Update BuildBoss

* Delete DeployTooolsetCompiler
上级 ec679313
......@@ -276,7 +276,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.Lang
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.IntegrationTest.Utilities", "src\VisualStudio\IntegrationTest\TestUtilities\Microsoft.VisualStudio.IntegrationTest.Utilities.csproj", "{3BED15FD-D608-4573-B432-1569C1026F6D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roslyn.Test.Performance.Tests", "src\Test\Perf\tests\Roslyn.Test.Performance.Tests.csproj", "{DA0D2A70-A2F9-4654-A99A-3227EDF54FF1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roslyn.PerformanceTests", "src\Test\Perf\tests\Roslyn.PerformanceTests.csproj", "{DA0D2A70-A2F9-4654-A99A-3227EDF54FF1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.LanguageServices.Xaml", "src\VisualStudio\Xaml\Impl\Microsoft.VisualStudio.LanguageServices.Xaml.csproj", "{971E832B-7471-48B5-833E-5913188EC0E4}"
EndProject
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!--
Roslyn version
-->
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<Project>
<Import Project="VisualStudio.targets"/>
<Import Project="XUnit.targets" Condition="'$(IsTestProject)' == 'true'" />
<PropertyGroup>
<FileAlignment>512</FileAlignment>
<!-- Only generate our runtimeconfig.json files for net core apps. It's unnecessary in desktop projects
but gets included in lots of output items like VSIX. -->
<!--
Only generate our runtimeconfig.json files for net core apps. It's unnecessary in desktop projects
but gets included in lots of output items like VSIX.
-->
<GenerateRuntimeConfigurationFiles Condition="'$(TargetFramework)' != 'netcoreapp1.1' AND '$(TargetFramework)' != 'netcoreapp2.1' AND '$(TargetFramework)' != 'netcoreapp3.0'">false</GenerateRuntimeConfigurationFiles>
<!--
......@@ -291,4 +288,15 @@
<FileWrites Include="$(_UpdatedApplicationManifestPath)"/>
</ItemGroup>
</Target>
<!--
Checks assumptions made by TestUsingOptimizedRunner function in build.ps1.
-->
<Target Name="_CheckTestProjectTargetFileName" BeforeTargets="Build" Condition="'$(TargetFramework)' != ''">
<Error Text="Unit test project TargetFileName must end with '.UnitTests.dll': '$(TargetFileName)'"
Condition="$(IsUnitTestProject) != $(TargetFileName.EndsWith('.UnitTests.dll'))" />
<Error Text="Unit test project TargetFileName must end with '.IntegrationTests.dll': '$(TargetFileName)'"
Condition="$(IsIntegrationTestProject) != $(TargetFileName.EndsWith('.IntegrationTests.dll'))" />
</Target>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup>
<Copyright>$(CopyrightMicrosoft)</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
<GetVsixSourceItemsDependsOn>$(GetVsixSourceItemsDependsOn);IncludeVsixLocalOnlyItems</GetVsixSourceItemsDependsOn>
<GetVsixSourceItemsDependsOn>$(GetVsixSourceItemsDependsOn);IncludeNuGetResolvedAssets</GetVsixSourceItemsDependsOn>
<DisableTransitiveProjectReferences Condition="'$(RoslynProjectType)' == 'Vsix'">true</DisableTransitiveProjectReferences>
<!--
Transitive references get passed to all VS command line tools related to VSIX, VSCT, etc ... processsing.
These tools don't have RSP files and the full set of transitive references end up overflowing the allowed
command line length for Windows. These projects must manually specify references to avoid this overflow.
-->
<DisableTransitiveProjectReferences Condition="'$(IsVsixProject)' == 'true'">true</DisableTransitiveProjectReferences>
</PropertyGroup>
<ItemDefinitionGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<Target Name="GenerateVsdconfig"
AfterTargets="CoreCompile"
BeforeTargets="AfterCompile"
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<Project>
<PropertyGroup>
<PrepareForBuildDependsOn>$(PrepareForBuildDependsOn);AddDefaultTestAppConfig</PrepareForBuildDependsOn>
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.CSharp</RootNamespace>
<TargetFramework>net46</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<!-- https://github.com/dotnet/roslyn/issues/31412 -->
<SkipTests Condition="'$(TestRuntime)' == 'Mono'">true</SkipTests>
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis</RootNamespace>
<TargetFramework>net46</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\Analyzers\Microsoft.CodeAnalysis.CodeStyle.csproj" />
......
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net46</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
<!-- https://github.com/dotnet/roslyn/issues/31412 -->
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup Label="Globals">
<ProjectGuid>54e08bf5-f819-404f-a18d-0ab9ea81ea04</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests</RootNamespace>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<GenerateMicrosoftCodeAnalysisCommitHashAttribute>true</GenerateMicrosoftCodeAnalysisCommitHashAttribute>
</PropertyGroup>
<ItemGroup>
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.CSharp.UnitTests</RootNamespace>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<RuntimeIdentifiers>$(RoslynPortableRuntimeIdentifiers)</RuntimeIdentifiers>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests</RootNamespace>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<RuntimeIdentifiers>$(RoslynPortableRuntimeIdentifiers)</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests</RootNamespace>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<RuntimeIdentifiers>$(RoslynPortableRuntimeIdentifiers)</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -6,7 +6,6 @@
<RootNamespace>Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests</RootNamespace>
<NoStdLib>true</NoStdLib>
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<RuntimeIdentifiers>$(RoslynPortableRuntimeIdentifiers)</RuntimeIdentifiers>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
......
......@@ -8,7 +8,6 @@
<NoStdLib>true</NoStdLib>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<!-- The RESX resources generator produces invalid comments when the string has a line starting with '/' -->
<NoWarn>$(NoWarn);1570;1587</NoWarn>
</PropertyGroup>
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen</RootNamespace>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<!--
Disable on Linux. See https://github.com/dotnet/roslyn/pull/31026
-->
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup Label="Globals">
<ProjectGuid>d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
......
......@@ -6,7 +6,6 @@
<RootNamespace>Microsoft.CodeAnalysis.UnitTests</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<RuntimeIdentifiers>$(RoslynPortableRuntimeIdentifiers)</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup Label="Linked Files">
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup Label="Globals">
<ProjectGuid>ad6f474e-e6d4-4217-91f3-b7af1be31ccc</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
......
......@@ -6,7 +6,6 @@
<RootNamespace>Microsoft.CodeAnalysis.BuildTasks.UnitTests</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<!-- Multiple test failures -->
<SkipTests Condition="'$(TestRuntime)' == 'Mono'">true</SkipTests>
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.Compilers.Extension</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Vsix</RoslynProjectType>
<!-- VSIX -->
<GeneratePkgDefFile>true</GeneratePkgDefFile>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<ProjectGuid>{315BB5EF-73A8-44DD-A6F8-C07680D1E4FF}</ProjectGuid>
......
......@@ -7,7 +7,6 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RuntimeIdentifiers>$(RoslynPortableRuntimeIdentifiers)</RuntimeIdentifiers>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<!--
Currently fails on CI against old versions of mono
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup Label="Globals">
<ProjectGuid>e8f0baa5-7327-43d1-9a51-644e81ae55f1</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
......
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
<GenerateMicrosoftCodeAnalysisCommitHashAttribute>true</GenerateMicrosoftCodeAnalysisCommitHashAttribute>
......
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<RootNamespace></RootNamespace>
<!--
Current version of the SDK doesn't emit constants properly for VB
......
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<RootNamespace></RootNamespace>
<!--
......
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<RootNamespace></RootNamespace>
<!-- A zillion test failures + crash. See https://github.com/mono/mono/issues/10756. -->
......
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\Roslyn.Test.Utilities.csproj" />
......
......@@ -3,8 +3,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
<RoslynProjectType>SourcePackage</RoslynProjectType>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<DebugType>none</DebugType>
<GenerateDependencyFile>false</GenerateDependencyFile>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup Label="Globals">
<ProjectGuid>d73adf7d-2c1c-42ae-b2ab-edc9497e4b71</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
......
......@@ -3,8 +3,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
<RoslynProjectType>SourcePackage</RoslynProjectType>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<DebugType>none</DebugType>
<GenerateDependencyFile>false</GenerateDependencyFile>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup Label="Globals">
<ProjectGuid>c1930979-c824-496b-a630-70f5369a636f</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\build\Targets\Settings.props" />
<PropertyGroup>
<ProjectGuid>{57557F32-0635-421A-BCF8-549AED50F764}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>DeployToolsetCompiler</RootNamespace>
<AssemblyName>DeployToolsetCompiler_DoNotUse</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Compilers\Core\MSBuildTask\MSBuildTask.csproj">
<Project>{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}</Project>
<Name>MSBuildTask</Name>
</ProjectReference>
</ItemGroup>
<Import Project="..\..\..\build\Targets\Imports.targets" />
</Project>
\ No newline at end of file
namespace DoNotUse
{
public class Program
{
private static void Main(string[] args)
{
}
}
}
{
"dependencies": { },
"frameworks": {
"net46": { }
},
"runtimes": {
"win": { },
"linux": { },
"osx": { }
}
}
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Vsix</RoslynProjectType>
<IsShipping>false</IsShipping>
<!-- VSIX -->
......
......@@ -6,7 +6,6 @@
<TargetFramework>net472</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.Editor.CSharp.UnitTests</RootNamespace>
<RoslynProjectType>UnitTest</RoslynProjectType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -6,7 +6,6 @@
<TargetFramework>net472</TargetFramework>
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.Editor.CSharp.UnitTests</RootNamespace>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.Editor.UnitTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<OptionStrict>Off</OptionStrict>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -6,7 +6,6 @@
<OptionStrict>Off</OptionStrict>
<VBRuntime>Default</VBRuntime>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup Label="Project References">
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup Label="Globals">
<ProjectGuid>3140fe61-0856-4367-9aa3-8081b9a80e36</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
......
......@@ -6,7 +6,6 @@
<RootNamespace>Microsoft.CodeAnalysis.CSharp.UnitTests</RootNamespace>
<AssemblyName>Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests</AssemblyName>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -6,7 +6,6 @@
<RootNamespace>Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator</RootNamespace>
<AssemblyName>Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider.UnitTests</AssemblyName>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup Label="Project References">
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup Label="Globals">
<ProjectGuid>bb3ca047-5d00-48d4-b7d3-233c1265c065</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
......
......@@ -7,7 +7,6 @@
<AssemblyName>Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<!-- Don't transitively copy output files, since everything builds to the same folder. -->
</PropertyGroup>
<ItemGroup Label="Project References">
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup>
<NoConfig>true</NoConfig>
<NoStandardLib>true</NoStandardLib>
......
......@@ -3,7 +3,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<RoslynProjectType>Vsix</RoslynProjectType>
<TargetFramework>net472</TargetFramework>
<!-- VSIX -->
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup Label="Globals">
<ProjectGuid>3140fe61-0856-4367-9aa3-8081b9a80e35</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler.UnitTests</AssemblyName>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup Label="File References">
......
......@@ -6,7 +6,6 @@
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ResultProvider.UnitTests</AssemblyName>
<TargetFramework>net472</TargetFramework>
<VBRuntime>Default</VBRuntime>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup Label="File References">
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.InteractiveHost.UnitTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
<!-- NuGet -->
<IsPackable>true</IsPackable>
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
<!-- NuGet -->
<IsPackable>true</IsPackable>
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<RoslynProjectType>Custom</RoslynProjectType>
<!-- NuGet -->
<IsPackable>true</IsPackable>
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
<!-- NuGet -->
<IsPackable>true</IsPackable>
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
<IsPackable>true</IsPackable>
<NuspecPackageId>Microsoft.NETCore.Compilers</NuspecPackageId>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<Target Name="InitializeCoreClrCompilerArtifacts">
<ItemGroup>
<CoreClrCompilerToolsArtifact Include="$(ArtifactsBinDir)Microsoft.Build.Tasks.CodeAnalysis\$(Configuration)\netcoreapp2.1\publish\*.targets" />
......
......@@ -2,10 +2,6 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!--
The CompilerArtifact list is used to generate Microsoft.Net.Compilers package, VS.Toolset.Roslyn CoreXT package and Microsoft.CodeAnalysis.Compilers Willow VSIX.
Keeping the list in central location allows us to make sure that these packages include the same files.
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net472</TargetFrameworks>
<RoslynProjectType>Custom</RoslynProjectType>
<IsPackable>true</IsPackable>
<NuspecPackageId>Microsoft.Net.Compilers.Toolset</NuspecPackageId>
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
<IsPackable>true</IsPackable>
<NuspecPackageId>Microsoft.Net.Compilers</NuspecPackageId>
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
<!-- The package is inserted to Visual Studio CoreXT package store -->
<IsShipping>false</IsShipping>
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
<!-- The package is inserted to Visual Studio CoreXT package store -->
<IsShipping>false</IsShipping>
......
......@@ -6,7 +6,6 @@
<RootNamespace>Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
......
......@@ -6,7 +6,6 @@
<RootNamespace>Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -6,7 +6,6 @@
<RootNamespace>Microsoft.CodeAnalysis.Scripting.Test</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -6,7 +6,6 @@
<RootNamespace>Microsoft.CodeAnalysis.Scripting.Test</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -6,7 +6,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
<SkipTests Condition="'$(TestRuntime)' == 'Mono'">true</SkipTests>
</PropertyGroup>
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
<ApplyNgenOptimization>partial</ApplyNgenOptimization>
<!-- VS Insertion -->
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
<!-- VS Insertion -->
<TargetVsixContainerName>Roslyn.VisualStudio.Setup.ServiceHub.vsix</TargetVsixContainerName>
......
......@@ -2,7 +2,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>
</PropertyGroup>
<ItemGroup>
......
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27110.0

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28824.287
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildBoss", "BuildBoss.csproj", "{9C0660D9-48CA-40E1-BABA-8F6A1F11FE10}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RepoUtil", "..\RepoUtil\RepoUtil.csproj", "{1CA184D3-89CB-4074-BEC5-F8AEBA657D41}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BuildBoss", "BuildBoss.csproj", "{9C0660D9-48CA-40E1-BABA-8F6A1F11FE10}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -16,12 +15,11 @@ Global
{9C0660D9-48CA-40E1-BABA-8F6A1F11FE10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C0660D9-48CA-40E1-BABA-8F6A1F11FE10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C0660D9-48CA-40E1-BABA-8F6A1F11FE10}.Release|Any CPU.Build.0 = Release|Any CPU
{1CA184D3-89CB-4074-BEC5-F8AEBA657D41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1CA184D3-89CB-4074-BEC5-F8AEBA657D41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1CA184D3-89CB-4074-BEC5-F8AEBA657D41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1CA184D3-89CB-4074-BEC5-F8AEBA657D41}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7DA7C54F-CA30-48E6-8FD7-3A7A68E97872}
EndGlobalSection
EndGlobal
......@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace BuildBoss
{
......@@ -29,6 +28,12 @@ public bool Check(TextWriter textWriter)
var allGood = true;
if (ProjectType == ProjectFileType.CSharp || ProjectType == ProjectFileType.Basic)
{
if (!_projectUtil.IsNewSdk)
{
textWriter.WriteLine($"Project must new .NET SDK based");
allGood = false;
}
// Properties that aren't related to build but instead artifacts of Visual Studio.
allGood &= CheckForProperty(textWriter, "RestorePackages");
allGood &= CheckForProperty(textWriter, "SolutionDir");
......@@ -47,14 +52,11 @@ public bool Check(TextWriter textWriter)
allGood &= CheckForProperty(textWriter, "DocumentationFile");
// Items which are not necessary anymore in the new SDK
if (_projectUtil.IsNewSdk)
{
allGood &= CheckForProperty(textWriter, "ProjectGuid");
allGood &= CheckForProperty(textWriter, "ProjectTypeGuids");
allGood &= CheckForProperty(textWriter, "TargetFrameworkProfile");
}
allGood &= CheckForProperty(textWriter, "ProjectGuid");
allGood &= CheckForProperty(textWriter, "ProjectTypeGuids");
allGood &= CheckForProperty(textWriter, "TargetFrameworkProfile");
allGood &= CheckRoslynProjectType(textWriter);
allGood &= CheckTargetFrameworks(textWriter);
allGood &= CheckProjectReferences(textWriter);
allGood &= CheckPackageReferences(textWriter);
......@@ -88,68 +90,6 @@ private bool CheckForProperty(TextWriter textWriter, string propertyName)
return true;
}
/// <summary>
/// Validate the content of RoslynProjectType is one of the supported values.
/// </summary>
private bool CheckRoslynProjectType(TextWriter textWriter)
{
if (!ParseRoslynProjectData(textWriter, out var data))
{
return false;
}
var allGood = true;
allGood &= IsVsixCorrectlySpecified(textWriter, data);
allGood &= IsUnitTestNameCorrectlySpecified(textWriter, data);
allGood &= IsUnitTestPortableCorrectlySpecified(textWriter, data);
allGood &= CheckTargetFrameworks(textWriter, data);
return allGood;
}
private bool ParseRoslynProjectData(TextWriter textWriter, out RoslynProjectData data)
{
try
{
data = _projectUtil.GetRoslynProjectData();
return true;
}
catch (Exception ex)
{
textWriter.WriteLine("Unable to parse Roslyn project properties");
textWriter.WriteLine(ex.Message);
data = default;
return false;
}
}
private bool IsVsixCorrectlySpecified(TextWriter textWriter, RoslynProjectData data)
{
var element = _projectUtil.FindSingleProperty("ProjectTypeGuids");
if (element == null)
{
return true;
}
foreach (var rawValue in element.Value.Split(';'))
{
var value = rawValue.Trim();
if (string.IsNullOrEmpty(value))
{
continue;
}
var guid = Guid.Parse(value);
if (guid == ProjectEntryUtil.VsixProjectType && data.EffectiveKind != RoslynProjectKind.Vsix)
{
textWriter.WriteLine("Vsix projects must specify <RoslynProjectType>Vsix</RoslynProjectType>");
return false;
}
}
return true;
}
private bool CheckProjectReferences(TextWriter textWriter)
{
var allGood = true;
......@@ -159,53 +99,13 @@ private bool CheckProjectReferences(TextWriter textWriter)
allGood &= CheckProjectReferencesComplete(textWriter, declaredList);
allGood &= CheckUnitTestReferenceRestriction(textWriter, declaredList);
allGood &= CheckTransitiveReferences(textWriter, declaredList);
allGood &= CheckProjectReferencesHaveCorrectGuid(textWriter, declaredEntryList);
allGood &= CheckNewSdkSimplified(textWriter, declaredEntryList);
return allGood;
}
/// <summary>
/// Ensure that all ProjectReference entries in the file have the correct GUID when
/// the Project child element is present.
/// </summary>
private bool CheckProjectReferencesHaveCorrectGuid(TextWriter textWriter, List<ProjectReferenceEntry> entryList)
{
if (_projectUtil.IsNewSdk)
{
return true;
}
var allGood = true;
foreach (var entry in entryList)
{
if (!_solutionMap.TryGetValue(entry.ProjectKey, out var data))
{
textWriter.WriteLine($"Project not recognized {entry.FileName}");
allGood = false;
continue;
}
var dataGuid = data.ProjectUtil.GetProjectGuid();
if (dataGuid != entry.Project)
{
textWriter.WriteLine($"Project Reference GUID for {entry.ProjectKey.FileName} doesn't match ProjectGuid");
textWriter.WriteLine($"\tProject Guid {dataGuid}");
textWriter.WriteLine($"\tReference Guid {entry.Project}");
allGood = false;
}
}
allGood &= CheckNoGuidsOnProjectReferences(textWriter, declaredEntryList);
return allGood;
}
private bool CheckNewSdkSimplified(TextWriter textWriter, List<ProjectReferenceEntry> entryList)
private bool CheckNoGuidsOnProjectReferences(TextWriter textWriter, List<ProjectReferenceEntry> entryList)
{
if (!_projectUtil.IsNewSdk)
{
return true;
}
var allGood = true;
foreach (var entry in entryList)
{
......@@ -287,12 +187,6 @@ static string GetAssemblyName(ProjectData projectData)
private bool CheckDeploymentSettings(TextWriter textWriter)
{
var data = _projectUtil.TryGetRoslynProjectData();
if (data?.EffectiveKind == RoslynProjectKind.Custom)
{
return true;
}
var allGood = CheckForProperty(textWriter, "CopyNuGetImplementations");
allGood &= CheckForProperty(textWriter, "UseCommonOutputDirectory");
return allGood;
......@@ -335,8 +229,7 @@ private bool CheckProjectReferencesComplete(TextWriter textWriter, IEnumerable<P
/// </summary>
private bool CheckUnitTestReferenceRestriction(TextWriter textWriter, IEnumerable<ProjectKey> declaredReferences)
{
var data = _projectUtil.TryGetRoslynProjectData();
if (!data.HasValue || !data.Value.IsAnyUnitTest)
if (!_data.IsTestProject)
{
return true;
}
......@@ -349,8 +242,7 @@ private bool CheckUnitTestReferenceRestriction(TextWriter textWriter, IEnumerabl
continue;
}
var refData = projectData.ProjectUtil.TryGetRoslynProjectData();
if (refData.HasValue && refData.Value.IsAnyUnitTest)
if (projectData.ProjectUtil.IsTestProject)
{
textWriter.WriteLine($"Cannot reference {key.FileName} as it is another unit test project");
allGood = false;
......@@ -367,8 +259,7 @@ private bool CheckUnitTestReferenceRestriction(TextWriter textWriter, IEnumerabl
/// </summary>
private bool CheckTransitiveReferences(TextWriter textWriter, IEnumerable<ProjectKey> declaredReferences)
{
var data = _projectUtil.TryGetRoslynProjectData();
if (!data.HasValue || !data.Value.IsDeploymentProject)
if (!_projectUtil.IsDeploymentProject)
{
return true;
}
......@@ -418,73 +309,9 @@ private List<ProjectKey> GetProjectReferencesTransitive(IEnumerable<ProjectKey>
return list;
}
/// <summary>
/// Our infrastructure depends on test assembly names having a very specific set of
/// suffixes: UnitTest and IntegrationTests. This check will verify that both test assemblies
/// are properly named and non-test assemblies are not incorrectly named.
/// </summary>
private bool IsUnitTestNameCorrectlySpecified(TextWriter textWriter, RoslynProjectData data)
{
if (ProjectType != ProjectFileType.CSharp && ProjectType != ProjectFileType.Basic)
{
return true;
}
if (data.EffectiveKind == RoslynProjectKind.Depedency)
{
return true;
}
string name = null;
var element = _projectUtil.FindSingleProperty("AssemblyName");
if (element != null)
{
name = element.Value.Trim();
}
else if (_projectUtil.IsNewSdk)
{
name = Path.GetFileNameWithoutExtension(_data.FileName);
}
else
{
textWriter.WriteLine($"Need to specify AssemblyName");
return false;
}
if (Regex.IsMatch(name, @"(UnitTests|IntegrationTests)$", RegexOptions.IgnoreCase) && !data.IsAnyUnitTest)
{
textWriter.WriteLine($"Assembly named {name} is not marked as a unit test");
return false;
}
if (data.IsAnyUnitTest && !Regex.IsMatch(name, @".*(UnitTests|IntegrationTests)$", RegexOptions.IgnoreCase))
{
textWriter.WriteLine($"Assembly {name} is a unit test that doesn't end with UnitTests.dll");
return false;
}
return true;
}
private bool IsUnitTestPortableCorrectlySpecified(TextWriter textWriter, RoslynProjectData data)
{
if (!data.IsAnyUnitTest)
{
return true;
}
if (data.EffectiveKind == RoslynProjectKind.UnitTest && _projectUtil.GetTargetFrameworks() != null)
{
textWriter.WriteLine($"UnitTestPortable needs to be specified when using TargetFrameworks on a unit test project");
return false;
}
return true;
}
private bool CheckTargetFrameworks(TextWriter textWriter, RoslynProjectData data)
private bool CheckTargetFrameworks(TextWriter textWriter)
{
if (!data.IsAnyUnitTest)
if (!_data.IsUnitTestProject)
{
return true;
}
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Xml.Linq;
namespace BuildBoss
......@@ -19,6 +14,10 @@ internal sealed class ProjectData
internal string Directory => Path.GetDirectoryName(FilePath);
internal ProjectFileType ProjectFileType => ProjectEntryUtil.GetProjectFileType(FilePath);
internal bool IsTestProject => IsUnitTestProject || IsIntegrationTestProject;
internal bool IsUnitTestProject => Path.GetFileNameWithoutExtension(FilePath).EndsWith(".UnitTests");
internal bool IsIntegrationTestProject => Path.GetFileNameWithoutExtension(FilePath).EndsWith(".IntegrationTests");
internal ProjectData(string filePath)
{
FilePath = filePath;
......
......@@ -41,9 +41,7 @@ internal static class ProjectEntryUtil
internal static readonly Guid VsixProjectType = new Guid("82B43B9B-A64C-4715-B499-D71E9CA2BD60");
internal static readonly Guid SharedProject = new Guid("D954291E-2A0B-460D-934E-DC6B0785DB48");
internal static readonly Guid LegacyProjectSystemCSharp = new Guid("FAE04EC0-301F-11D3-BF4B-00C04F79EFBC");
internal static readonly Guid ManagedProjectSystemCSharp = new Guid("9A19103F-16F7-4668-BE54-9A1E7A4F7556");
internal static readonly Guid LegacyProjectSystemVisualBasic = new Guid("F184B08F-C81C-45F6-A57F-5ABD9991F28F");
internal static readonly Guid ManagedProjectSystemVisualBasic = new Guid("778DAE3C-4631-46EA-AA77-85C1314464D9");
internal static ProjectFileType GetProjectFileType(string path)
......
......@@ -16,26 +16,16 @@ internal class ProjectUtil
internal XDocument Document { get; }
internal XmlNamespaceManager Manager { get; }
internal XNamespace Namespace { get; }
internal string OutputType { get; }
public bool IsNewSdk => GetTargetFramework() != null || GetTargetFrameworks() != null;
public bool IsDesktopProject => Document.XPathSelectElements("//mb:TargetFrameworkVersion", Manager).FirstOrDefault() != null;
internal bool IsTestProject => IsUnitTestProject || IsIntegrationTestProject;
internal bool IsUnitTestProject => Path.GetFileNameWithoutExtension(Key.FilePath).EndsWith(".UnitTests");
internal bool IsIntegrationTestProject => Path.GetFileNameWithoutExtension(Key.FilePath).EndsWith(".IntegrationTests");
public bool IsPclProject
{
get
{
var elem = Document.XPathSelectElements("//mb:TargetFrameworkIdentifier", Manager).FirstOrDefault();
if (elem == null)
{
return false;
}
return StringComparer.OrdinalIgnoreCase.Equals(elem.Value, ".NETPortable");
}
}
internal ProjectUtil(string filePath) : this(new ProjectKey(filePath), XDocument.Load(filePath))
internal ProjectUtil(string filePath)
: this(new ProjectKey(filePath), XDocument.Load(filePath))
{
}
......@@ -46,78 +36,11 @@ internal ProjectUtil(ProjectKey key, XDocument document)
Namespace = document.Root.Name.Namespace;
Manager = new XmlNamespaceManager(new NameTable());
Manager.AddNamespace("mb", Namespace == XNamespace.None ? "" : SharedUtil.MSBuildNamespaceUriRaw);
}
internal RoslynProjectData GetRoslynProjectData()
{
if (!TryGetRoslynProjectData(out var data, out var error))
{
throw new Exception(error);
}
return data;
}
internal bool TryGetRoslynProjectData(out RoslynProjectData data, out string error)
{
data = default;
error = null;
var typeElement = FindSingleProperty("RoslynProjectType");
if (typeElement != null)
{
var value = typeElement.Value.Trim();
var kind = RoslynProjectKindUtil.GetRoslynProjectKind(value);
if (kind == null)
{
error = $"The value {value} is illegal for element <RoslynProjectType>";
return false;
}
data = new RoslynProjectData(kind.Value, kind.Value, value);
return true;
}
else
{
var outputType = FindSingleProperty("OutputType");
switch (outputType?.Value.Trim())
{
case "Exe":
case "WinExe":
data = new RoslynProjectData(RoslynProjectKind.Exe);
return true;
case "Library":
data = new RoslynProjectData(RoslynProjectKind.Dll);
return true;
default:
error = $"The value {outputType?.Value.Trim()} is not a recognized value of OutputType";
return false;
}
}
OutputType = FindSingleProperty("OutputType")?.Value.Trim().ToLowerInvariant();
}
internal Guid? GetProjectGuid()
{
var elem = Document.XPathSelectElements("//mb:ProjectGuid", Manager).FirstOrDefault();
if (elem == null)
{
return null;
}
return Guid.Parse(elem.Value);
}
internal RoslynProjectData? TryGetRoslynProjectData()
{
try
{
return GetRoslynProjectData();
}
catch
{
return null;
}
}
internal bool IsDeploymentProject => IsTestProject || OutputType switch { "exe" => true, "winexe" => true, _ => false };
internal XElement GetTargetFramework() => Document.XPathSelectElements("//mb:TargetFramework", Manager).FirstOrDefault();
......
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BuildBoss
{
internal enum RoslynProjectKind
{
Dll,
Exe,
ExeNonDeployment,
UnitTest,
UnitTestPortable,
Vsix,
Depedency,
SourcePackage,
Custom,
}
internal static class RoslynProjectKindUtil
{
/// <summary>
/// Convert a declared kind into the correspending enum value.
/// </summary>
internal static RoslynProjectKind? GetRoslynProjectKind(string value)
{
switch (value)
{
case "UnitTestPortable":
return RoslynProjectKind.UnitTestPortable;
case "UnitTest":
return RoslynProjectKind.UnitTest;
case "Vsix":
return RoslynProjectKind.Vsix;
case "Dependency":
return RoslynProjectKind.Depedency;
case "Custom":
return RoslynProjectKind.Custom;
case "SourcePackage":
return RoslynProjectKind.SourcePackage;
default:
return null;
}
}
internal static bool IsAnyUnitTest(RoslynProjectKind kind)
{
return
kind == RoslynProjectKind.UnitTest ||
kind == RoslynProjectKind.UnitTestPortable;
}
internal static bool IsDeploymentProject(RoslynProjectKind kind)
{
return
kind == RoslynProjectKind.Exe ||
IsAnyUnitTest(kind);
}
}
internal struct RoslynProjectData
{
internal RoslynProjectKind EffectiveKind { get; }
internal RoslynProjectKind? DeclaredKind { get; }
internal string DeclaredValue { get; }
internal bool IsAnyUnitTest => RoslynProjectKindUtil.IsAnyUnitTest(EffectiveKind);
internal bool IsDeploymentProject => RoslynProjectKindUtil.IsDeploymentProject(EffectiveKind);
internal RoslynProjectData(RoslynProjectKind effectiveKind)
{
EffectiveKind = effectiveKind;
DeclaredValue = null;
DeclaredKind = null;
}
internal RoslynProjectData(RoslynProjectKind effectiveKind, RoslynProjectKind declaredKind, string declaredValue)
{
Debug.Assert(declaredKind == RoslynProjectKindUtil.GetRoslynProjectKind(declaredValue).Value);
EffectiveKind = effectiveKind;
DeclaredValue = declaredValue;
DeclaredKind = declaredKind;
}
}
}
......@@ -106,8 +106,8 @@ Guid getExpectedGuid(ProjectData data)
var util = data.ProjectUtil;
switch (ProjectEntryUtil.GetProjectFileType(data.FilePath))
{
case ProjectFileType.CSharp: return util.IsNewSdk ? ProjectEntryUtil.ManagedProjectSystemCSharp : ProjectEntryUtil.LegacyProjectSystemCSharp;
case ProjectFileType.Basic: return util.IsNewSdk ? ProjectEntryUtil.ManagedProjectSystemVisualBasic : ProjectEntryUtil.LegacyProjectSystemVisualBasic;
case ProjectFileType.CSharp: return ProjectEntryUtil.ManagedProjectSystemCSharp;
case ProjectFileType.Basic: return ProjectEntryUtil.ManagedProjectSystemVisualBasic;
case ProjectFileType.Shared: return ProjectEntryUtil.SharedProject;
default: throw new Exception($"Invalid file path {data.FilePath}");
}
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.VisualStudio.CSharp.UnitTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.VisualStudio.Next.UnitTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<DefineConstants>$(DefineConstants);TESTS</DefineConstants>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -4,7 +4,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup Label="Project References">
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.VisualStudio.IntegrationTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.VisualStudio.IntegrationTest.Setup</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Vsix</RoslynProjectType>
<IsShipping>false</IsShipping>
<!-- VSIX -->
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.VisualStudio.RemoteHostClientMock</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Vsix</RoslynProjectType>
<IsShipping>false</IsShipping>
<!-- VSIX -->
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.VisualStudio.Setup.Dependencies</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Vsix</RoslynProjectType>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<!-- VSIX -->
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.VisualStudio.Setup</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Vsix</RoslynProjectType>
<!-- VSIX -->
<GeneratePkgDefFile>true</GeneratePkgDefFile>
......
......@@ -3,7 +3,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Vsix</RoslynProjectType>
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.VisualStudio.DiagnosticsWindow</RootNamespace>
......
......@@ -12,7 +12,6 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.VisualStudio.InteractiveComponents</RootNamespace>
<RoslynProjectType>Vsix</RoslynProjectType>
<TargetFramework>net472</TargetFramework>
<!-- VSIX -->
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.CSharp.UnitTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.UnitTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.UnitTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -5,7 +5,6 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.MSBuild.UnitTests</RootNamespace>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
......
......@@ -6,7 +6,6 @@
<OptionStrict>Off</OptionStrict>
<VBRuntime>Default</VBRuntime>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>UnitTest</RoslynProjectType>
<RootNamespace></RootNamespace>
</PropertyGroup>
<ItemGroup Label="Project References">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册