Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UseCompilerGeneratedDocXmlFile default value #106179

Merged
merged 8 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@
<TreatWarningsAsErrors Condition="'$(TreatWarningsAsErrors)' == ''">true</TreatWarningsAsErrors>
<!-- Warnings to always disable -->
<NoWarn>$(NoWarn);CS8500;CS8969</NoWarn>
<!-- Suppress "CS1591 - Missing XML comment for publicly visible type or member" compiler errors for private assemblies. -->
<NoWarn Condition="'$(IsPrivateAssembly)' == 'true'">$(NoWarn);CS1591</NoWarn>
<!-- Always pass portable to override arcade sdk which uses embedded for local builds -->
<DebugType>portable</DebugType>
<KeepNativeSymbols Condition="'$(KeepNativeSymbols)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</KeepNativeSymbols>
Expand Down
15 changes: 14 additions & 1 deletion eng/intellisense.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project>

<PropertyGroup>
<UseCompilerGeneratedDocXmlFile Condition="'$(UseCompilerGeneratedDocXmlFile)' == ''">true</UseCompilerGeneratedDocXmlFile>
</PropertyGroup>

<PropertyGroup Condition="'$(UseCompilerGeneratedDocXmlFile)' != 'true'">
<IntellisensePackageXmlRootFolder>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles'))</IntellisensePackageXmlRootFolder>
<IntellisensePackageXmlFilePathFromNetFolder>$([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'net', '1033', '$(AssemblyName).xml'))</IntellisensePackageXmlFilePathFromNetFolder>
Expand All @@ -10,7 +14,7 @@
<IntermediateDocFileItemFromIntellisensePackage>$(IntermediateOutputPath)$(TargetName).intellisense-package.xml</IntermediateDocFileItemFromIntellisensePackage>

<!-- Suppress "CS1591 - Missing XML comment for publicly visible type or member" compiler errors when the intellisense package xml file is used. -->
<NoWarn Condition="'$(SkipIntellisenseNoWarnCS1591)' != 'true'">$(NoWarn);1591</NoWarn>
<NoWarn Condition="'$(SkipIntellisenseNoWarnCS1591)' != 'true'">$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<!-- Flow these properties to consuming projects for Microsoft.Internal.Runtime.DotNetApiDocs.Transport.proj to only
Expand All @@ -27,6 +31,15 @@
<PackageDownload Include="Microsoft.Private.Intellisense" Version="[$(MicrosoftPrivateIntellisenseVersion)]" />
</ItemGroup>

<!-- Warn if the docs team provided package doesn't have an intellisense file for a given library and the library explicitly
opts out from using the compiler generated xml file. -->
<Target Name="ValidateIntellisensePackageXmlFilePathExists"
Condition="'$(UseCompilerGeneratedDocXmlFile)' != 'true' and
'$(IntellisensePackageXmlFilePath)' == ''"
BeforeTargets="CoreCompile">
<Warning Text="The 'UseCompilerGeneratedDocXmlFile' property was set to '$(UseCompilerGeneratedDocXmlFile)', but the doc team doesn't provide a file for this assembly. Remove the 'UseCompilerGeneratedDocXmlFile' property to let the compiler generate the file." />
</Target>

<!-- Prepare the intellisense package xml file by copying it to the project's intermediate folder and update its file timestamp.
This is necessary so that all project outputs are newer than all project inputs. Directly copying from the intellisense package
would violate that and break fast up-to-date check. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
namespace System.Security.Cryptography.X509Certificates
{
[UnsupportedOSPlatform("browser")]
#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105974
public static partial class X509CertificateLoader
#pragma warning restore 1591
{
private const int MemoryMappedFileCutoff = 1_048_576;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ public static IHttpClientBuilder ConfigureAdditionalHttpMessageHandlers(this IHt
return builder;
}

#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105974
public static IHttpClientBuilder AddAsKeyed(this IHttpClientBuilder builder, ServiceLifetime lifetime = ServiceLifetime.Scoped)
{
ThrowHelper.ThrowIfNull(builder);
Expand Down Expand Up @@ -703,6 +704,7 @@ public static IHttpClientBuilder RemoveAsKeyed(this IHttpClientBuilder builder)

return builder;
}
#pragma warning restore 1591

// workaround for https://github.com/dotnet/runtime/issues/102654
private static void UpdateEmptyNameHttpClient(IServiceCollection services, HttpClientMappingRegistry registry)
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Net.Http/src/System.Net.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-linux;$(NetCoreAppCurrent)-osx;$(NetCoreAppCurrent)-freebsd;$(NetCoreAppCurrent)-maccatalyst;$(NetCoreAppCurrent)-ios;$(NetCoreAppCurrent)-tvos;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-wasi;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-solaris;$(NetCoreAppCurrent)-haiku;$(NetCoreAppCurrent)-android;$(NetCoreAppCurrent)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);HTTP_DLL</DefineConstants>
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
</PropertyGroup>

<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/System.Numerics.Tensors/src/System/NIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ public static NIndex FromEnd(nint value)
return new NIndex(~value);
}

#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public Index ToIndex() => checked((Index)this);
public Index ToIndexUnchecked() => (Index)this;
#pragma warning restore 1591

/// <summary>Returns the NIndex value.</summary>
public nint Value
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/System.Numerics.Tensors/src/System/NRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ public override string ToString()

private static void ThrowArgumentOutOfRangeException() => throw new ArgumentOutOfRangeException("length");

#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public static implicit operator NRange(Range range) => new NRange(range.Start, range.End);

public static explicit operator Range(NRange value) => new Range((Index)value.Start, (Index)value.End);
public static explicit operator checked Range(NRange value) => new Range(checked((Index)value.Start), checked((Index)value.End));

public Range ToRange() => new Range(checked((Index)Start), checked((Index)End));
public Range ToRangeUnchecked() => new Range((Index)Start, (Index)End);
#pragma warning restore 1591
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981

namespace System.Numerics.Tensors
{
[Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
Expand Down Expand Up @@ -44,3 +46,5 @@ public interface IReadOnlyTensor<TSelf, T> : IEnumerable<T>
bool TryFlattenTo(scoped Span<T> destination);
}
}

#pragma warning restore 1591
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using System.Buffers;
using System.Diagnostics.CodeAnalysis;

#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981

namespace System.Numerics.Tensors
{
[Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
Expand Down Expand Up @@ -37,3 +39,5 @@ public interface ITensor<TSelf, T>
new ref T GetPinnableReference();
}
}

#pragma warning restore 1591
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,9 @@ public bool TryCopyTo(scoped TensorSpan<T> destination)
}

//public static explicit operator TensorSpan<T>(Array? array);
#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public static implicit operator ReadOnlyTensorSpan<T>(T[]? array) => new ReadOnlyTensorSpan<T>(array);
#pragma warning restore 1591

/// <summary>
/// Returns a <see cref="string"/> with the name of the type and the number of elements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public static Tensor<T> CreateUninitialized<T>(scoped ReadOnlySpan<nint> lengths
return new Tensor<T>(values, lengths, strides, pinned);
}

#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public static ref readonly TensorSpan<T> FillGaussianNormalDistribution<T>(in TensorSpan<T> destination, Random? random = null) where T : IFloatingPoint<T>
{
Span<T> span = MemoryMarshal.CreateSpan<T>(ref destination._reference, (int)destination._shape._memoryLength);
Expand All @@ -193,5 +194,6 @@ public static ref readonly TensorSpan<T> FillUniformDistribution<T>(in TensorSpa

return ref destination;
}
#pragma warning restore 1591
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
namespace System.Numerics.Tensors
{
[Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public sealed class Tensor<T>
: ITensor<Tensor<T>, T>
#pragma warning restore 1591
{
/// <summary>A byref or a native ptr.</summary>
internal readonly T[] _values;
Expand Down Expand Up @@ -365,11 +367,13 @@ public Tensor<T> this[Tensor<bool> filter]
}
}

#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public static implicit operator Tensor<T>(T[] array) => new Tensor<T>(array, [array.Length]);

public static implicit operator TensorSpan<T>(Tensor<T> value) => new TensorSpan<T>(ref MemoryMarshal.GetArrayDataReference(value._values), value._lengths, value._strides, value._flattenedLength);

public static implicit operator ReadOnlyTensorSpan<T>(Tensor<T> value) => new ReadOnlyTensorSpan<T>(ref MemoryMarshal.GetArrayDataReference(value._values), value._lengths, value._strides, value.FlattenedLength);
#pragma warning restore 1591

/// <summary>
/// Converts this <see cref="Tensor{T}"/> to a <see cref="TensorSpan{T}"/> pointing to the same backing memory."/>
Expand Down Expand Up @@ -614,10 +618,12 @@ public void Dispose()
}

// REVIEW: PENDING API REVIEW TO DETERMINE IMPLEMENTATION
#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public override int GetHashCode()
{
throw new NotImplementedException();
}
#pragma warning restore 1591

/// <summary>
/// Get a string representation of the tensor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
namespace System.Numerics.Tensors
{
[Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)]
#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public static partial class Tensor
#pragma warning restore 1591
{
#region AsReadOnlySpan
/// <summary>
Expand Down Expand Up @@ -6587,6 +6589,7 @@ public static ref readonly TensorSpan<T> Xor<T>(scoped in ReadOnlyTensorSpan<T>
}
#endregion

#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public static nint[] GetSmallestBroadcastableLengths(ReadOnlySpan<nint> shape1, ReadOnlySpan<nint> shape2)
{
if (!TensorHelpers.IsBroadcastableTo(shape1, shape2))
Expand All @@ -6604,6 +6607,7 @@ public static nint[] GetSmallestBroadcastableLengths(ReadOnlySpan<nint> shape1,

return intermediateShape;
}
#pragma warning restore 1591

#region TensorPrimitivesHelpers
private delegate void PerformCalculationSpanInSpanOut<T>(ReadOnlySpan<T> input, Span<T> output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,9 @@ public bool TryCopyTo(scoped TensorSpan<T> destination)
}

//public static explicit operator TensorSpan<T>(Array? array);
#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105981
public static implicit operator TensorSpan<T>(T[]? array) => new TensorSpan<T>(array);
#pragma warning restore 1591

/// <summary>
/// Defines an implicit conversion of a <see cref="TensorSpan{T}"/> to a <see cref="ReadOnlyTensorSpan{T}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
namespace System.Buffers.Text
{
// AVX2 and Vector128 version based on https://github.com/gfoidl/Base64/blob/5383320e28cac6c7ac6f86502fb05d23a048a21d/source/gfoidl.Base64/Internal/Encodings/Base64UrlEncoding.cs

#pragma warning disable 1591 // TODO: Document this API. https://github.com/dotnet/runtime/issues/105974
public static partial class Base64Url
#pragma warning restore 1591
{
private const int MaxStackallocThreshold = 256;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- Too much private reflection. Do not bother with trimming -->
<ILLinkTrimAssembly>false</ILLinkTrimAssembly>
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<RootNamespace>System.Xml</RootNamespace>
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<RootNamespace>System.Xml</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<EnableAOTAnalyzer>false</EnableAOTAnalyzer>
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/libraries/System.Speech/src/System.Speech.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
<!-- CS0649: uninitialized interop type fields -->
<!-- SA1129: https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3277 -->
<NoWarn>$(NoWarn);CS0649;SA1129;IDE0059;IDE0060;CA1822;CA1852</NoWarn>
<!-- TODO: Document public visible types and members. https://github.com/dotnet/runtime/issues/87711 -->
<NoWarn>$(NoWarn);CS1591</NoWarn>
<IsTrimmable>false</IsTrimmable>
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is causing an error due to it's use of a PNSE.

<IsPackable>true</IsPackable>
<AddNETFrameworkPlaceholderFileToPackage>true</AddNETFrameworkPlaceholderFileToPackage>
<AddNETFrameworkAssemblyReferenceToPackage>true</AddNETFrameworkAssemblyReferenceToPackage>
Expand Down
Loading