Skip to content

Commit

Permalink
NuGet protobuf-net <dependencies> version number is now automagically…
Browse files Browse the repository at this point in the history
… populated from packages.config.
  • Loading branch information
rdingwall committed Jan 11, 2012
1 parent 21187ad commit 32bdfc2
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14,972 deletions.
18 changes: 17 additions & 1 deletion build/ProtoBuf.Data.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<Import Project="..\lib\MSBuild.Community.Tasks.v1.2.0.306\MSBuild.Community.Tasks.Targets"/>
<UsingTask AssemblyFile="..\lib\NuGet.MSBuild.1.5.20831.132\NuGet.MSBuild.dll" TaskName="NuGet.MSBuild.NuGet" />

<!-- Create our NuGet package. Uses the assembly version (from
SolutionInfo.cs) as the package version and reads the protobuf-net version
from packages.config to update the NuGet <dependencies> list. (Automated
because I always forgot to do this manually). -->
<Target Name="CreateNupkg">
<RemoveDir Directories="$(OutputDir)" />

Expand Down Expand Up @@ -41,13 +45,25 @@
<GetAssemblyIdentity AssemblyFiles="$(OutputDir)\lib\net20\protobuf-net-data.dll">
<Output TaskParameter="Assemblies" ItemName="AssemblyInfo"/>
</GetAssemblyIdentity>

<!-- When updating a package, NuGet seems to leave old versions there. So
read the last one (XPath doesn't have a max() function unfortunately) and
use that for the <dependencies> list. -->
<XmlRead XPath="//package[@id='protobuf-net' and position()=last()]/@version"
XmlFileName="..\src\ProtoBuf.Data\packages.config">
<Output TaskParameter="Value" PropertyName="ProtobufNetDependencyVersion" />
</XmlRead>

<Copy SourceFiles="$(NuspecFile)" DestinationFolder="$(OutputDir)" />

<XmlUpdate XmlFileName="$(OutputDir)\$(NuspecFile)"
Xpath="//version"
Value="%(AssemblyInfo.Version)" />


<XmlUpdate XmlFileName="$(OutputDir)\$(NuspecFile)"
Xpath="//dependency[@id='protobuf-net']/@version"
Value="$(ProtobufNetDependencyVersion)" />

<NuGet BaseDir="$(OutputDir)"
PackageDir="$(OutputDir)"
SpecFile="$(OutputDir)\$(NuspecFile)" />
Expand Down
2 changes: 1 addition & 1 deletion build/protobuf-net-data.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<language>en-US</language>
<tags>binary serialization protocol buffers protobuf deserialization ADO.NET ado data database</tags>
<dependencies>
<dependency id="protobuf-net" version="2.0.0.470" />
<dependency id="protobuf-net" version="0.0.0.0" />
</dependencies>
</metadata>
</package>
2,480 changes: 0 additions & 2,480 deletions packages/protobuf-net.2.0.0.470/lib/net20/protobuf-net.xml

This file was deleted.

2,601 changes: 0 additions & 2,601 deletions packages/protobuf-net.2.0.0.470/lib/net30/protobuf-net.xml

This file was deleted.

2,601 changes: 0 additions & 2,601 deletions packages/protobuf-net.2.0.0.470/lib/net35/protobuf-net.xml

This file was deleted.

2,601 changes: 0 additions & 2,601 deletions packages/protobuf-net.2.0.0.470/lib/net40/protobuf-net.xml

This file was deleted.

2,323 changes: 0 additions & 2,323 deletions packages/protobuf-net.2.0.0.470/lib/sl3-wp/protobuf-net.XML

This file was deleted.

2,364 changes: 0 additions & 2,364 deletions packages/protobuf-net.2.0.0.470/lib/sl4/protobuf-net.xml

This file was deleted.

0 comments on commit 32bdfc2

Please sign in to comment.