-
Notifications
You must be signed in to change notification settings - Fork 303
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
Restoring in CI pipeline #414
Comments
We've had good luck with a two pass build method. Start up Unity once, lets N4U restore things, shut down. Then run again and do a real build and check for errors there. We've had lots of trouble getting Unity to work well in Windows containers, would be cool to hear if you're successful on Linux. |
Here's what I've found. If I run the command locally in a checkout where the library has been built once it works, even just by doing |
I ended up using regular nuget with a cleanup step. A bit more clunky but it got the job done. |
That's interesting. If you're using the package you should have a dll for NugetForUnity and so the restore should happen even if there are build errors. Perhaps that's not true in newer versions of Unity, e.g. the ones with 'safe mode'? This behavior, where it continues to initialize assemblies even if other code fails to compile is a big reason we build the rather than shipping as code (this was before assembly defs existed of course). |
Try adding the
Updated with correct commands (based on comment below) |
Oh, there's an undocumented flag? I have it running through manual nuget now but I'll try that next week if I can remember. |
Just wanted to mention that it's |
I also needed to add If you are using Game CI, this becomes the following in e.g. # Install NuGet packages through NuGetForUnity.
${UNITY_EXECUTABLE:-xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' unity-editor} \
-batchmode \
-quit \
-ignoreCompilerErrors \
-projectPath $UNITY_DIR \
-executeMethod NugetForUnity.NugetHelper.Restore The only downside is that this makes the already slow pipeline even slower, from about 10 minutes to 15 minutes 😕 . We need NuGet packages, and NuGetForUnity works great, but together with #407 this is making the process of using them pretty painful - which, admittedly, is not entirely NuGetForUnity's fault. Now I can finally get to fixing my tests, thanks for the help! 😄 |
I finally released the CLI for restoring packages before starting Unity Editor NuGetForUnity.Cli. |
Description
I'm trying to implement a build pipeline for a project which uses NuGetForUnity and Docker. As an initial step I want to install dependencies, following the command from the readme:
However, this seems to try to build my project which fails due to missing dependencies. Nothing in the logs shows that NuGetForUnity is invoked. Is there something I'm missing?
The text was updated successfully, but these errors were encountered: