Permalink
Browse files

Add prerelease support to package script.

Script also includes libzmq-version.txt, which contains the version of
libzmq packaged with the assembly.
  • Loading branch information...
1 parent f53e4e9 commit add2f4493d857b75fa76d93205c9301357fcb230 @jgoz jgoz committed Feb 8, 2012
Showing with 32 additions and 9 deletions.
  1. +1 −1 Makefile
  2. +17 −3 package.cmd
  3. +1 −0 src/.nuget/clrzmq.nuspec
  4. +13 −5 src/build.proj
View
2 Makefile
@@ -1,5 +1,5 @@
PROJ = src/build.proj
-FLAGS = /property:OperatingPlatform=Unix
+FLAGS = /property:OperatingPlatform=Unix /property:NetFramework=Mono
XBUILD = xbuild /tv:4.0
VERSION =
View
20 package.cmd
@@ -5,12 +5,21 @@ set MSBUILD_EXE=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\msbuild
set NUGET_EXE=src\.nuget\nuget.exe
set NUSPEC=src\.nuget\clrzmq.nuspec
set VERSION_INFO_CS=src\Shared\VersionInfo.cs
+set LIBZMQVER_TXT=src\libzmq-version.txt
: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.):
+set /p MATURITY=Enter maturity (e.g. alpha1, rc1, or blank for Release):
+set /p LIBZMQVER=Enter libzmq version (e.g. 3.1.1, 21571cf):
+
+if not defined MATURITY (
+ set MATURITY=Release
+ set PRERELEASE=
+) else (
+ set PRERELEASE=-%MATURITY%
+)
:: Shared version info
move %VERSION_INFO_CS% %VERSION_INFO_CS%.bak
@@ -21,12 +30,17 @@ echo [assembly: AssemblyFileVersion("%VERSION%.%BUILD%.%REVISION%")] >> %VERSION
echo [assembly: AssemblyInformationalVersion("%VERSION%.%BUILD%.%REVISION% %MATURITY%")] >> %VERSION_INFO_CS%
echo [assembly: AssemblyConfiguration("%MATURITY%")] >> %VERSION_INFO_CS%
+:: libzmq version info
+echo %LIBZMQVER% > %LIBZMQVER_TXT%
+
%MSBUILD_EXE% src\build.proj /target:Package /Property:Configuration=Release /Property:SignAssembly=true
-%NUGET_EXE% Pack %NUSPEC% -Version %VERSION%.%REVISION% -OutputDirectory publish -BasePath .
+%NUGET_EXE% Pack %NUSPEC% -Version %VERSION%.%REVISION%%PRERELEASE% -OutputDirectory publish -BasePath .
+copy LICENSE publish
:: Clean up
move %VERSION_INFO_CS%.bak %VERSION_INFO_CS%
+del %LIBZMQVER_TXT%
endlocal
-if errorlevel 1 pause else exit
+if %ERRORLEVEL% GTR 0 pause else exit
View
1 src/.nuget/clrzmq.nuspec
@@ -18,6 +18,7 @@
<file src="publish\clrzmq*.dll" target="lib\net40" />
<file src="publish\*.pdb" target="lib\net40" />
<file src="publish\*.xml" target="lib\net40" />
+ <file src="src\libzmq-version.txt"/>
<file src="LICENSE"/>
</files>
</package>
View
18 src/build.proj
@@ -9,8 +9,10 @@
<Platform Condition="'$(Platform)' == ''">x86</Platform>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<MSpecOptions Condition="'$(MSpecOptions)' == ''"></MSpecOptions>
- <KeyFileProperty Condition="'$(SignAssembly)' == 'true'">KeyOriginatorFile=Shared\clrzmq.snk</KeyFileProperty>
+ <KeyFile>Shared\clrzmq.snk</KeyFile>
+ <KeyFileProperty Condition="'$(SignAssembly)' == 'true'">KeyOriginatorFile=$(KeyFile)</KeyFileProperty>
<OperatingPlatform Condition="'$(OperatingPlatform)' == ''">Windows</OperatingPlatform>
+ <NetFramework Condition="'$(NetFramework)' == ''">NET</NetFramework>
<SolutionSuffix Condition="'$(OperatingPlatform)' == 'Unix'">.Mono</SolutionSuffix>
</PropertyGroup>
@@ -22,7 +24,7 @@
<Optimize Condition="'$(Configuration)' != 'Debug'">true</Optimize>
<Constants Condition="'$(OperatingPlatform)' == 'Windows'"></Constants>
- <Constants Condition="'$(OperatingPlatform)' == 'Unix'">UNIX</Constants>
+ <Constants Condition="'$(OperatingPlatform)' == 'Unix'">UNIX;MONO</Constants>
</PropertyGroup>
<ItemGroup>
@@ -46,10 +48,9 @@
</ItemGroup>
<ItemGroup>
- <BuildOutput Include="$(BuildDir)\*.*" />
-
<ZeroMQSources Include="ZeroMQ\**\*.cs;Shared\*.cs" Exclude="ZeroMQ\**\Platform.*.cs" />
<ZeroMQSources Include="ZeroMQ\**\Platform.$(OperatingPlatform).cs" />
+ <ZeroMQSources Include="ZeroMQ\**\Platform.$(NetFramework).cs" />
<Resources Include="$(LibDir)\x64\libzmq.dll">
<Platform>x64</Platform>
@@ -90,6 +91,9 @@
</Target>
<Target Name="Package">
+ <RemoveDir Directories="$(BuildDir)" />
+ <MakeDir Directories="$(BuildDir)" />
+
<Csc Sources="@(ZeroMQSources)"
DocumentationFile="$(BuildDir)\clrzmq.xml"
OutputAssembly="$(BuildDir)\clrzmq.dll"
@@ -98,10 +102,14 @@
DebugType="$(DebugType)"
PdbFile="$(BuildDir)\clrzmq.pdb"
Optimize="$(Optimize)"
- KeyFile="Shared\clrzmq.snk"
+ KeyFile="$(KeyFile)"
DefineConstants="$(Constants)"
/>
+ <ItemGroup>
+ <BuildOutput Include="$(BuildDir)\*.*;$(SolutionDir)\*.txt" />
+ </ItemGroup>
+
<RemoveDir Directories="$(PackageDir)" />
<MakeDir Directories="$(PackageDir)" />
<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(PackageDir)" ContinueOnError="false" />

0 comments on commit add2f44

Please sign in to comment.