Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 131 additions & 2 deletions src/Tasks/Al.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#if NETFRAMEWORK
using System;

using Microsoft.Build.Framework;
using Microsoft.Build.Shared.FileSystem;
using Microsoft.Build.Utilities;
#endif

using Microsoft.Build.Framework;

#nullable disable

namespace Microsoft.Build.Tasks
{
#if NETFRAMEWORK

/// <summary>
/// This class defines the "AL" XMake task, which enables using al.exe to link
/// modules and resource files into assemblies.
/// </summary>
public class AL : ToolTaskExtension
public class AL : ToolTaskExtension, IALTaskContract
{
#region Properties
/*
Expand Down Expand Up @@ -387,6 +392,130 @@ public override bool Execute()
return base.Execute();
}

#endregion
}

#else

/// <summary>
/// Stub AL task for .NET Core.
/// </summary>
public sealed class AL : TaskRequiresFramework, IALTaskContract
{
public AL()
: base(nameof(AL))
{
}

#region Properties

public string AlgorithmId { get; set; }

public string BaseAddress { get; set; }

public string CompanyName { get; set; }

public string Configuration { get; set; }

public string Copyright { get; set; }

public string Culture { get; set; }

public bool DelaySign { get; set; }

public string Description { get; set; }

public string EvidenceFile { get; set; }

public string FileVersion { get; set; }

public string Flags { get; set; }

public bool GenerateFullPaths { get; set; }

public string KeyFile { get; set; }

public string KeyContainer { get; set; }

public string MainEntryPoint { get; set; }

[Output]
public ITaskItem OutputAssembly { get; set; }

public string Platform { get; set; }

public bool Prefer32Bit { get; set; }

public string ProductName { get; set; }

public string ProductVersion { get; set; }

public string[] ResponseFiles { get; set; }

public string TargetType { get; set; }

public string TemplateFile { get; set; }

public string Title { get; set; }

public string Trademark { get; set; }

public string Version { get; set; }

public string Win32Icon { get; set; }

public string Win32Resource { get; set; }

public ITaskItem[] SourceModules { get; set; }

public ITaskItem[] EmbedResources { get; set; }

public ITaskItem[] LinkResources { get; set; }

public string SdkToolsPath { get; set; }

#endregion
}

#endif

internal interface IALTaskContract
{
#region Properties

string AlgorithmId { get; set; }
string BaseAddress { get; set; }
string CompanyName { get; set; }
string Configuration { get; set; }
string Copyright { get; set; }
string Culture { get; set; }
bool DelaySign { get; set; }
string Description { get; set; }
string EvidenceFile { get; set; }
string FileVersion { get; set; }
string Flags { get; set; }
bool GenerateFullPaths { get; set; }
string KeyFile { get; set; }
string KeyContainer { get; set; }
string MainEntryPoint { get; set; }
ITaskItem OutputAssembly { get; set; }
string Platform { get; set; }
bool Prefer32Bit { get; set; }
string ProductName { get; set; }
string ProductVersion { get; set; }
string[] ResponseFiles { get; set; }
string TargetType { get; set; }
string TemplateFile { get; set; }
string Title { get; set; }
string Trademark { get; set; }
string Version { get; set; }
string Win32Icon { get; set; }
string Win32Resource { get; set; }
ITaskItem[] SourceModules { get; set; }
ITaskItem[] EmbedResources { get; set; }
ITaskItem[] LinkResources { get; set; }
string SdkToolsPath { get; set; }

#endregion
}
}
72 changes: 71 additions & 1 deletion src/Tasks/AspNetCompiler.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#if NETFRAMEWORK
using Microsoft.Build.Utilities;
#endif

#nullable disable

namespace Microsoft.Build.Tasks
{
#if NETFRAMEWORK

/// <summary>
/// The AspNetCompiler task, which is a wrapper around aspnet_compiler.exe
/// </summary>
public class AspNetCompiler : ToolTaskExtension
public class AspNetCompiler : ToolTaskExtension, IAspNetCompilerTaskContract
{
/*
C:\WINDOWS\Microsoft.NET\Framework\v2.0.x86dbg>aspnet_compiler /?
Expand Down Expand Up @@ -338,4 +342,70 @@ protected override bool ValidateParameters()
return true;
}
}

#else

public sealed class AspNetCompiler : TaskRequiresFramework, IAspNetCompilerTaskContract
{
public AspNetCompiler()
: base(nameof(AspNetCompiler))
{
}

#region Properties

public bool AllowPartiallyTrustedCallers { get; set; }

public bool DelaySign { get; set; }

public bool FixedNames { get; set; }

public string KeyContainer { get; set; }

public string KeyFile { get; set; }

public string MetabasePath { get; set; }

public string PhysicalPath { get; set; }

public string TargetPath { get; set; }

public string VirtualPath { get; set; }

public bool Updateable { get; set; }

public bool Force { get; set; }

public bool Debug { get; set; }

public bool Clean { get; set; }

public string TargetFrameworkMoniker { get; set; }

#endregion
}

#endif

internal interface IAspNetCompilerTaskContract
{
#region Properties

bool AllowPartiallyTrustedCallers { get; set; }
bool DelaySign { get; set; }
bool FixedNames { get; set; }
string KeyContainer { get; set; }
string KeyFile { get; set; }
string MetabasePath { get; set; }
string PhysicalPath { get; set; }
string TargetPath { get; set; }
string VirtualPath { get; set; }
bool Updateable { get; set; }
bool Force { get; set; }
bool Debug { get; set; }
bool Clean { get; set; }
string TargetFrameworkMoniker { get; set; }

#endregion
}
}
66 changes: 63 additions & 3 deletions src/Tasks/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<!-- For ease of logging the "not supported on Core" message, this task is a
TaskExtension on netstandard/netcore. Since the type is sealed there,
<!-- For ease of logging the "not supported on Core" message, these tasks are a
TaskRequiresFramework on netstandard/netcore. Since the type is sealed there,
that shouldn't cause any implementation problems since no one can derive
from it and try to call TaskExtension.Log. -->
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.AL</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.AspNetCompiler</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.GenerateBootstrapper</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.GenerateTrustInfo</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.GetFrameworkSdkPath</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.RegisterAssembly</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.ResolveComReference</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.ResolveNativeReference</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.UnregisterAssembly</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.UpdateManifest</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0007</DiagnosticId>
<Target>T:Microsoft.Build.Tasks.WinMDExp</Target>
<Left>ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll</Left>
<Right>ref/net472/Microsoft.Build.Tasks.Core.dll</Right>
</Suppression>

<!-- PKV004 for netstandard2.0-supporting TFs that we do not have runtime assemblies for.
This is intentional, because you can only use MSBuild in the context of a .NET SDK
Expand Down
Loading