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

Changing <Bind> item metadata does not rerun appropriate parts of the build #9184

Open
Digifais opened this issue Aug 9, 2024 · 6 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects.

Comments

@Digifais
Copy link

Digifais commented Aug 9, 2024

Android framework version

net8.0-android

Affected platform version

.NET 8.0.303

Description

When changing item metadata from true to false or vice versa, dotnet build doesn't pick the change up, I need to perform a dotnet clean first before dotnet build works again.

msbuild.binlog.zip

Steps to Reproduce

  1. Create a new Android binding library
  2. Add an AAR to the project and select AndroidLibrary as build action (should add a blank <Bind></Bind>)
  3. Set <Bind> to false.
  4. Build the project through the .NET CLI
  5. Set <Bind> to true
  6. Build the project through the .NET CLI again and see that it produces the same result of not binding the AAR

Did you find any workaround?

Perform dotnet clean first after changing from true to false or vice versa.

Relevant log output

No response

@Digifais Digifais added the needs-triage Issues that need to be assigned. label Aug 9, 2024
@Digifais Digifais changed the title Blank or no <Bind> item metadata seems to not bind the provided AAR through .NET CLI Blank or no <Bind> item metadata seems to not bind the provided AAR when building through .NET CLI Aug 9, 2024
@Digifais Digifais changed the title Blank or no <Bind> item metadata seems to not bind the provided AAR when building through .NET CLI Blank <Bind> item metadata seems to not bind the provided AAR when building through .NET CLI Aug 9, 2024
@jonathanpeppers
Copy link
Member

We were looking at MSBuild's logic, and putting blank <Bind></Bind> really does clear it. It would invalidate the <ItemDefinitionGroup> here:

<AndroidLibrary>
<Bind>true</Bind>
<Pack>true</Pack>
</AndroidLibrary>

@Digifais
Copy link
Author

Digifais commented Aug 9, 2024

@jonathanpeppers So this is really a non-issue and might just be a VS4Mac bug that it adds a blank <Bind></Bind>?

@jonathanpeppers
Copy link
Member

@Digifais yes, it looks like it might be that way.

If you see it not taking the change <Bind>true</Bind> vs <Bind>false</Bind> we could look into that.

@Digifais
Copy link
Author

Digifais commented Aug 9, 2024

@jonathanpeppers As mentioned in the Discord, I indeed need to perform a dotnet clean first when changing the value.

@jonathanpeppers jonathanpeppers changed the title Blank <Bind> item metadata seems to not bind the provided AAR when building through .NET CLI Changing <Bind> item metadata does not rerun appropriate parts of the build Aug 9, 2024
@jonathanpeppers jonathanpeppers added the Area: App+Library Build Issues when building Library projects or Application projects. label Aug 9, 2024
@jonathanpeppers jonathanpeppers added this to the Under Consideration milestone Aug 9, 2024
@jonathanpeppers jonathanpeppers removed the needs-triage Issues that need to be assigned. label Aug 9, 2024
@jonathanpeppers
Copy link
Member

I renamed the title, thanks.

@Digifais
Copy link
Author

Digifais commented Aug 9, 2024

Updated the issue description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

No branches or pull requests

4 participants