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

How to -executeMethod NugetForUnity.NugetHelper.Restore on different path than project path #460

Closed
darrenge opened this issue Jul 20, 2022 · 3 comments

Comments

@darrenge
Copy link

darrenge commented Jul 20, 2022

There is a thread on the Game-CI about this too: game-ci/unity-builder#276 so I know others are seeing issues too.

I am on Windows 11; Unity 2020.3.25f1;

I am trying to do a restore of Nuget packages and it doesn't look like things are working.

$proc = Start-Process -FilePath "$editor" -ArgumentList "-projectPath $($projectPath) -logFile $($logFile.FullName) -batchMode -quit -wait -buildOutput $outDir -logDirectory $logDirectory -buildWindows64Player ./PerspectiveView.exe -executeMethod NugetForUnity.NugetHelper.Restore" -PassThru

After running this Start-Process, I still get errors that it is missing projects like the nuget was not restore. If I run Nuget.exe restore from $ProjectPath\Assets it works fine, so I know the Nuget restore works. Also, if I run Nuget.exe after this batchBuild call, the nuget packages are restored proving that the NugetHelper.Restore is not working.

@darrenge
Copy link
Author

My NugetForUnity version is 3.0.5 and there isn't a new update so it is the latest and greatest.

@JoC0de
Copy link
Collaborator

JoC0de commented Dec 26, 2022

The way Unity is working (when opening from command line):

  1. runs the C# Compiler and compile the project Scripts (this fails on your side)
  2. runs the -executeMethod specified
    so you need to add a second call of the unity-editor with -ignoreCompilerErrors that performs the nuget restore before performing the build see Restoring in CI pipeline #414 (comment)

@JoC0de
Copy link
Collaborator

JoC0de commented Feb 19, 2023

I finally released the CLI for restoring packages before starting Unity Editor NuGetForUnity.Cli.

@JoC0de JoC0de closed this as completed Feb 19, 2023
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