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

[nuget_model] Add support for Nuget (NuSpec) dependency groups #85

Open Aaronontheweb opened 10 years ago

Aaronontheweb commented 10 years ago

I'm considering contributing this myself, but I may not have the time to do it.

I would like to add NuGet 2.0's new dependency syntax to Albacore, which includes support for dependency groups.

The new syntax for specifying dependencies looks like this:

<dependencies> 
   <group>
      <dependency id="RouteMagic" version="1.1.0" />
   </group>

   <group targetFramework="net40">
      <dependency id="jQuery" />
      <dependency id="WebActivator" />
   </group>

   <group targetFramework="sl30">
   </group>
</dependencies>

The really powerful difference between this spec type and what the current implementation does is the ability to specify dependencies for specific .NET framework versions.

If I need to use the System.Threading NuGet package targeting .NET 3.5 but not for any other supported NuGet target, this will allow me to do it.

Looking at the code under the clean_slate branch, it looks like nuget_model.rb and its associated tests will need to be updated.

I believe we can also accomplish these changes without breaking compatibility with existing Albacore instances that use the nuspec feature.

Here's my suggestion - currently the calls to adding a new nuspec dependency look like this:

nuspec.dependency {Package Name}, {Package Version}

I'm going to propose that we add a third optional attribute, for Target Framework at the end:

nuspec.dependency {Package Name}, {Package Version}, {Target Framework}

If no Target Framework is specified, the nuspec dependency will simply be put under the default group.

Aaronontheweb commented 10 years ago

Ah, looks like the clean_slate branch isn't ready for this yet. If I do this I'll send the PR to master

haf commented 10 years ago

In what sense is not clean_slate ready for it?

Aaronontheweb commented 10 years ago

@haf It looked like none of the other task implementations were there, so I assumed you were still working on the guts of it

haf commented 10 years ago

Ah, no, there won't be any more task implementations; most of the things in old master is wrapping a command, and that we should rather provide good facilities to do -- instead of re-wrapping the parameters in ruby. Also, by taking a larger view of the process of building a project, the task types that ARE there are now more capable.

clean_slate is rc2, so it's done. I'm waiting for bug reports; at new year we're publishing 2.0.

Aaronontheweb commented 10 years ago

@haf so the new version of Albacore won't provide built-in tasks for NuGet, NUnit, MSBuild, etc... ?

haf commented 10 years ago

yes, it does everything the previous version did with nugets, with less code with nuget_model and all the nugets_XX task types. NUnit works with test_runner very well, I've tried it. MsBuild as well as xbuild is supported with build. Are you missing anything? In that case, I do want to know!