Skip to content

vkbishnoi/Cake.ProtobufTools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cake.ProtobufTools

A Cake AddIn that extends Cake with Google.Protofbuf.Tools command tools, namely protoc.

cakebuild.net NuGet

Including addin

Including addin in cake script is easy.

#addin "Cake.ProtobufTools"

Google.Protobuf.Tools package isn't included, it has to added manually to your cake script.

#tool nuget:?package=Google.Protobuf.Tools

Usage

To use the addin just add it to Cake call the aliases and configure any settings you want.

#addin "Cake.ProtobufTools"
#tool nuget:?package=Google.Protobuf.Tools

...

Task("ProtobufGenerator")
	.Does(() => {
		var settings = new ProtocSettings
        {
                CSharpOut = Directory("."),
        };
        var file = File("./definitions.proto");
        Protoc(settings, file);
	)};

Since Google.ProtobufTools nuget package comes with different executable flavors (Linux, Windows, MacOS X - all having both x86 and x64 versions) the addin, unless explicitly defined, uses the most appropriate based on OS you are running the script.

You can force it using ProtocSettings.OSTarget property, i.e.:

var settings = new ProtocSettings
{
	OSTarget = OSTarget.Linux64,
	...
};

Credits

Brought to you by Miha Markic (@MihaMarkic) and contributors.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 85.7%
  • PowerShell 14.3%