Permalink
Browse files

Add scripts for creating NuGet packages.

* Sign clrzmq and clrzmq-ext assemblies
* Set default version to 0.0.0.0 to indicate Development
  • Loading branch information...
1 parent d75823a commit f9790ac32b1bd2e1a779359cc96e3336e1ebf5b6 John Gozde committed Dec 16, 2011
Showing with 140 additions and 22 deletions.
  1. +2 −0 .gitignore
  2. +21 −6 build.proj
  3. +2 −0 clrzmq.sln
  4. +25 −0 nuget/clrzmq-x64.nuspec
  5. +25 −0 nuget/clrzmq.nuspec
  6. +11 −0 nuget/install.ps1
  7. +38 −0 package.cmd
  8. +4 −15 src/VersionInfo.cs
  9. +4 −0 src/clrzmq-ext/clrzmq-ext.csproj
  10. +8 −1 src/clrzmq/clrzmq.csproj
View
@@ -4,8 +4,10 @@ bin
!/bin
/build
/packages
+/publish
nuget.exe
lib/**/libzmq.dll
+*.snk
*.pidb
*.suo
_ReSharper.*
View
@@ -3,17 +3,18 @@
<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)' == ''">src</SolutionDir>
<LibDir Condition="'$(LibDir)' == ''">lib</LibDir>
- <BuildOutput>build</BuildOutput>
+ <BuildDir>build</BuildDir>
+ <PackageDir>publish</PackageDir>
<Platform Condition="'$(Platform)' == ''">x86</Platform>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<OSConfiguration Condition="'$(OSConfiguration)' == ''">WIN_RELEASE</OSConfiguration>
- <BuildVersion Condition="'$(BuildVersion)' == ''">0.0.0.0</BuildVersion>
<MSpecOptions Condition="'$(MSpecOptions)' == ''"></MSpecOptions>
+ <KeyFileProperty Condition="'$(SignAssembly)' == 'true'">KeyOriginatorFile=src\clrzmq.snk</KeyFileProperty>
</PropertyGroup>
<Target Name="Clean">
<ItemGroup>
- <CleanFiles Include="$(BuildOutput)" />
+ <CleanFiles Include="$(BuildDir)" />
<CleanFiles Include="$(SolutionDir)\**\bin\$(Configuration)\**" />
<CleanFiles Include="$(SolutionDir)\**\bin\$(Platform)\$(OSConfiguration)\**" />
<CleanFiles Include="$(SolutionDir)\**\bin\*.*" />
@@ -26,11 +27,11 @@
</Target>
<Target Name="Initialize" DependsOnTargets="Clean">
- <MakeDir Directories="$(BuildOutput)" />
+ <MakeDir Directories="$(BuildDir)" />
</Target>
<Target Name="Compile" DependsOnTargets="Initialize">
- <MSBuild Projects="clrzmq.sln" Targets="Build" ToolsVersion="3.5" Properties="Configuration=$(OSConfiguration);Platform=$(Platform)" />
+ <MSBuild Projects="clrzmq.sln" Targets="Build" ToolsVersion="3.5" Properties="Configuration=$(OSConfiguration);Platform=$(Platform);$(KeyFileProperty)" />
</Target>
<Target Name="Test" DependsOnTargets="Compile">
@@ -49,11 +50,25 @@
<Target Name="Build" DependsOnTargets="Test">
<ItemGroup>
<OutputFiles Include="$(SolutionDir)\**\bin\$(Platform)\$(OSConfiguration)\*.dll" />
+ <OutputFiles Include="$(SolutionDir)\**\bin\$(Platform)\$(OSConfiguration)\*.pdb" />
+ <OutputFiles Include="$(SolutionDir)\**\bin\$(Platform)\$(OSConfiguration)\*.xml" />
<OutputFiles Include="$(SolutionDir)\**\bin\$(Configuration)\*.dll" />
+ <OutputFiles Include="$(SolutionDir)\**\bin\$(Configuration)\*.pdb" />
+ <OutputFiles Include="$(SolutionDir)\**\bin\$(Configuration)\*.xml" />
<OutputFiles Include="$(LibDir)\$(Platform)\*.dll" />
</ItemGroup>
- <Copy SourceFiles="@(OutputFiles)" DestinationFolder="$(BuildOutput)" ContinueOnError="true" />
+ <Copy SourceFiles="@(OutputFiles)" DestinationFolder="$(BuildDir)" ContinueOnError="true" />
+ </Target>
+
+ <Target Name="Package" DependsOnTargets="Build">
+ <ItemGroup>
+ <BuildOutput Include="$(BuildDir)\*.*" />
+ </ItemGroup>
+
+ <RemoveDir Directories="$(PackageDir)\$(Platform)" />
+ <MakeDir Directories="$(PackageDir)\$(Platform)" />
+ <Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(PackageDir)\$(Platform)" ContinueOnError="false" />
</Target>
</Project>
View
@@ -10,7 +10,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{1C71420E-3
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "settings", "settings", "{F931F059-9877-4554-85E6-771DFECDFE00}"
ProjectSection(SolutionItems) = preProject
+ nuget\clrzmq-x64.nuspec = nuget\clrzmq-x64.nuspec
clrzmq.5.1.ReSharper = clrzmq.5.1.ReSharper
+ nuget\clrzmq.nuspec = nuget\clrzmq.nuspec
Settings.StyleCop = Settings.StyleCop
EndProjectSection
EndProject
View
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>clrzmq-x64</id>
+ <version>0.0.0</version>
+ <authors>zeromq</authors>
+ <owners>John Gozde</owners>
+ <projectUrl>http://www.zeromq.org/bindings:clr</projectUrl>
+ <licenseUrl>http://www.zeromq.org/area:licensing</licenseUrl>
+ <iconUrl>http://gravatar.com/avatar/810f6c181bb9cf3dea392892bac793f0?s=32</iconUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <summary>Official .NET bindings for ZeroMQ (x64)</summary>
+ <description>The clrzmq project contains .NET bindings for ØMQ (ZeroMQ), an open source, high performance transport layer. Includes a compiled version of the native libzmq library. WARNING: This package targets the x64 build platform.</description>
+ <language>en-US</language>
+ <tags>zeromq zmq 0mq messaging transport distributed</tags>
+ </metadata>
+ <files>
+ <file src="publish\x64\clrzmq*.dll" target="lib\net20" />
+ <file src="publish\x64\*.pdb" target="lib\net20" />
+ <file src="publish\x64\*.xml" target="lib\net20" />
+ <file src="lib\x64\*.dll" target="content" />
+ <file src="nuget\install.ps1" target="tools" />
+ <file src="LICENSE"/>
+ </files>
+</package>
View
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>clrzmq</id>
+ <version>0.0.0</version>
+ <authors>zeromq</authors>
+ <owners>John Gozde</owners>
+ <projectUrl>http://www.zeromq.org/bindings:clr</projectUrl>
+ <licenseUrl>http://www.zeromq.org/area:licensing</licenseUrl>
+ <iconUrl>http://gravatar.com/avatar/810f6c181bb9cf3dea392892bac793f0?s=32</iconUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <summary>Official .NET bindings for ZeroMQ (x86)</summary>
+ <description>The clrzmq project contains .NET bindings for ØMQ (ZeroMQ), an open source, high performance transport layer. Includes a compiled version of the native libzmq library. WARNING: This package targets the x86 build platform.</description>
+ <language>en-US</language>
+ <tags>zeromq zmq 0mq messaging transport distributed</tags>
+ </metadata>
+ <files>
+ <file src="publish\x86\clrzmq*.dll" target="lib\net20" />
+ <file src="publish\x86\*.pdb" target="lib\net20" />
+ <file src="publish\x86\*.xml" target="lib\net20" />
+ <file src="lib\x86\*.dll" target="content" />
+ <file src="nuget\install.ps1" target="tools" />
+ <file src="LICENSE"/>
+ </files>
+</package>
View
@@ -0,0 +1,11 @@
+param($installPath, $toolsPath, $package, $project)
+
+# $project = Get-Project
+
+$libzmq = $project.ProjectItems.Item("libzmq.dll")
+
+# set Build Action to None
+$libzmq.Properties.Item("BuildAction").Value = 0
+
+# set Copy to Output Directy to Copy if newer
+$libzmq.Properties.Item("CopyToOutputDirectory").Value = 2
View
@@ -0,0 +1,38 @@
+@echo off
+setlocal
+
+set MSBUILD_EXE=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\msbuild
+set DEPS_DIR=packages
+set NUGET_EXE=nuget\nuget.exe
+set NUSPEC_X86=nuget\clrzmq.nuspec
+set NUSPEC_X64=nuget\clrzmq-x64.nuspec
+set VERSION_INFO_CS=src\VersionInfo.cs
+
+:version
+set /p VERSION=Enter version (e.g. 1.0):
+set /p BUILD=Enter a build (e.g. 11234):
+set /p REVISION=Enter a revision (e.g. 7):
+set /p MATURITY=Enter maturity (e.g. Alpha, Beta, RC, Release, etc.):
+
+:: Shared version info
+move %VERSION_INFO_CS% %VERSION_INFO_CS%.bak
+echo using System.Reflection; > %VERSION_INFO_CS%
+echo. >> %VERSION_INFO_CS%
+echo [assembly: AssemblyVersion("%VERSION%.0.0")] >> %VERSION_INFO_CS%
+echo [assembly: AssemblyFileVersion("%VERSION%.%BUILD%.%REVISION%")] >> %VERSION_INFO_CS%
+echo [assembly: AssemblyInformationalVersion("%VERSION%.%BUILD%.%REVISION% %MATURITY%")] >> %VERSION_INFO_CS%
+echo [assembly: AssemblyConfiguration("%MATURITY%")] >> %VERSION_INFO_CS%
+
+if not exist %DEPS_DIR% call nuget.cmd
+
+%MSBUILD_EXE% build.proj /target:Package /Property:Platform=x86 /Property:Configuration=Release /Property:OSConfiguration=WIN_RELEASE /Property:SignAssembly=true
+%MSBUILD_EXE% build.proj /target:Package /Property:Platform=x64 /Property:Configuration=Release /Property:OSConfiguration=WIN_RELEASE /Property:SignAssembly=true
+
+%NUGET_EXE% Pack %NUSPEC_X86% -Version %VERSION%.%REVISION% -OutputDirectory publish -BasePath .
+%NUGET_EXE% Pack %NUSPEC_X64% -Version %VERSION%.%REVISION% -OutputDirectory publish -BasePath .
+
+:: Clean up
+move %VERSION_INFO_CS%.bak %VERSION_INFO_CS%
+
+endlocal
+if errorlevel 1 pause else exit
View
@@ -1,17 +1,6 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.239
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System.Reflection;
-[assembly: AssemblyVersion("2.1.1.0")]
-[assembly: AssemblyFileVersion("2.1.0.0")]
-[assembly: AssemblyConfiguration("Release")]
-
-
+[assembly: AssemblyVersion("0.0.0.0")]
+[assembly: AssemblyFileVersion("0.0.0.0")]
+[assembly: AssemblyInformationalVersion("0.0.0.0 Development")]
+[assembly: AssemblyConfiguration("Development")]
@@ -41,6 +41,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+ <DocumentationFile>bin\Release\clrzmq-ext.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
@@ -55,6 +56,8 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+ <DocumentationFile>
+ </DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\Release\</OutputPath>
@@ -69,6 +72,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+ <DocumentationFile>bin\Release\clrzmq-ext.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
View
@@ -50,6 +50,7 @@
<DebugType>none</DebugType>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <DocumentationFile>bin\x64\POSIX_RELEASE\clrzmq.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'POSIX_RELEASE|x86'">
<OutputPath>bin\x86\POSIX_RELEASE\</OutputPath>
@@ -58,6 +59,7 @@
<DebugType>none</DebugType>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <DocumentationFile>bin\x86\POSIX_RELEASE\clrzmq.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'WIN_DEBUG|x64' ">
<DebugSymbols>true</DebugSymbols>
@@ -79,6 +81,7 @@
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <DocumentationFile>bin\x64\WIN_RELEASE\clrzmq.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'WIN_DEBUG|x86' ">
<DebugSymbols>true</DebugSymbols>
@@ -103,6 +106,10 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <DocumentationFile>bin\x86\WIN_RELEASE\clrzmq.xml</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -136,4 +143,4 @@
<ItemGroup>
<None Include="linux.config" />
</ItemGroup>
-</Project>
+</Project>

0 comments on commit f9790ac

Please sign in to comment.