https://github.com/cake-contrib/cake.protobuftools
https://github.com/cake-contrib/cake.protobuftools
cake cake-addin protobuf
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cake-contrib/cake.protobuftools
- Owner: cake-contrib
- License: mit
- Created: 2017-11-09T13:15:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-08T10:21:37.000Z (about 1 year ago)
- Last Synced: 2025-03-29T13:47:57.608Z (about 1 month ago)
- Topics: cake, cake-addin, protobuf
- Language: C#
- Homepage: https://cakebuild.net/extensions/cake-protobuftools
- Size: 76.2 KB
- Stars: 1
- Watchers: 5
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Cake.ProtobufTools
A Cake AddIn that extends Cake with [Google.Protofbuf.Tools](https://github.com/google/protobuf/) command tools, namely protoc.
[](http://cakebuild.net/)
[](https://www.nuget.org/packages/Cake.ProtobufTools)|Branch|Status|
|------|------|
|Master|[](https://ci.appveyor.com/project/cakecontrib/cake-protobuftools)|
|Develop|[](https://ci.appveyor.com/project/cakecontrib/cake-protobuftools)|## Important
1.5.0
* References Cake 4.0.0
* Drops support for .NET Framework
* Supports .net 6+## Including addin
Including addin in cake script is easy.
```c#
#addin "Cake.ProtobufTools"
```
Google.Protobuf.Tools package isn't included, it has to be added manually to your cake script.```c#
#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.
```csharp
#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.:
```c#
var settings = new ProtocSettings
{
OSTarget = OSTarget.Linux64,
...
};
```## Discussion
If you have questions, search for an existing one, or create a new discussion on the Cake GitHub repository, using the `extension-q-a` category.
[](https://github.com/cake-build/cake/discussions/categories/extension-q-a)
## Credits
Brought to you by [Miha Markic](https://github.com/MihaMarkic) and contributors.
