Procházet zdrojové kódy

Added nuspec for full/lite versions and NuGet publishing commands

csharptest před 14 roky
rodič
revize
5062b28342

+ 66 - 0
build/Google.ProtocolBuffers.nuspec

@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nuspec.xsd">
+  <metadata>
+    <id>Google.ProtocolBuffers</id>
+    <version>$version$</version>
+    <owners>Jon Skeet</owners>
+    <authors>Jon Skeet, Roger Knapp</authors>
+    <licenseUrl>http://code.google.com/p/protobuf-csharp-port/source/browse/license.txt</licenseUrl>
+    <projectUrl>http://code.google.com/p/protobuf-csharp-port/</projectUrl>
+    <requireLicenseAcceptance>false</requireLicenseAcceptance>
+    <copyright>Copyright 2008 Google Inc.  All rights reserved.</copyright>
+    <tags>Protocol Buffers Binary Serialization Format Google</tags>
+
+    <title>Google Protocol Buffers</title>
+    <summary>A managed code generator and library for Google's data interchange format.</summary>
+    <description><![CDATA[
+Protocol Buffers is a binary serialization format and technology, released to the open source community by Google in 2008.  
+Its primary use is to produce small fast binary representations of a 'message' or object for serialization or transportation.
+There are various implementations of Protocol Buffers in .NET. This project is a fairly close port of the Google Java implementation.
+
+There are two main parts:
+
+tools/protoc.exe, which takes the textual representation of the protocol buffer and turns it into a binary representation for use with ProtoGen.exe.
+tools/ProtoGen.exe, which takes binary representations of protocol buffer descriptors (as generated by the "stock" protoc binary supplied by Google) and creates C# source code. This is only required at build time.
+
+lib/*/Google.ProtocolBuffers.dll, which is a supporting library. This is required at execution time.
+lib/*/Google.ProtocolBuffers.Serialization.dll, a supplementary library that provides extensions for reading and writing protocol buffers to xml, json, and others.
+
+LINKS:
+
+Project Home    - http://code.google.com/p/protobuf-csharp-port
+Online Help     - http://help.protobuffers.net
+Developer Guide - http://code.google.com/apis/protocolbuffers/docs/overview.html
+Language Guide  - http://code.google.com/apis/protocolbuffers/docs/proto.html
+
+    ]]></description>
+	
+    <references>
+      <reference file="Google.ProtocolBuffers.dll"/>
+      <reference file="Google.ProtocolBuffers.Serialization.dll"/>
+    </references>
+  
+  </metadata>
+  <files>
+    <!-- Release Binaries -->
+    <file src="..\build_output\Package\Release\Google.ProtocolBuffers.???" target="lib\net20" />
+    <file src="..\build_output\Package\Release\Google.ProtocolBuffers.Serialization.???" target="lib\net20" />
+    <!-- Silverlight Binaries -->
+    <file src="..\build_output\Package\Release_Silverlight2\Google.ProtocolBuffers.???" target="lib\sl20" />
+    <file src="..\build_output\Package\Release_Silverlight2\Google.ProtocolBuffers.Serialization.???" target="lib\sl20" />
+    <!-- Tools -->
+    <file src="..\lib\Protoc.exe" target="tools" />
+    <file src="..\build_output\Package\Release\Google.ProtocolBuffers.dll" target="tools" />
+    <file src="..\build_output\Package\Release\ProtoGen.exe" target="tools" />
+    <file src="..\build_output\Package\Release\ProtoGen.exe.config" target="tools" />
+    <!-- Content -->
+    <file src="..\CHANGES.txt" target="content"/>
+    <file src="..\license.txt" target="content\licenses"/>
+    <file src="..\lib\protoc-license.txt" target="content\licenses"/>
+    <file src="..\protos\google\protobuf\descriptor.proto" target="content\protos\google\protobuf" />
+    <file src="..\protos\google\protobuf\csharp_options.proto" target="content\protos\google\protobuf" />
+	
+    <file src="..\src\ProtocolBuffers\**\*.cs" target="src\ProtocolBuffers\"/>
+    <file src="..\src\ProtocolBuffers.Serialization\**\*.cs" target="src\ProtocolBuffers.Serialization\"/>
+  </files>
+</package>

+ 66 - 0
build/Google.ProtocolBuffersLite.nuspec

@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nuspec.xsd">
+  <metadata>
+    <id>Google.ProtocolBuffersLite</id>
+    <version>$version$</version>
+    <owners>Jon Skeet</owners>
+    <authors>Jon Skeet, Roger Knapp</authors>
+    <licenseUrl>http://code.google.com/p/protobuf-csharp-port/source/browse/license.txt</licenseUrl>
+    <projectUrl>http://code.google.com/p/protobuf-csharp-port/</projectUrl>
+    <requireLicenseAcceptance>false</requireLicenseAcceptance>
+    <copyright>Copyright 2008 Google Inc.  All rights reserved.</copyright>
+    <tags>Protocol Buffers Binary Serialization Format Google</tags>
+
+    <title>Google Protocol Buffers</title>
+    <summary>A managed code generator and library for Google's data interchange format.</summary>
+    <description><![CDATA[
+Protocol Buffers is a binary serialization format and technology, released to the open source community by Google in 2008.  
+Its primary use is to produce small fast binary representations of a 'message' or object for serialization or transportation.
+There are various implementations of Protocol Buffers in .NET. This project is a fairly close port of the Google Java implementation.
+
+There are two main parts:
+
+tools/protoc.exe, which takes the textual representation of the protocol buffer and turns it into a binary representation for use with ProtoGen.exe.
+tools/ProtoGen.exe, which takes binary representations of protocol buffer descriptors (as generated by the "stock" protoc binary supplied by Google) and creates C# source code. This is only required at build time.
+
+lib/*/Google.ProtocolBuffersLite.dll, which is a supporting library. This is required at execution time.
+lib/*/Google.ProtocolBuffersLite.Serialization.dll, a supplementary library that provides extensions for reading and writing protocol buffers to xml, json, and others.
+
+LINKS:
+
+Project Home    - http://code.google.com/p/protobuf-csharp-port
+Online Help     - http://help.protobuffers.net
+Developer Guide - http://code.google.com/apis/protocolbuffers/docs/overview.html
+Language Guide  - http://code.google.com/apis/protocolbuffers/docs/proto.html
+
+    ]]></description>
+	
+    <references>
+      <reference file="Google.ProtocolBuffersLite.dll"/>
+      <reference file="Google.ProtocolBuffersLite.Serialization.dll"/>
+    </references>
+  
+  </metadata>
+  <files>
+    <!-- Release Binaries -->
+    <file src="..\build_output\Package\Release\Google.ProtocolBuffersLite.???" target="lib\net20" />
+    <file src="..\build_output\Package\Release\Google.ProtocolBuffersLite.Serialization.???" target="lib\net20" />
+    <!-- Silverlight Binaries -->
+    <file src="..\build_output\Package\Release_Silverlight2\Google.ProtocolBuffersLite.???" target="lib\sl20" />
+    <file src="..\build_output\Package\Release_Silverlight2\Google.ProtocolBuffersLite.Serialization.???" target="lib\sl20" />
+    <!-- Tools -->
+    <file src="..\lib\Protoc.exe" target="tools" />
+    <file src="..\build_output\Package\Release\Google.ProtocolBuffers.dll" target="tools" />
+    <file src="..\build_output\Package\Release\ProtoGen.exe" target="tools" />
+    <file src="..\build_output\Package\Release\ProtoGen.exe.config" target="tools" />
+    <!-- Content -->
+    <file src="..\CHANGES.txt" target="content"/>
+    <file src="..\license.txt" target="content\licenses"/>
+    <file src="..\lib\protoc-license.txt" target="content\licenses"/>
+    <file src="..\protos\google\protobuf\descriptor.proto" target="content\protos\google\protobuf" />
+    <file src="..\protos\google\protobuf\csharp_options.proto" target="content\protos\google\protobuf" />
+	
+    <file src="..\src\ProtocolBuffers\**\*.cs" target="src\ProtocolBuffers\"/>
+    <file src="..\src\ProtocolBuffers.Serialization\**\*.cs" target="src\ProtocolBuffers.Serialization\"/>
+  </files>
+</package>

+ 44 - 18
build/PublishRelease.bat

@@ -1,15 +1,17 @@
 REM @ECHO OFF
+@PUSHD %~dp0
 @IF "%1" == "version" @GOTO VERSION
 @IF "%1" == "build" @GOTO BUILD
 @IF "%1" == "fpush" @GOTO FILEPUSH
+@IF "%1" == "nupush" @GOTO NUGETPUSH
 @IF "%1" == "push" @GOTO PUSH
 @GOTO HELP
 
 :VERSION
-IF NOT EXIST "%~dp0\..\build_temp\" MD "%~dp0\..\build_temp\"
-hg log -l 1 --template "Revision: {rev}" > %~dp0\..\build_temp\revision.txt
-CMD.exe /Q /C "CD %~dp0\.. && lib\StampVersion.exe /major:2 /minor:3 /build:0 /revision:build_temp\revision.txt"
-@TYPE src\ProtocolBuffers\Properties\AssemblyInfo.cs | FIND "AssemblyFileVersion"
+IF NOT EXIST "..\build_temp\" MD "..\build_temp\"
+hg log -l 1 --template "Revision: {rev}" > ..\build_temp\revision.txt
+CMD.exe /Q /C "CD .. && lib\StampVersion.exe /major:2 /minor:4 /build:1 /revision:build_temp\revision.txt"
+@TYPE ..\src\ProtocolBuffers\Properties\AssemblyInfo.cs | FIND "AssemblyFileVersion"
 @ECHO.
 @ECHO NEXT: Use the above version number to run "%0 build {Version}"
 @ECHO.
@@ -19,18 +21,20 @@ CMD.exe /Q /C "CD %~dp0\.. && lib\StampVersion.exe /major:2 /minor:3 /build:0 /r
 @IF "%2" == "" @GOTO HELP
 IF EXIST "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\sn.exe" SET WIN7SDK_DIR=C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\
 
-IF NOT EXIST "%~dp0\..\release-key" hg clone https://bitbucket.org/rknapp/protobuf-csharp-port-keyfile %~dp0\..\release-key
-SET PROTOBUF_KEY_FILE="/p:AssemblyOriginatorKeyFile=%~dp0\..\release-key\Google.ProtocolBuffers.snk"
+IF NOT EXIST "..\release-key" hg clone https://bitbucket.org/rknapp/protobuf-csharp-port-keyfile ..\release-key
+SET PROTOBUF_KEY_FILE="/p:AssemblyOriginatorKeyFile=%~dp0..\release-key\Google.ProtocolBuffers.snk"
 
-MD "%~dp0\%2"
-CMD.exe /Q /C "CD %~dp0 && GenerateCompletePackage.bat"
-COPY /y %~dp0\..\build_output\AllBinariesAndSource.zip %~dp0\%2\protobuf-csharp-port-%2-full-binaries.zip
-CMD.exe /Q /C "CD %~dp0 && GenerateReleasePackage.bat"
-COPY /y %~dp0\..\build_output\ReleaseBinaries.zip %~dp0\%2\protobuf-csharp-port-%2-release-binaries.zip
-hg archive  %~dp0\%2\protobuf-csharp-port-%2-source.zip
+MD "%2"
+CMD.exe /Q /C "GenerateCompletePackage.bat"
+COPY /y ..\build_output\AllBinariesAndSource.zip %2\protobuf-csharp-port-%2-full-binaries.zip
+CMD.exe /Q /C "GenerateReleasePackage.bat"
+COPY /y ..\build_output\ReleaseBinaries.zip %2\protobuf-csharp-port-%2-release-binaries.zip
+..\lib\NuGet.exe pack Google.ProtocolBuffers.nuspec -Symbols -Version %2 -NoPackageAnalysis -OutputDirectory %2
+..\lib\NuGet.exe pack Google.ProtocolBuffersLite.nuspec -Symbols -Version %2 -NoPackageAnalysis -OutputDirectory %2
+hg archive %2\protobuf-csharp-port-%2-source.zip
 
 SET PROTOBUF_KEY_FILE=
-"%WIN7SDK_DIR%sn.exe" -T build_output\Package\Release\Google.ProtocolBuffers.dll
+"%WIN7SDK_DIR%sn.exe" -T ..\build_output\Package\Release\Google.ProtocolBuffers.dll
 @ECHO.
 @ECHO ***********************************************************
 @ECHO IMPORTANT: Verify the above key output is: 55f7125234beb589
@@ -48,15 +52,34 @@ SET PROTOBUF_KEY_FILE=
 hg commit -m "version %2"
 hg tag %2
 hg push
+@ECHO.
+@ECHO NEXT: Verify the repository state and run "%0 fpush %2 {google-code-user} {google-code-password}"
+@ECHO.
+@GOTO EXIT
 
 :FILEPUSH
-SET GOOGLEUPLOAD=python.exe %~dp0\googlecode_upload.py --project protobuf-csharp-port --user "%3" --password "%4"
+SET GOOGLEUPLOAD=python.exe googlecode_upload.py --project protobuf-csharp-port --user "%3" --password "%4"
 
-%GOOGLEUPLOAD% --labels Type-Source,Featured --summary "Version %2 source" %~dp0\%2\protobuf-csharp-port-%2-source.zip
-%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries (all configurations)" %~dp0\%2\protobuf-csharp-port-%2-full-binaries.zip
-%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries (release only)" %~dp0\%2\protobuf-csharp-port-%2-release-binaries.zip
+%GOOGLEUPLOAD% --labels Type-Source,Featured --summary "Version %2 source" %2\protobuf-csharp-port-%2-source.zip
+%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries (all configurations)" %2\protobuf-csharp-port-%2-full-binaries.zip
+%GOOGLEUPLOAD% --labels Type-Executable,Featured --summary "Version %2 binaries (release only)" %2\protobuf-csharp-port-%2-release-binaries.zip
 
 @SET GOOGLEUPLOAD=
+@ECHO.
+@ECHO NEXT: Verify the uploads and run "%0 nupush %2"
+@ECHO.
+@GOTO EXIT
+
+:NUGETPUSH
+
+..\lib\NuGet.exe push "%2\Google.ProtocolBuffers.%2.nupkg"
+..\lib\NuGet.exe push "%2\Google.ProtocolBuffersLite.%2.nupkg"
+..\lib\NuGet.exe push "%2\Google.ProtocolBuffers.%2.symbols.nupkg"
+..\lib\NuGet.exe push "%2\Google.ProtocolBuffersLite.%2.symbols.nupkg"
+
+@ECHO.
+@ECHO NEXT: Verify the nuget packages at http://nuget.org
+@ECHO.
 @GOTO EXIT
 
 :HELP
@@ -65,7 +88,10 @@ SET GOOGLEUPLOAD=python.exe %~dp0\googlecode_upload.py --project protobuf-csharp
 @ECHO 1. %0 version
 @ECHO 2. %0 build {version from step 1}
 @ECHO 3. %0 push {version from step 1} {google-code-user} {google-code-password}
+@ECHO 4. %0 fpush {version from step 1} {google-code-user} {google-code-password}
+@ECHO 5. %0 nupush {version from step 1}
 @ECHO.
 @GOTO EXIT
 
-:EXIT
+:EXIT
+@POPD