-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add netstandard and net10 targets to C# SDK #1320
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3e85449
Add netstandard and net10 targets to C# SDK
Copilot 34d6eba
Address downlevel polyfill review feedback
Copilot 4b1a66a
Fix .NET multi-target restore
Copilot 63b1c71
Skip Copilot CLI targets in outer builds
Copilot 42fe641
Address Copilot review feedback
Copilot c3e18d9
Order Copilot CLI version generation
Copilot a61a3a6
Fix C# SDK CI build
Copilot a4902f1
Address process polyfill review feedback
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,92 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| namespace System.Buffers; | ||
|
|
||
| internal sealed class ArrayBufferWriter<T> : IBufferWriter<T> | ||
| { | ||
| private const int DefaultInitialBufferSize = 256; | ||
| private T[] _buffer; | ||
| private int _index; | ||
|
|
||
| public ArrayBufferWriter() | ||
| : this(DefaultInitialBufferSize) | ||
| { | ||
| } | ||
|
|
||
| public ArrayBufferWriter(int initialCapacity) | ||
| { | ||
| if (initialCapacity < 0) | ||
| { | ||
| throw new ArgumentOutOfRangeException(nameof(initialCapacity)); | ||
| } | ||
|
|
||
| _buffer = initialCapacity == 0 ? [] : new T[initialCapacity]; | ||
| } | ||
|
|
||
| public ReadOnlyMemory<T> WrittenMemory => _buffer.AsMemory(0, _index); | ||
|
|
||
| public ReadOnlySpan<T> WrittenSpan => _buffer.AsSpan(0, _index); | ||
|
|
||
| public int WrittenCount => _index; | ||
|
|
||
| public int Capacity => _buffer.Length; | ||
|
|
||
| public int FreeCapacity => _buffer.Length - _index; | ||
|
|
||
| public void Clear() | ||
| { | ||
| _buffer.AsSpan(0, _index).Clear(); | ||
| _index = 0; | ||
| } | ||
|
|
||
| public void Advance(int count) | ||
| { | ||
| if (count < 0) | ||
| { | ||
| throw new ArgumentOutOfRangeException(nameof(count)); | ||
| } | ||
|
|
||
| if (count > FreeCapacity) | ||
| { | ||
| throw new InvalidOperationException("Cannot advance past the end of the buffer."); | ||
| } | ||
|
|
||
| _index += count; | ||
| } | ||
|
|
||
| public Memory<T> GetMemory(int sizeHint = 0) | ||
| { | ||
| CheckAndResizeBuffer(sizeHint); | ||
| return _buffer.AsMemory(_index); | ||
| } | ||
|
|
||
| public Span<T> GetSpan(int sizeHint = 0) | ||
| { | ||
| CheckAndResizeBuffer(sizeHint); | ||
| return _buffer.AsSpan(_index); | ||
| } | ||
|
|
||
| private void CheckAndResizeBuffer(int sizeHint) | ||
| { | ||
| if (sizeHint < 0) | ||
| { | ||
| throw new ArgumentOutOfRangeException(nameof(sizeHint)); | ||
| } | ||
|
|
||
| if (sizeHint == 0) | ||
| { | ||
| sizeHint = 1; | ||
| } | ||
|
|
||
| if (sizeHint <= FreeCapacity) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| var growBy = Math.Max(sizeHint, _buffer.Length); | ||
| var newSize = checked(_buffer.Length + growBy); | ||
| Array.Resize(ref _buffer, newSize); | ||
| } | ||
| } |
This file contains hidden or 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,29 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| namespace System.Runtime.CompilerServices; | ||
|
|
||
| [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] | ||
| internal sealed class CallerArgumentExpressionAttribute : Attribute | ||
| { | ||
| public CallerArgumentExpressionAttribute(string parameterName) => ParameterName = parameterName; | ||
|
|
||
| public string ParameterName { get; } | ||
| } | ||
|
|
||
| [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] | ||
| internal sealed class CompilerFeatureRequiredAttribute : Attribute | ||
| { | ||
| public const string RefStructs = nameof(RefStructs); | ||
| public const string RequiredMembers = nameof(RequiredMembers); | ||
|
|
||
| public CompilerFeatureRequiredAttribute(string featureName) => FeatureName = featureName; | ||
|
|
||
| public string FeatureName { get; } | ||
|
|
||
| public bool IsOptional { get; set; } | ||
| } | ||
|
|
||
| [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] | ||
| internal sealed class RequiredMemberAttribute : Attribute; |
This file contains hidden or 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,70 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| namespace System.Diagnostics.CodeAnalysis; | ||
|
|
||
| [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] | ||
| internal sealed class ExperimentalAttribute : Attribute | ||
| { | ||
| public ExperimentalAttribute(string diagnosticId) => DiagnosticId = diagnosticId; | ||
|
|
||
| public string DiagnosticId { get; } | ||
|
|
||
| public string? UrlFormat { get; set; } | ||
| } | ||
|
|
||
| [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] | ||
| internal sealed class NotNullWhenAttribute : Attribute | ||
| { | ||
| public NotNullWhenAttribute(bool returnValue) => ReturnValue = returnValue; | ||
|
|
||
| public bool ReturnValue { get; } | ||
| } | ||
|
|
||
| [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] | ||
| internal sealed class SetsRequiredMembersAttribute : Attribute; | ||
|
|
||
| [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] | ||
| internal sealed class StringSyntaxAttribute : Attribute | ||
| { | ||
| public const string Uri = nameof(Uri); | ||
|
|
||
| public StringSyntaxAttribute(string syntax) | ||
| { | ||
| Syntax = syntax; | ||
| Arguments = []; | ||
| } | ||
|
|
||
| public StringSyntaxAttribute(string syntax, params object?[] arguments) | ||
| { | ||
| Syntax = syntax; | ||
| Arguments = arguments; | ||
| } | ||
|
|
||
| public string Syntax { get; } | ||
|
|
||
| public object?[] Arguments { get; } | ||
| } | ||
|
|
||
| [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] | ||
| internal sealed class UnconditionalSuppressMessageAttribute : Attribute | ||
| { | ||
| public UnconditionalSuppressMessageAttribute(string category, string checkId) | ||
| { | ||
| Category = category; | ||
| CheckId = checkId; | ||
| } | ||
|
|
||
| public string Category { get; } | ||
|
|
||
| public string CheckId { get; } | ||
|
|
||
| public string? Scope { get; set; } | ||
|
|
||
| public string? Target { get; set; } | ||
|
|
||
| public string? MessageId { get; set; } | ||
|
|
||
| public string? Justification { get; set; } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.