Граф коммитов

140 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 8b888f0375
[dotnet] Rename packs to contain target framework. (#19765)
This is the first step towards [multi-targeting support][1]. In order to
support multi-targeting, it must be possible to install several versions of
our packs simultaneously, and that also means that it becomes a lot easier to
visualize and work with the version we want to support if the packs were named
in a helpful way.

In particular, this PR changes the sdk, ref and runtime pack names to contain
the target framework + target platform version.

This will be the new names:

* iOS

    * Microsoft.iOS.Sdk.net8.0_17.2
    * Microsoft.iOS.Ref.net8.0_17.2
    * Microsoft.iOS.Runtime.ios-arm64.net8.0_17.2
    * Microsoft.iOS.Runtime.iossimulator-arm64.net8.0_17.2
    * Microsoft.iOS.Runtime.iossimulator-x64.net8.0_17.2

* tvOS

    * Microsoft.tvOS.Sdk.net8.0_17.2
    * Microsoft.tvOS.Ref.net8.0_17.2
    * Microsoft.tvOS.Runtime.ios-arm64.net8.0_17.2
    * Microsoft.tvOS.Runtime.iossimulator-arm64.net8.0_17.2
    * Microsoft.tvOS.Runtime.iossimulator-x64.net8.0_17.2

* Mac Catalyst

    * Microsoft.MacCatalyst.Sdk.net8.0_17.2
    * Microsoft.MacCatalyst.Ref.net8.0_17.2
    * Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net8.0_17.2
    * Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net8.0_17.2

* macOS

    * Microsoft.macOS.Sdk.net8.0_14.2
    * Microsoft.macOS.Ref.net8.0_14.2
    * Microsoft.macOS.Runtime.osx-x64.net8.0_14.2
    * Microsoft.macOS.Runtime.osx-arm64.net8.0_14.2

There are two main benefits to renaming the packs:

* It becomes a lot easier to understand which versions we support when we
  support multi-targeting. For example, say we want to support:

	* net8.0-ios17.0
	* net8.0-ios17.2
	* net9.0-ios18.0

    In this case we'd ship packs for `Microsoft.iOS.Sdk.net8.0_17.0`,
    `Microsoft.iOS.Sdk.net8.0_17.2`, `Microsoft.iOS.Sdk.net9.0_18.0` (the
    exact version number for each pack wouldn't be important).

    If we didn't change the pack names, we'd need to track the exact versions
    of the Microsoft.iOS.Sdk pack, mapping them to the correct target
    framework + target platform version we want to support.

* It'll be possible to add maestro subscriptions between versions. Given the
  previous example:

	* net8.0-ios17.0
	* net8.0-ios17.2
	* net9.0-ios18.0

	The branch producing `net9.0-ios8.0` could have a maestro subscription on
	the branches producing `net7.0-ios17.0` and `net7.0-ios17.2`,
	automatically bumping the versions whenever those branches have any
	changes.

	This would be rather annoying to keep track of and bump manually.

[1]: https://github.com/xamarin/xamarin-macios/blob/main/docs/multi-target-framework.md
2024-02-19 13:14:20 +01:00
Rolf Bjarne Kvinge ec9151c7fe
Bump api references for .NET 8 and legacy Xamarin. (#19434)
The released commit for .NET 8 isn't the exact same commit as the one
referenced here, because the build.zip file wasn't produced in that commit -
this was fixed, so it's a few commits later. There were no API changes between
these commits though, so the API references are identical.
2023-11-14 07:44:02 +01:00
Rolf Bjarne Kvinge 45225dc88d
[dotnet] Parameterize the pack names. (#18732)
We're going to change the pack names to support multi-targeting, so ahead
of the pack name change I'm changing the existing logic to use a variable
for the pack name in most places (this will make the rename much easier and
simpler).

These changes should have no effect by themselves.
2023-08-29 10:06:46 +02:00
Rolf Bjarne Kvinge 9aecc28803
Bump api-tools. (#18794)
New commits in rolfbjarne/api-tools:

* rolfbjarne/api-tools@c7d5208 Use the current .NET version to build.
* rolfbjarne/api-tools@254f0e0 [mono-api-info] Add support for comparing
function pointers.
* rolfbjarne/api-tools@ebc175f Update the .editorconfig file

Diff:
373fc1b50a..c7d5208967
2023-08-24 15:31:59 +02:00
Rolf Bjarne Kvinge 36af029204
Change all null checking expressions to use 'is' and 'is not'. (#18176)
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.

This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.

Also add code to the autoformat script to automatically fix these issues in the future.
2023-05-05 17:52:19 +02:00
Rolf Bjarne Kvinge 8c6155d617
Bump API references to the Xcode 14.1 release. (#16710) 2022-12-14 09:52:40 +01:00
Rolf Bjarne Kvinge acca13229e
[apidiff] Generate a complete and valid html file for api-diff.html. (#16805)
This fixes an issue where emojis weren't rendered as such in some browsers,
because the browser would use a different character set than utf8.
2022-11-21 10:14:53 +01:00
Rolf Bjarne Kvinge ce895603a5
[autoformat] Add the rest of tools. (#16801) 2022-11-17 17:18:34 -05:00
Rolf Bjarne Kvinge 6905e0b176
[apidiff] Fix comparison vs previous commit for .NET. (#16681)
When comparing with the previous commit, we can't use the TFM for the
stable version of .NET, since it may not be the same TFM used in the
previous commit.

Instead fetch the actual TFM from the checkout, and use that during the
api comparison.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-14 08:44:08 +01:00
Rolf Bjarne Kvinge a5a7f23494
[apidiff] Fix typo when loading AUTH_TOKEN_GITHUB_COM from a file. (#16722) 2022-11-14 08:06:12 +01:00
Rolf Bjarne Kvinge 581d6b4218 Merge remote-tracking branch 'origin/main' into main-net7.0-xcode14.1 2022-11-03 09:34:32 +01:00
Rolf Bjarne Kvinge 1171587edc
[apidiff] Change to use dl.internalx.com with a GitHub PAT for API reference downloads. (#16548)
Update the download of API references to:

* Use `dl.internalx.com` links instead of `bosstoragemirror.blob.core.windows.net`
  links (the relative path stays the same).
* Require a GitHub PAT in order to download from dl.internalx.com. This PAT
  can either be provided through a file (recommended for local use) or through
  the environment.
* Document these changes.
2022-11-03 09:07:22 +01:00
Rolf Bjarne Kvinge cdc62aeae9 Merge remote-tracking branch 'origin/net7.0-xcode14.1' into main-net7.0-xcode14.1 2022-11-03 08:21:55 +01:00
Rolf Bjarne Kvinge 13e16e864f
[apidiff] Fix when to compare Microsoft.iOS.dll vs Microsoft.MacCatalyst.dll. (#16492)
We can only compare Microsoft.iOS.dll and Microsoft.MacCatalyst.dll when all of the following are true:

* .NET is enabled.
* iOS is enabled.
* Mac Catalyst is enabled.

So adjust (and simplify a bit) our logic accordingly.
2022-10-27 17:18:48 +02:00
VS MobileTools Engineering Service 2 a24847cca2
[net7.0] [api-diff] Add api-diff.md to the all-markdowns target. (#16392)
Backport of #16380

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-10-20 08:18:26 +02:00
Rolf Bjarne Kvinge e7a8314f3a
[api-diff] Add api-diff.md to the all-markdowns target. (#16380) 2022-10-19 14:39:51 +02:00
Rolf Bjarne Kvinge a79e2f87d3 Merge main into net7.0. 2022-10-18 08:12:46 +02:00
Rolf Bjarne Kvinge 46eb7ec267
[apidiff] Don't try to update legacy refs unless legacy is enabled. (#16363) 2022-10-18 08:11:24 +02:00
Rolf Bjarne Kvinge 5975ffd6f1 Merge main into net7.0. 2022-10-17 10:21:24 +02:00
Rolf Bjarne Kvinge 2069d6e28a
[apidiff] Skip more logic when legacy Xamarin isn't enabled. (#16347) 2022-10-17 09:26:48 +02:00
Rolf Bjarne Kvinge 15e9683a53 Bump main in net7.0. 2022-09-22 07:55:18 +02:00
VS MobileTools Engineering Service 2 306a00bb42
[main] [release/6.0.4xx-xcode14] [apidiff] Don't compare to legacy platforms that aren't included in the build. Fixes #16011. (#16032)
Don't try to compare legacy vs .NET for platforms that aren't included in the build, because this happens:

> make: *** No rule to make target 'output/diff/dotnet/legacy-diff/Microsoft.macOS.Ref/ref/net6.0/Microsoft.macOS.html', needed by 'output/api-diff.html'.  Stop.

We do this by not hardcoding the list of legacy platforms, but instead starting with DOTNET_PLATFORMS variable (which won't contain platforms that aren't included in the build), and then removing any .NET-only platforms (i.e. Mac Catalyst).

Also fix the `update-refs` target to not try to update refs for platforms that aren't enabled.

Fixes https://github.com/xamarin/xamarin-macios/issues/16011.


Backport of #16029

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-09-21 14:24:13 +02:00
Rolf Bjarne Kvinge 222c0ea824
[apidiff] Fix apidiff for .NET 7. (#15736)
This involved:

* Make the mono-api-info and mono-api-diff tools run with .NET 7 (instead of
  requiring .NET 6).
* Make the code cope with the fact that we're comparing .NET 6 assemblies (in
  a net6.0 directory) with .NET 7 assemblies (in a net7.0 directory).

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-08-24 11:47:41 +02:00
Rolf Bjarne Kvinge 414c5bf99e
Improve the API diff (#15020) 2022-06-09 15:47:00 +02:00
Rolf Bjarne Kvinge a1d0b6eba9
Make our local .NET the default .NET for the build. (#15086)
Make our local .NET the default .NET (in the root's global.json), and then if
a directory wants to use the system .NET, then that directory would have to
opt-in (using its own global.json).

This way we don't have to copy global.json/NuGet.config files around to run
tests with the correct .NET setup.
2022-06-07 10:11:02 +02:00
Rolf Bjarne Kvinge 009bd4ac01
[apidiff] Simplify code a bit to use templates and iterate over the selected platforms. (#15006) 2022-05-13 20:44:15 +02:00
Rolf Bjarne Kvinge 0caa8166c3
[apidiff] Remove detection of empty diffs for cases we know that will never happen. (#15007)
There will always be an API diff between:

* legacy Xamarin.*.dll assemblies and .NET Microsoft.*.dll assemblies.
* Microsoft.iOS.dll and Microsoft.MacCatalyst.dll

so don't bother with logic to detect empty diffs, just assume they will never be empty.
2022-05-13 20:43:39 +02:00
Rolf Bjarne Kvinge adb56501da
[apidiff] Switch to getting mono-api-[info|html] from rolfbjarne/api-tools. (#14965)
Switch to getting mono-api-[info|html] from a newly created repository we
control and where we can easily fix issues, since mono/mono isn't getting many
fixes anymore. In the past I know I've been reluctant to look at these tools,
just because of the hassle of setting things up to debug, and then the
paperwork to get the fixes in mono/mono, and then backported to the branch
where we need them.

This repo has a few other benefits:

* The tools are built using normal projects, which means they're easy to debug
  in an IDE (mono/mono's code has generated project files, which used in-tree versions
  of the BCL, and it got quite complex quite fast).
* One fewer dependency on the mono archive, so we're getting closed to be able
  to drop it completely when we drop support for legacy Xamarin.
* #13669 is already fixed there.
* It contains a few other misc fixes.

Fixes https://github.com/xamarin/xamarin-macios/issues/13669.
2022-05-11 22:01:39 +02:00
Rolf Bjarne Kvinge 1be1d746d6
[apidiff] Fix comparison of assemblies with different names. (#14964)
When we compare assemblies with different names (such as Xamarin.iOS vs
Microsoft.iOS, or Microsoft.iOS vs Microsoft.MacCatalyst), we need to adjust
one the xml definitions to match the other with regards to the assembly name.
2022-05-10 14:22:30 +02:00
Rolf Bjarne Kvinge 69662c94e6
[apidiff] Ignore inherited interfaces. (#14960)
We only care about what each type does, not what any base types might have
done (nothing we can do about that anyway).
2022-05-10 09:04:20 +02:00
Rolf Bjarne Kvinge b08a0f91db
[apidiff] Use variables to reduce code duplication. (#14935)
This also makes it easier to switch to .NET 5(+) versions of mono-api-info and mono-api-html
when that happens.
2022-05-09 22:12:03 +02:00
Rolf Bjarne Kvinge 8074f20aec
[apidiff] Pass full paths to mono-api-info and mono-api-html. (#14917)
Makes it easier to copy-paste commands to debug them with an IDE.
2022-05-09 09:06:46 +02:00
Rolf Bjarne Kvinge 06e76a61e7
[apidiff] Use DOTNET_TFM instead of hardcoding 'net6.0'. (#14909) 2022-05-06 08:15:37 +02:00
TJ Lambert 188a35d879
[ApiDiffs] More renaming to enable ApiDiffs (#14187)
There was a large change to rename a lot of our Xamarin assemblies to Microsoft
ie) Xamarin.iOS -> Microsoft.iOS

There is a mismatch with some of the prerequisites in our tools/apidiff/Makefile where dependencies 
are looking for ...Microsoft.iOS... but they are still named ...Xamarin.iOS...

This PR takes any remaining "Xamarin" names and changes them to "Microsoft" for all dotnet related rules.
We will also change other dotnet rules to use the new naming convention of "macOS" and "tvOS"

The only exception is to the Xamarin.PLATFORM.dll's coming from the zip - those remain as Xamarin.iOS.dll

We should expect to see the gists showing up in ApiDiffs from this PR!

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-02-21 10:39:07 +01:00
Rolf Bjarne Kvinge e25163f573
[.NET] Rename our product assemblies. Fixes #13748. (#13847)
Rename our product assemblies to:

* Microsoft.iOS.dll
* Microsoft.tvOS.dll
* Microsoft.macOS.dll
* Microsoft.MacCatalyst.dll

This makes it easy to distinguish between legacy Xamarin and .NET whenever the
product assembly is mentioned, and I've also chosen the platform part of the
name to match how the platforms are named elsewhere (this also makes it
possible to simplify our build logic, since we can remove a lot of special
casing).

Fixes https://github.com/xamarin/xamarin-macios/issues/13748.
2022-02-16 21:30:32 +01:00
TJ Lambert b72ef031f7
[ApiDiff] Add Current PR Diffs in a similar style as API Diffs (#13512) 2021-12-14 22:19:36 -06:00
Manuel de la Pena 598261e73d
[Make] Remove targets that are not longer needed and dependencies. (#13485) 2021-12-03 11:37:01 -05:00
Rolf Bjarne Kvinge 006bb5a7a0
[apidiff] Remove logic referencing the Mac Catalyst version of Xamarin.iOS.dll. (#13476)
We don't create a Mac Catalyst version of Xamarin.iOS.dll anymore, so there's
nothing to run an api diff on.
2021-12-01 17:27:18 +01:00
Rolf Bjarne Kvinge 6ce8ac93c0 Merge remote-tracking branch 'origin/main' into src-remove-legacy-maccatalyst 2021-11-25 08:11:32 +01:00
tj_devel709 0865c816ce [ApiDiff] Remove other MacCatalyst references 2021-11-09 10:58:10 -06:00
Rolf Bjarne Kvinge ce132f781e
[api-diff] Bump to latest stable (xcode13.1 branch) + add support for different reference api urls for legacy iOS and Mac. (#13292)
* Update README with new releases.

* [api-diff] Bump to latest stable (xcode13.1 branch) + add support for different reference api urls for legacy iOS and Mac.

Also fix make logic to only have a single rule per hash, which avoids a few
make warnings about duplicate targets.
2021-11-08 16:15:58 +01:00
Rolf Bjarne Kvinge f0b72a004d
[apidiff] Fix rule to download reference assemblies. (#13174)
Make seems to ignore pattern rules without a recipe, so just add an empty
recipe for this pattern rule.

Fixes:

> make: *** No rule to make target `temp/downloads/dotnet-iOS-5315390/Microsoft.iOS.Ref/ref/net6.0/Xamarin.iOS.dll', needed by `references/dotnet/Microsoft.iOS.Ref/ref/net6.0/Xamarin.iOS.xml'.  Stop.
2021-10-29 15:51:55 +02:00
Rolf Bjarne Kvinge 8062817500 [apidiff] Remove API diff for legacy Xamarin.MacCatalyst. 2021-10-28 18:29:28 +02:00
TJ Lambert 560d777b92
[ApiDiffs] Applying the New Dotnet ApiDiffs to Github (#13027) 2021-10-22 10:25:33 -05:00
TJ Lambert 5819dc7a10
[ApiDiffs] Creating Api Diffs for the Dotnet Assemblies (#12886) 2021-10-15 12:04:35 -05:00
Manuel de la Pena 993c744347
[CI] Re-enable API and Generator diff. (#11187)
Use the jenkins script as a base to get the PAI & generator from stable
diff back to the CI. Comment is not perfect, but does provide the
required information. The comment can be improve in a later commit since
this is getting too large.
2021-04-29 17:53:06 -04:00
Sebastien Pouliot 3298f3b0b9
[apidiff] Skip _removed_ types when comparing Xamarin.iOS.dll between Catalyst and iOS assemblies (#10949)
We already have the _removed_ namespaces and listing all their types is
quite noisy which does not help reviewing changes/diff between the
assemblies.
2021-03-24 09:03:48 -04:00
Sebastien Pouliot 70c6154298
[apidiff] Compare Xamarin.iOS between iOS and MacCatalyst (#10924)
Xamarin.MacCatalyst ships a `Xamarin.iOS.dll` assembly that contains
forwarders (to `Xamarin.MacCatalyst.dll`) and stubs that throws
`PlatformNotSupportedException`.

This is used to help code compatibility between both platforms - but
that requires exposing an identical surface and the best way to ensure
this is to compare (and report) them using `apidiff`

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-03-22 15:04:30 -04:00
Sebastien Pouliot 500b3af912
[catalyst][tools] Add Xamarin.MacCatalyst to API diff (#10762)
This is now possible since our reference is now `d16-9` which has (very
early versions of) the Xamarin.MacCatalyst (and Xamarin.iOS stubs)
assemblies.

This will become more useful when
1. bots resume the generation of commit-by-commit API diff; and
2. a real baseline is defined for the catalyst API coverage

* Add the new links to the comment done by VSTS.

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-03-03 19:41:00 -05:00
Rolf Bjarne Kvinge a6b55083ab
[apidiff] Fix range expression. (#8827)
The C# range expression is somewhat confusing: the lower bound is inclusive,
but the upper bound is exclusive. This means that [0..15] is 15 characters,
not the 16 characters we want here.

Fixes this during API comparison:

    System.ArgumentException: Byte array for GUID must be exactly 16 bytes long.
    Parameter name: b
      at System.Guid..ctor (System.ReadOnlySpan`1[T] b) [0x00111] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Guid.cs:66
      at System.Guid..ctor (System.Byte[] b) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Guid.cs:45
      at Merger.Process (System.String platform, System.String path, System.String os) [0x001d1] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/apidiff/merger.cs:60
      at Merger.Main (System.String[] args) [0x00002] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/apidiff/merger.cs:94
    make[2]: *** [tvos-markdown] Error 1
2020-06-11 11:44:39 +02:00