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

RE: override property for the msbuildversion. #56

Closed
JamesPoli opened this issue Nov 6, 2017 · 11 comments
Closed

RE: override property for the msbuildversion. #56

JamesPoli opened this issue Nov 6, 2017 · 11 comments

Comments

@JamesPoli
Copy link
Contributor

Hello,
We need an override property for the msbuildversion on the Nuget pack and restore. Any possibility of getting it added?
Thanks,
Jim

@gluck
Copy link
Contributor

gluck commented Nov 7, 2017

Hi James,
What do you mean by that ?
NugetPack doesn't make use or rely on Msbuild (but if gradle-msbuild plugin is applied and used, it gets its default values from the gradle-msbuild setup)

Thx

@JamesPoli
Copy link
Contributor Author

JamesPoli commented Nov 7, 2017 via email

@gluck
Copy link
Contributor

gluck commented Nov 8, 2017

Your proposal sounds about right, we could add the MSBuildVersion param (to all nuget tasks or only some of them ?), and add a default mapping to the one used by gradle-msbuild.

Interested in picking up the task ? I myself have never had the need for this param, and the only related link I found doesn't make it clear what value this parameter takes.

Thx.

@JamesPoli
Copy link
Contributor Author

JamesPoli commented Nov 9, 2017

Sure, I'll try to implement the task; that way I can test it. I'll review the command's again but I believe only the pack and restore support the msbuildversion. Ah, I found that update also supports the option.
Regards, Jim

@JamesPoli
Copy link
Contributor Author

Francois,
I've started work on this effort. FWIW, to test, I made several changes to the NuGetRestore task for a new msBuildVersion property. But, alas, defaulting the msBuildVersion to the MsBuild's version property doesn't appear to be working.? In the task graph, the NuGetRestore task is running before the MsBuild task, thus the msBuildVersion property is always null. Perhaps, my idea wasn't so great after all? Possibly, I need some special Gradle magic to get this working? Anyway, since my plugin simply wraps your Nuget and MsBuild tasks, I was able to set the NuGetRestore msBuildVersion property in a private task beforehand, thus getting the behavior I needed. I'll finish NuGetPack. Since you don't have a NuGetUpdate task I won't worry about that. I'll continue to code and test, then push and do a pull request. Let me know if that sounds alright.
Regards, Jim

@gluck
Copy link
Contributor

gluck commented Nov 15, 2017

The task graph shouldn't matter, if version was set on msbuild task, you can use it right away.

Note that if it wasn't set explicitely in the gradle build, then it'll resolve to the latest when executing the msbuild task, in that case you can't get the version used, but you shouldn't need to (if msbuild is set to using the latest, nuget should do the same, meaning the version shouldn't be set explicitly).

Feel free to push your changes as a PR even if not finished yet, we can discuss on that.

@JamesPoli
Copy link
Contributor Author

JamesPoli commented Nov 15, 2017

Looking closer at our code, we set the version at runtime prior to the msbuild task running which matches your explanation, thanks. I'll go ahead and add back in the code that uses the msbuild version if it's set. I've got some more testing to do, then I'll push. How do you want me to push? In a separate branch or in a fork?

@JamesPoli
Copy link
Contributor Author

Sorry, Francois, it's taking a while, the code is complete; I'm just waiting for legal approval from SAS to commit it. Should be approved this week. Jim

@JamesPoli
Copy link
Contributor Author

Ok Francois, created PR. Jim

@JamesPoli
Copy link
Contributor Author

What's the process to get this released?

@ngyukman
Copy link
Contributor

released in 2.16

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

No branches or pull requests

3 participants