-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291 from sharwell/no-desktop-assembly
Fail the build on reference to Microsoft.CodeAnalysis.Workspaces.Desktop
- Loading branch information
Showing
4 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
src/Microsoft.CodeAnalysis.Testing/Directory.Build.targets
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,4 +1,16 @@ | ||
<!-- 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> | ||
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" /> | ||
|
||
<!-- | ||
Microsoft.CodeAnalysis.Workspaces.Desktop is part of Roslyn prior to the 3.0.0 release, but is not included starting | ||
with 3.0.0. This target ensures that even though we compile against an early build of Roslyn (1.0.1), we do not pick | ||
up this dependency in a way that breaks 3.0+ consumers. | ||
--> | ||
<Target Name="RemoveWorkspacesDesktop" AfterTargets="ResolvePackageAssets"> | ||
<ItemGroup> | ||
<RuntimeCopyLocalItems Remove="@(RuntimeCopyLocalItems)" Condition="'%(Filename)' == 'Microsoft.CodeAnalysis.Workspaces.Desktop'" /> | ||
<ResolvedCompileFileDefinitions Remove="@(ResolvedCompileFileDefinitions)" Condition="'%(Filename)' == 'Microsoft.CodeAnalysis.Workspaces.Desktop'" /> | ||
</ItemGroup> | ||
</Target> | ||
</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
15 changes: 15 additions & 0 deletions
15
...is.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/EnsureNoWorkspacesDesktopReferenceA.cs
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,15 @@ | ||
// <auto-generated/> | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#if DEBUG | ||
|
||
namespace Microsoft.CodeAnalysis | ||
{ | ||
/// <summary> | ||
/// This type is part of forcing a build error in the Code Fix assembly if a reference to | ||
/// Microsoft.CodeAnalysis.Workspaces.Desktop is included. | ||
/// </summary> | ||
internal class FileTextLoader { } | ||
} | ||
|
||
#endif |
18 changes: 18 additions & 0 deletions
18
...sis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/EnsureNoWorkspacesDesktopReferenceB.cs
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,18 @@ | ||
// <auto-generated/> | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#if DEBUG | ||
|
||
namespace Microsoft.CodeAnalysis | ||
{ | ||
/// <summary> | ||
/// This class will fail to compile (CS0419 Ambiguous reference in cref attribute) if the project contains a | ||
/// reference to Microsoft.CodeAnalysis.Workspaces.Desktop. | ||
/// </summary> | ||
/// <see cref="FileTextLoader"/> | ||
internal class EnsureNoWorkspacesDesktopReference | ||
{ | ||
} | ||
} | ||
|
||
#endif |