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

Support probing path #557

Merged
merged 11 commits into from
Sep 30, 2018
Merged

Support probing path #557

merged 11 commits into from
Sep 30, 2018

Conversation

tom-englert
Copy link
Member

This is the initial version supporting the WeaverProbingPaths idea discussed on gitter.

It is done with minimal changes to the existing code and fully backward compatible.
It currently improves selecting the correct weaver if the weaver provides the .props file and so adds itself to the WeaverProbingPaths poperty.
When there are enough weavers supporting this, I will start optimizing the code, to look at the probing paths first and omit the other search paths if all weavers have been located.

It can be tested with https://www.nuget.org/packages/JetBrainsAnnotations.Fody/, versions 2.3 and 2.4 have added support for this.

@SimonCropp
Copy link
Member

can the approach u used in JetBrainsAnnotations.Fody be pushed to other weavers via FodyPackaging https://github.com/Fody/Fody/tree/master/FodyPackaging


var candidates = FodyFiles.Where(x => string.Equals(Path.GetFileName(x), packageFileName, StringComparison.OrdinalIgnoreCase))
.OrderBy(ProbingPathScore)
.ThenByDescending(VersionReader);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than re parsing the version on every package lookup. shouldnt this be parsed and stored once?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was like this before, so I assumed this will be called only once per weaver.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just step 1: make it work
I'm still working on optimizing this.

@tom-englert
Copy link
Member Author

Yes, I already thought about extending FodyPackaging, just had no time to look at it yet...

@tom-englert
Copy link
Member Author

tom-englert commented Sep 27, 2018

FodyPackaging does now automatically add the .props file.
All you need to do is publish this version, and update the Fody package in all weavers.

@tom-englert
Copy link
Member Author

OK, I think that's it.

@SimonCropp SimonCropp merged commit afdb51d into Fody:master Sep 30, 2018
@tom-englert
Copy link
Member Author

tom-englert commented Sep 30, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants