Skip to content

Commit

Permalink
Log explicit failure for LC on Core (#7068)
Browse files Browse the repository at this point in the history
This isn't going to be supported per dotnet/winforms#1462.
  • Loading branch information
rainersigwald authored Dec 2, 2021
1 parent 1ef0032 commit 6a39abb
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
16 changes: 16 additions & 0 deletions src/Tasks/LC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Microsoft.Build.Tasks
/// <summary>
/// The License Compiler task
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("ApiDesign", "RS0022:Constructor make noninheritable base class inheritable", Justification = "Class structure has existed for a long time and shouldn't be adjusted.")]
public class LC : ToolTaskExtension
{
#region Input/output properties
Expand Down Expand Up @@ -88,6 +89,21 @@ public string SdkToolsPath
public string TargetFrameworkVersion { get; set; }
#endregion

#if !NETFRAMEWORK
/// <summary>
/// Override of Execute that errors, since <see cref="LC"/> is not expected to get
/// .NET Core support.
/// </summary>
/// <remarks>
/// See https://github.com/dotnet/winforms/issues/1462.
/// </remarks>
public override bool Execute()
{
Log.LogErrorFromResources("TaskRequiresFrameworkFailure", nameof(LC));
return false;
}
#endif

#region Class properties

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions src/Tasks/Microsoft.Build.Tasks.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Shared\FileSystemSources.proj" />
<Import Project="..\Shared\DebuggingSources.proj" />
Expand Down Expand Up @@ -442,6 +442,9 @@
<Compile Include="InvalidParameterValueException.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="LC.cs" Condition="'$(MonoBuild)' != 'true'">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="ListOperators\FindUnderPath.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
Expand Down Expand Up @@ -492,6 +495,7 @@
<Compile Include="RoslynCodeTaskFactory\RoslynCodeTaskFactoryCodeType.cs" />
<Compile Include="RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs" />
<Compile Include="RoslynCodeTaskFactory\RoslynCodeTaskFactoryTaskInfo.cs" />
<Compile Include="SdkToolsPathUtility.cs" />
<Compile Include="SGen.cs" Condition="'$(MonoBuild)' != 'true'">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
Expand Down Expand Up @@ -601,9 +605,6 @@
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="RCWForCurrentContext.cs" />
<Compile Include="LC.cs" Condition="'$(MonoBuild)' != 'true'">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="PiaReference.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
Expand All @@ -618,7 +619,6 @@
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="ResolveSDKReference.cs" />
<Compile Include="SdkToolsPathUtility.cs" />
<Compile Include="RequiresFramework35SP1Assembly.cs" Condition="'$(MonoBuild)' != 'true'">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
Expand Down
24 changes: 24 additions & 0 deletions src/Tasks/PublicAPI/netstandard/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Microsoft.Build.Tasks.LC
Microsoft.Build.Tasks.LC.LC() -> void
Microsoft.Build.Tasks.LC.LicenseTarget.get -> Microsoft.Build.Framework.ITaskItem
Microsoft.Build.Tasks.LC.LicenseTarget.set -> void
Microsoft.Build.Tasks.LC.NoLogo.get -> bool
Microsoft.Build.Tasks.LC.NoLogo.set -> void
Microsoft.Build.Tasks.LC.OutputDirectory.get -> string
Microsoft.Build.Tasks.LC.OutputDirectory.set -> void
Microsoft.Build.Tasks.LC.OutputLicense.get -> Microsoft.Build.Framework.ITaskItem
Microsoft.Build.Tasks.LC.OutputLicense.set -> void
Microsoft.Build.Tasks.LC.ReferencedAssemblies.get -> Microsoft.Build.Framework.ITaskItem[]
Microsoft.Build.Tasks.LC.ReferencedAssemblies.set -> void
Microsoft.Build.Tasks.LC.SdkToolsPath.get -> string
Microsoft.Build.Tasks.LC.SdkToolsPath.set -> void
Microsoft.Build.Tasks.LC.Sources.get -> Microsoft.Build.Framework.ITaskItem[]
Microsoft.Build.Tasks.LC.Sources.set -> void
Microsoft.Build.Tasks.LC.TargetFrameworkVersion.get -> string
Microsoft.Build.Tasks.LC.TargetFrameworkVersion.set -> void
override Microsoft.Build.Tasks.LC.AddCommandLineCommands(Microsoft.Build.Tasks.CommandLineBuilderExtension commandLine) -> void
override Microsoft.Build.Tasks.LC.AddResponseFileCommands(Microsoft.Build.Tasks.CommandLineBuilderExtension commandLine) -> void
override Microsoft.Build.Tasks.LC.Execute() -> bool
override Microsoft.Build.Tasks.LC.GenerateFullPathToTool() -> string
override Microsoft.Build.Tasks.LC.ToolName.get -> string
override Microsoft.Build.Tasks.LC.ValidateParameters() -> bool

0 comments on commit 6a39abb

Please sign in to comment.