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

Document some examples in binding project template #8411

Closed
jonathanpeppers opened this issue Oct 10, 2023 · 4 comments · Fixed by #8535
Closed

Document some examples in binding project template #8411

jonathanpeppers opened this issue Oct 10, 2023 · 4 comments · Fixed by #8535
Assignees
Labels
Area: Bindings Issues in Java Library Binding projects. enhancement Proposed change to current functionality.
Milestone

Comments

@jonathanpeppers
Copy link
Member

Android application type

.NET Android (net7.0-android, etc.)

Affected platform version

.NET 8

Description

I'm thinking the .csproj should give a couple examples of Bind="false", etc. in comments. Similar to how we have a few comments in Metadata.xml.

We should also have an aka.ms link to a documentation page about bindings.

This came up here: dotnet/maui#17826 (comment)

Steps to Reproduce

  1. dotnet new androidbinding-lib
  2. Become confused by binding projects

Did you find any workaround?

No response

Relevant log output

No response

@jonathanpeppers jonathanpeppers added enhancement Proposed change to current functionality. Area: Bindings Issues in Java Library Binding projects. labels Oct 10, 2023
@jonathanpeppers jonathanpeppers added this to the .NET 9 Planning milestone Oct 10, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issues that need to be assigned. label Oct 10, 2023
@jonathanpeppers jonathanpeppers changed the title Document some examples Document some examples in binding project template Oct 10, 2023
@jonathanpeppers jonathanpeppers removed the needs-triage Issues that need to be assigned. label Oct 10, 2023
@ymebrugts
Copy link

ymebrugts commented Nov 24, 2023

I agree that a Bind="false" example would help because it's not clear based on the documentation that the equivalent of Xamarin's "EmbeddedReferenceJar" is AndroidLibrary with Bind="false".

I feel it would also be beneficial to add a table on the migration page that shows the equivalent Build Action for MAUI binding when migrating from Xamarin to MAUI:
https://learn.microsoft.com/en-us/dotnet/maui/migration/android-binding-projects

jonathanpeppers added a commit to dotnet/docs-maui that referenced this issue Nov 27, 2023
Context: https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/OneDotNetEmbeddedResources.md
Context: dotnet/android#8411

I had some feedback from customers that it would be helpful to include a table of the old item group names and what to do going forward.
@jonathanpeppers
Copy link
Member Author

Thanks, I updated that docs page here: dotnet/docs-maui#1916

jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this issue Nov 27, 2023
Fixes: dotnet#8411
Context: dotnet/docs-maui#1916

We have a nice docs page that should eliminate some confusion if we
linked to it with a comment in the project template.

I considered putting a commented out example of disabling the C# binding
(ala `EmbeddedReferenceJar`):

    <ItemGroup>
      <AndroidLibrary Update="foo.jar" Bind="false">
    </ItemGroup

But I think this case is rare, and the docs page should be sufficient.
davidbritch added a commit to dotnet/docs-maui that referenced this issue Nov 29, 2023
* [android] migration table for confusing item group names

Context: https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/OneDotNetEmbeddedResources.md
Context: dotnet/android#8411

I had some feedback from customers that it would be helpful to include a table of the old item group names and what to do going forward.

* Minor edits.

---------

Co-authored-by: David Britch <davidbritch@users.noreply.github.com>
jonpryor pushed a commit that referenced this issue Nov 29, 2023
…8535)

Fixes: #8411

Context: dotnet/docs-maui#1916

We have a nice docs page that should eliminate some confusion if we
linked to it with a comment in the project template.

I considered putting a commented out example of disabling the C# binding
(a'la `@(EmbeddedReferenceJar)`):

	<ItemGroup>
	  <AndroidLibrary Update="foo.jar" Bind="false">
	</ItemGroup

But I think this case is rare, and the docs page should be sufficient.
@taublast
Copy link

taublast commented Dec 3, 2023

@jonathanpeppers i am still struggling to have an aar to be included in the app project that references the bindings project containing an aar simulating the old EmbeddedReferenceJar:

    <AndroidLibrary Update="External\android-sdk-2.8.0.aar" Bind="False"/>

then when the bindings project is referenced by app project at runtime the aar is not found.
In the docs https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/OneDotNetBindingProjects.md it states that the referencing project would have the jar/aar near the imported dll, but it doesn't look to behave like that in case of a Bind="False".

So as a workaound im actually including a copy inside the app

    <AndroidLibrary Include="External\android-sdk-2.8.0.aar">
      <Bind>False</Bind>
    </AndroidLibrary>	  

but that looks too bad as the aar is already present in the bindings project an the app project doesn't need to know about the aars used inside.

Am i doing something wrong or?..

@jonathanpeppers
Copy link
Member Author

Can you file an issue with a .binlog? https://aka.ms/binlog

It reminds me of an issue in .NET 7 that should be fixed in .NET 8.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: Bindings Issues in Java Library Binding projects. enhancement Proposed change to current functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants