Restore Nuget for Xamarin CI on Jenkins

CaptainXamtasticCaptainXamtastic GBUniversity ✭✭✭

I'm putting together a Jenkins Build Server on a Mac Mini to centralise our CI strategy, how do I restore Nuget packages?

If Jenkins was on a Windows machine it would be easy as running a Windows Batch File as follows:

nuget restore MySolution.sln

but of course this gives an error on Jenkins Mac "cannot run cmd in {path to workspace} ...".

How are people restoring Nuget packages for Xamarin when Jenkins is run on a Mac?

Kind regards,

Anthony Harrison

"Oh Shakespeare, shall I compare Xamarin to a summer's day!"

Best Answer

Answers

  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

    Use mono. So write a shell script that does mono nuget restore MySolution.sln

  • CaptainXamtasticCaptainXamtastic GBUniversity ✭✭✭
    edited February 2017

    @JimBennett said:
    Use mono. So write a shell script that does mono nuget restore MySolution.sln

    Thanks Jim, that's actually what my question comes down to, how to do that!

    How do I reference "nuget restore MySolution.sln" in a shell script, do you have that one line I need?

    • You'd think that Xamarin would have included that in their Jenkins walkthroughs as even a Xamarin.Forms 'hello world' app needs to have it's Nuget packages restored!

    vis-a-vis https://developer.xamarin.com/guides/cross-platform/ci/jenkins_walkthrough/

    Kind regards,

    Anthony

  • CaptainXamtasticCaptainXamtastic GBUniversity ✭✭✭

    Goodness Jim, if it's that simple I need my butt kicked, I'll give feedback and press the answered button after I've tried it.

    I actually did this two years ago on a project uploading .ipa files to DropBox after the build and for the life of me I can't remember what I did!

    Thanks!

Sign In or Register to comment.