-
Notifications
You must be signed in to change notification settings - Fork 533
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
[Xamarin.Android.Build.Tasks] Remove MAM targets from CoreResolve #7868
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context: f6f11a5 We're working with the InTune team to make use of our member remapping support (f6f11a5), and they hit a bit of a snag: > I'm having some issues integrating it into the Xamarin build. > We need our process to run after `_CompileJava` so we can analyze > the inheritance of the app's classes. Now, we also need our process > to run before `_CollectAndroidRemapMembers` so that the XML > generated in that process can be consumed properly. Unfortunately, > this generates a circular dependency: > > error MSB4006: There is a circular dependency in the target dependency graph > involving target "_CollectAndroidRemapMembers". > Since "_ResolveLibraryProjectImports" has "DependsOn" dependence on > "_CollectAndroidRemapMembers", the circular is > "_CollectAndroidRemapMembers<-_ResolveLibraryProjectImports<-_ExtractLibraryProjectImports<-_GetLibraryImports<-_CompileJava<-…<-_CollectAndroidRemapMembers". Commit f6f11a5 updated `$(CoreResolveReferencesDependsOn)` to add the `_ConvertAndroidMamMappingFileToXml` and `_CollectAndroidRemapMembers` targets, but @jonpryor does not remember *why* these targets needed to be added to `$(CoreResolveReferencesDependsOn)` in the first place. Update `$(CoreResolveReferencesDependsOn)` to remove the `_ConvertAndroidMamMappingFileToXml` and `_CollectAndroidRemapMembers` targets. This will hopefully remove the circular dependency.
Commit 78ef0ea didn't work; various unit tests failed with: error XAGJRNC7023: System.IO.DirectoryNotFoundException: Could not find a part of the path '…/tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/xa-internal/xa-remap-members.xml'. Meaning explicitly mentioning the `_ConvertAndroidMamMappingFileToXml` and `_CollectAndroidRemapMembers` targets was important! A (slightly!) more in depth investigation suggests that the only target that depends on the outputs of these targets is the `_GenerateAndroidRemapNativeCode` target. On the hope that this is in fact the case, add a new `$(_GenerateAndroidRemapNativeCodeDependsOn)` MSbuild property which is the target dependencies of the `_GenerateAndroidRemapNativeCode` target, and add `_ConvertAndroidMamMappingFileToXml` and `_CollectAndroidRemapMembers` to `$(_GenerateAndroidRemapNativeCodeDependsOn)`. This *should* ensure that the targets are executed *as late as possible*.
dellis1972
approved these changes
Mar 10, 2023
jonathanpeppers
approved these changes
Mar 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jonpryor
added a commit
that referenced
this pull request
Mar 10, 2023
) Context: f6f11a5 We're working with the InTune team to make use of our member remapping support (f6f11a5), and they hit a bit of a snag: > I'm having some issues integrating it into the Xamarin build. > We need our process to run after `_CompileJava` so we can analyze > the inheritance of the app's classes. Now, we also need our process > to run before `_CollectAndroidRemapMembers` so that the XML > generated in that process can be consumed properly. Unfortunately, > this generates a circular dependency: > > error MSB4006: There is a circular dependency in the target dependency graph > involving target "_CollectAndroidRemapMembers". > Since "_ResolveLibraryProjectImports" has "DependsOn" dependence on > "_CollectAndroidRemapMembers", the circular is > "_CollectAndroidRemapMembers<-_ResolveLibraryProjectImports<-_ExtractLibraryProjectImports<-_GetLibraryImports<-_CompileJava<-…<-_CollectAndroidRemapMembers". Commit f6f11a5 updated `$(CoreResolveReferencesDependsOn)` to add the `_ConvertAndroidMamMappingFileToXml` and `_CollectAndroidRemapMembers` targets, but @jonpryor does not remember *why* these targets needed to be added to `$(CoreResolveReferencesDependsOn)` in the first place. Update `$(CoreResolveReferencesDependsOn)` to remove the `_ConvertAndroidMamMappingFileToXml` and `_CollectAndroidRemapMembers` targets, and move those targets to the new `$(_GenerateAndroidRemapNativeCodeDependsOn)` MSBuild property, which is the `DependsOnTargets` list for the target `_GenerateAndroidRemapNativeCode`. This delays execution of the `_ConvertAndroidMamMappingFileToXml` and `_CollectAndroidRemapMembers` targets as late as possible, which should resolve the circular deps.
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Mar 13, 2023
* main: [tests] `InstallAndroidDependenciesTest` uses `platform-tools` 34.0.1 (dotnet#7873) [ci] Parallelize and reduce overhead of MSBuild test stage. (dotnet#7850) [Xamarin.Android.Build.Tasks] Remove MAM targets from CoreResolve (dotnet#7868)
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Mar 13, 2023
* main: [tests] `InstallAndroidDependenciesTest` uses `platform-tools` 34.0.1 (dotnet#7873) [ci] Parallelize and reduce overhead of MSBuild test stage. (dotnet#7850) [Xamarin.Android.Build.Tasks] Remove MAM targets from CoreResolve (dotnet#7868)
grendello
added a commit
to grendello/xamarin-android
that referenced
this pull request
Mar 13, 2023
* main: [tests] `InstallAndroidDependenciesTest` uses `platform-tools` 34.0.1 (dotnet#7873) [ci] Parallelize and reduce overhead of MSBuild test stage. (dotnet#7850) [Xamarin.Android.Build.Tasks] Remove MAM targets from CoreResolve (dotnet#7868)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: f6f11a5
We're working with the InTune team to make use of our member remapping support (f6f11a5), and they hit a bit of a snag:
Commit f6f11a5 updated
$(CoreResolveReferencesDependsOn)
to add the_ConvertAndroidMamMappingFileToXml
and_CollectAndroidRemapMembers
targets, but @jonpryor does not remember why these targets needed to be added to$(CoreResolveReferencesDependsOn)
in the first place.Update
$(CoreResolveReferencesDependsOn)
to remove the_ConvertAndroidMamMappingFileToXml
and_CollectAndroidRemapMembers
targets. This will hopefully remove the circular dependency.