Skip to content

[generator] Don't process duplicate reference assemblies. #611

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

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Mar 24, 2020

When a binding project references another binding project, the list of references assemblies can contain duplicates, particularly mscorlib:

    [0]: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\ReferenceAssemblies\\Microsoft\\Framework\\MonoAndroid\\v1.0\\mscorlib.dll"
    [1]: "C:\\code\\XamarinComponents\\Android\\BetterPickers\\source\\AndroidSwitchBackport\\bin\\Debug\\AndroidSwitchBackport.dll"
    [2]: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\ReferenceAssemblies\\Microsoft\\Framework\\MonoAndroid\\v1.0\\Java.Interop.dll"
    [3]: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\ReferenceAssemblies\\Microsoft\\Framework\\MonoAndroid\\v9.0\\Mono.Android.dll"
    [4]: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\ReferenceAssemblies\\Microsoft\\Framework\\MonoAndroid\\v1.0\\mscorlib.dll"
    [5]: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\ReferenceAssemblies\\Microsoft\\Framework\\MonoAndroid\\v1.0\\System.Core.dll"
    [6]: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\ReferenceAssemblies\\Microsoft\\Framework\\MonoAndroid\\v1.0\\System.dll"
    [7]: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\ReferenceAssemblies\\Microsoft\\Framework\\MonoAndroid\\v1.0\\Facades\\System.Runtime.dll"
    [8]: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\ReferenceAssemblies\\Microsoft\\Framework\\MonoAndroid\\v1.0\\System.Xml.dll"

There is no reason to scan any duplicate assemblies a second time, so add a Distinct() to prevent duplicates.

@jpobst jpobst requested a review from jonpryor March 24, 2020 18:06
@jonpryor jonpryor merged commit cf3e7c2 into master Mar 24, 2020
@jonpryor jonpryor deleted the be-distinct branch March 24, 2020 23:42
@brendanzagaeski
Copy link
Contributor

brendanzagaeski commented Apr 2, 2020

Draft release notes

Here is the note I'm planning to include for this pull request:

#### Bindings projects

- [Java.Interop GitHub PR 611](https://github.com/xamarin/java.interop/pull/611):
  Building a binding project that had a reference to another binding project
  would do a bit of redundant work for assemblies referenced by both projects.

To suggest something different or to recommend excluding it from the release notes, feel free to reply in this PR with the new suggestion. Thanks!

@jpobst jpobst added this to the d16-7 milestone Apr 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 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.

3 participants