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

Support --no-restore #1333

Closed
bcollamore opened this issue Nov 27, 2020 · 2 comments
Closed

Support --no-restore #1333

bcollamore opened this issue Nov 27, 2020 · 2 comments
Labels
🚀 Feature request New feature or request

Comments

@bcollamore
Copy link
Contributor

Stryker.NET always performs a 'restore'. CI/CD pipelines may have already performed this step. My specific context: I am trying to run stryker.net in a dockerized GitHub Action. Some projects' nuget.config rely on a private Nuget feed that needs credentials. We do not want to flow the [1..n] set of credentials into this GitHub Action - we want it generic. (The burden is on that repo to sort out how to do a "dotnet restore" independent of Stryker earlier in the pipeline.)

Describe the solution you'd like:
A command-line parameter --restore. default to true for backwards compatibility. Support --restore:false. The InputFileAnalyzer's ResolveInput() then constructs an EnvironmentOptions:
var environmentOptions = new EnvironmentOptions
{
Restore = options.Restore
};
and passes it to the 2 calls to AnalyzeProject via a new overload that supports an EnvironmentOptions object; that object is passed into BuildAnalyzer's existing Build(EnvironmentOptions) overload.

Additional context:
BuildAnalyzer does not appear to support Restore=false in a netcore environment. It always calls "dotnet msbuild" (rather than "dotnet build"), which always does a restore. phmonte/Buildalyzer#154 filed for this situation.

@bcollamore bcollamore added the 🚀 Feature request New feature or request label Nov 27, 2020
@rouke-broersma
Copy link
Member

Hi bcollamore.

In our experience we cannot do a successful project analysis without a manual nuget restore because buildalyzer does a clean as well. So the clean will have to be disabled as well.

@dupdob
Copy link
Member

dupdob commented Jul 6, 2024

This feature is not implemented per se, but design and workflow have changed, especially with PR #2975.

Stryker now does dotnet build first and then dotnet msbuild and ultimately an explicit restore if everything else failed.
you can also force using a specific msbuild.exe or msbuild.dll.

Hope this helps

@dupdob dupdob closed this as completed Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants