Skip to content

Latest commit

 

History

History
64 lines (40 loc) · 2.72 KB

UPDATING.md

File metadata and controls

64 lines (40 loc) · 2.72 KB

How-To Update Bindings When gtfs-realtime.proto Changes

Regenerate the language binding source from gtfs-realtime.proto

Regeneration using an online tool

  1. Open https://protogen.marcgravell.com/ online code generator which is from protobuf-net.
  2. Paste the latest contents of the gtfs-realtime.proto file.
  3. Generate C# code using default options.
  4. Paste the generated code right after the license header in the GtfsRealtime.cs file.
  5. Update version number and release notes in Visual Studio project properties.

Legacy way using offline protogen.exe

One-Time Setup

  1. You'll need a file protogen.exe, which is from protobuf-net. You can download the protogen.exe file from protogen.marcgravell.com (for example, https://protogen.marcgravell.com/protogen/protogen%202.3.16.zip). When you extract the zip the exe will be in the net462 folder.
  2. Add the path to net462 folder containing protogen.exe to your Windows Path (it must be executed from a directory that contains the other .dll files).

Every time gtfs-realtime.proto changes

  1. From the root folder, run:

    protogen.exe gtfs-realtime.proto --csharp_out=dotnet/GtfsRealtimeBindings/
    cd dotnet/GtfsRealtimeBindings/
    del GtfsRealtime.cs
    rename gtfs-realtime.cs GtfsRealtime.cs 
    git add -- GtfsRealtime.cs
    
  2. Add the license header back to the generated source file.

  3. Update version number and release notes in Visual Studio project properties.

Publishing a new release

One-Time Setup

  1. Download and install Visual Studio - the free "Community" version is fine.

  2. Download and install NuGet CLI.

  3. Create an API key and configure NuGet using your authorized account for gtfs-realtime-bindings as discussed here.

Every release

  1. Start the "Developer Command Prompt for VS 2022" in the root project directory.

  2. Rebuild the solution for Release:

    msbuild dotnet\GtfsRealtimeBindings.sln /p:Configuration=Release

  3. Run the unit test to make sure you didn't break anything:

    vstest.console dotnet\GtfsRealtimeBindingsTest\bin\Release\GtfsRealtimeBindingsTest.dll

  4. Set API key, build and deploy the package to NuGet.

nuget setApiKey xxxxxxx
nuget pack GtfsRealtimeBindings/GtfsRealtimeBindings.csproj -Prop Configuration=Release
nuget push GtfsRealtimeBindings/bin/Release/GtfsRealtimeBindings.X.Y.Z.nupkg -Source https://api.nuget.org/v3/index.json