Albacore / albacore

Albacore is a professional quality suite of Rake tasks for building .NET or Mono based systems.
www.albacorebuild.net
221 stars 64 forks source link

How to pass /restore to MSBuild 15.5+? #250

Closed logiclrd closed 4 years ago

logiclrd commented 4 years ago

The Wiki has documentation of an other_switches parameter, but this doesn't appear anywhere in the source code. Is there a proper way to pass MSBuild's new /restore command-line switch into a build?

haf commented 4 years ago

You're reading v1 docs, https://github.com/Albacore/albacore/wiki/build is the current.

logiclrd commented 4 years ago

Okay, so... this doesn't directly answer the question, but it's implying that the correct/best/only? way to pass /restore to MSBuild is to call msb.add_parameter '/restore'? In my use case, I'm not using a configuration callback in the DSL, I'm passing a hash directly into the Rake task:

Rake::Task['msbuild'].execute(:project_variables => build_toolkit_profile)

How would I get the same results as add_parameter with this? I tried setting a parameters array in the hash, it had no effect.

Would a PR that makes it so that the MSBuild task recognizes a specific :restore entry in the hash be welcomed?

logiclrd commented 4 years ago

Hmm, I don't see :msbuild in the Albacore code, maybe that's an intermediate thing in an internal Gem here. Investigating...

haf commented 4 years ago

No, the msbuild task went away in v2

haf commented 4 years ago

it's just called build now.

logiclrd commented 4 years ago

We must have made our own then because this codebase is targeting Albacore 2.8.0.

haf commented 4 years ago

ok, so let's clarify:

logiclrd commented 4 years ago

Okay, yes, that makes sense. I found the definition of it, and I see a way to make calls into the configuration object, so I think we're all good. :-)

haf commented 4 years ago

https://github.com/Albacore/albacore/blob/master/spec/build_spec.rb#L6-L29 are the specs for it; you can either call it like the test does or you can use the DSL

haf commented 4 years ago

it's designed to be extensible and not lock you in, by layering abstractions on top of a data model

logiclrd commented 4 years ago

Thanks :-) I updated the v1 Wiki page to call out the fact that it applies to v1 only, with a link to the "build" task documentation you gave.