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

Remove assembly references that point to files within a custom nuget packages folder #61

Closed
mungojam opened this issue Mar 10, 2018 · 10 comments

Comments

@mungojam
Copy link
Collaborator

I'm going to have a look at this myself now. It might involve referencing nuget in order to apply the nuget.config location and parsing. We set our packages folder in a nuget.config file a few levels up.

@hvanbakel
Copy link
Owner

hvanbakel commented Mar 10, 2018 via email

@mungojam
Copy link
Collaborator Author

Yeah, that's true. In our case I helpfully named the folder 'Libraries' instead, but maybe I could just change that instead rather than going to lots of effort with nuget client libraries.

Or maybe it could be a command line hint that can be passed in if you know what the packages folder is

@mungojam
Copy link
Collaborator Author

@hvanbakel I've started on it, but it looks like it could be done by applying the existing RemovePackageAssemblyReferencesTransformation after the other transformations have been applied. I was a bit surprised that the transformations are applied in parallel and not serially as a pipeline as I would think that some could benefit from the existing transformations as in this case.

I can submit what I've done anyway and leave it up to you

@hvanbakel
Copy link
Owner

hvanbakel commented Mar 10, 2018 via email

@mungojam
Copy link
Collaborator Author

mungojam commented Mar 10, 2018

I'll have more of a play. I see now that AssemblyReferenceTransformation.RemoveExtraAssemblyReferences is applied after the other transformations. I expect that was just missing our packages folder because it is called Libraries.

So perhaps the only change I will make is to apply the same fix for targets. One for tomorrow or next week now though.

@hvanbakel
Copy link
Owner

Is this still an issue?

@mungojam
Copy link
Collaborator Author

I suspect there are two issues, one is that maybe targets aren't picked up and the other is the assumption on 'packages' folder. I'm going to have a go at solving the 'packages' folder one this evening.

@hvanbakel
Copy link
Owner

hvanbakel commented Mar 18, 2018 via email

@mungojam
Copy link
Collaborator Author

That's right yeah, the same as for AssemblyReferences and so the treatment should be the same for both. You want to leave open the possibility that somebody has manually added some targets from somewhere else so only to remove those that have clearly come from packages.

@mungojam mungojam changed the title Remove assembly references and targets that point to files within the nuget packages/libraries folder Remove assembly references that point to files within a custom nuget packages folder Mar 18, 2018
@mungojam
Copy link
Collaborator Author

I've restricted this issue now to just cover the custom nuget packages folder. About to submit pull request. I'll raise a separate one for targets

mungojam added a commit to mungojam/CsprojToVs2017 that referenced this issue Mar 18, 2018
…ssembly references that are catered for by PackageReference style packages

Fixes hvanbakel#61
hvanbakel pushed a commit that referenced this issue Mar 19, 2018
…ssembly references that are catered for by PackageReference style packages (#65)

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

No branches or pull requests

2 participants