Skip to content

Commit c256626

Browse files
authored
Local and Copilot dev can generate public apis (#30500)
* Local and Copilot dev can generate public apis Currently, the only way is to use the IDE and the lightbulb - or manually. This is often not successful and AI still struggles as well. The new version of the Mono.ApiTools.MSBuildTasks package now has the ability to generate the files and they can be checked in during development to show the actual API changes. The rules would be if this is release of CI, then it is set to Validate only, and then only if it is debug AND not CI (ie: local) will it enable generation.
1 parent 792e5b3 commit c256626

13 files changed

Lines changed: 51 additions & 7 deletions

File tree

eng/NuGetVersions.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@
263263
Update="Microsoft.CodeAnalysis.PublicApiAnalyzers"
264264
Version="$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)"
265265
/>
266+
<PackageReference
267+
Update="Mono.ApiTools.MSBuildTasks"
268+
Version="$(MonoApiToolsMSBuildTasksPackageVersion)"
269+
/>
266270
<PackageReference
267271
Update="Tizen.UIExtensions.NUI"
268272
Version="$(TizenUIExtensionsVersion)"

eng/Versions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
<SystemRuntimeCompilerServicesUnsafePackageVersion>6.0.0</SystemRuntimeCompilerServicesUnsafePackageVersion>
109109
<MicrosoftBuildFrameworkPackageVersion>17.9.5</MicrosoftBuildFrameworkPackageVersion>
110110
<MicrosoftBuildUtilitiesCorePackageVersion>17.9.5</MicrosoftBuildUtilitiesCorePackageVersion>
111+
<MonoApiToolsMSBuildTasksPackageVersion>0.4.0</MonoApiToolsMSBuildTasksPackageVersion>
111112
<!-- GLIDE - the android maven artifact in /src/Core/AndroidNative/maui/build.gradle -->
112113
<!-- must be kept in sync with the binding library version to it here: -->
113114
<_XamarinAndroidGlideVersion>4.16.0.12</_XamarinAndroidGlideVersion>

src/Controls/src/Core/Element/Element.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,7 @@ public bool EffectIsAttached(string name)
504504

505505
//this is only used by XAMLC, not added to public API
506506
[EditorBrowsable(EditorBrowsableState.Never)]
507-
#pragma warning disable RS0016 // Add public types and members to the declared API
508507
public INameScope transientNamescope;
509-
#pragma warning restore RS0016 // Add public types and members to the declared API
510508

511509
/// <summary>Returns the element that has the specified name.</summary>
512510
/// <param name="name">The name of the element to be found.</param>

src/Controls/src/Core/Layout/FlexLayout.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,7 @@ void InitItemProperties(IView view, Flex.Item item)
464464
// Until we can rewrite the FlexLayout engine to handle measurement properly (without the "in measure mode" hacks)
465465
// we need to replace the default implementation of CrossPlatformMeasure.
466466
// And we need to disable the public API analyzer briefly, because it doesn't understand hiding.
467-
#pragma warning disable RS0016 // Add public types and members to the declared API
468467
new public Graphics.Size CrossPlatformMeasure(double widthConstraint, double heightConstraint)
469-
#pragma warning restore RS0016 // Add public types and members to the declared API
470468
{
471469
var layoutManager = _layoutManager ??= CreateLayoutManager();
472470

src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#nullable enable
2+
~Microsoft.Maui.Controls.Element.transientNamescope -> Microsoft.Maui.Controls.Internals.INameScope
3+
Microsoft.Maui.Controls.FlexLayout.CrossPlatformMeasure(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
24
override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void
35
override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void
46
override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void

src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#nullable enable
2+
~Microsoft.Maui.Controls.Element.transientNamescope -> Microsoft.Maui.Controls.Internals.INameScope
3+
Microsoft.Maui.Controls.FlexLayout.CrossPlatformMeasure(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
24
override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void
35
override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void
46
override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void

src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#nullable enable
2+
~Microsoft.Maui.Controls.Element.transientNamescope -> Microsoft.Maui.Controls.Internals.INameScope
3+
Microsoft.Maui.Controls.FlexLayout.CrossPlatformMeasure(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
24
override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void
35
override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void
46
override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void

src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#nullable enable
2+
~Microsoft.Maui.Controls.Element.transientNamescope -> Microsoft.Maui.Controls.Internals.INameScope
3+
Microsoft.Maui.Controls.FlexLayout.CrossPlatformMeasure(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
24
override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void
35
override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void
46
override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void

src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#nullable enable
2+
~Microsoft.Maui.Controls.Element.transientNamescope -> Microsoft.Maui.Controls.Internals.INameScope
3+
Microsoft.Maui.Controls.FlexLayout.CrossPlatformMeasure(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
24
override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void
35
override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void
46
override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void

src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#nullable enable
2+
~Microsoft.Maui.Controls.Element.transientNamescope -> Microsoft.Maui.Controls.Internals.INameScope
3+
Microsoft.Maui.Controls.FlexLayout.CrossPlatformMeasure(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
24
override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void
35
override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void
46
override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void

0 commit comments

Comments
 (0)