From 1e7e3f6b331c2030e908c6aed515ca4d407559f7 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Wed, 11 Apr 2018 21:44:57 +0300 Subject: Update README.md --- README.md | 55 +++++-------------------------------------------------- 1 file changed, 5 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 420c0ba..4f5ccfd 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,13 @@ -# nimpb_build +# nimpb_protoc -**NOTE** nimpb_build is still experimental :-) +This repo contains protoc binaries for most common platforms, for easy usage +with [nimpb](https://github.com/oswjk/nimpb). The actual code generation is +in nimpb. -A tool for generating suitable Nim code for -[nimpb](https://github.com/oswjk/nimpb). It uses a prebuilt and bundled protoc -compiler. This tool supports the following platforms: +The following platforms are supported: - Linux x86_32 - Linux x86_64 - Linux aarch_64 - OSX x86_64 - Windows - -nimpb_build is modeled somewhat after [prost-build](https://github.com/danburkert/prost). - -# Install with Nimble - - $ nimble install https://github.com/oswjk/nimpb_build - -# Usage - -## As a binary - -Using the tool is simple: - - $ nimpb_build -I. --out=. my.proto - -It's almost like using protoc directly. In fact, the arguments are basically -passed along to protoc. - -You can specify nimpb_build as a dependency for your project in your .nimble -file and create a task for generating code: - - requires "nimpb_build" - - task proto, "Process .proto files": - exec "nimpb_build -I. --out=. my.proto" - -## As a library - -It's also possible to use nimpb_build as a library: - -```nim -import nimpb_build - -let protos = @["my.proto"] -let incdirs = @["."] -let outdir = "." - -compileProtos(protos, incdirs, outdir) -``` - -# How it works - -nimpb_build invokes the protoc compiler with `--descriptor_set_out` parameter, -which makes protoc output a `FileDescriptorSet` (defined [here](src/nimpb_buildpkg/protobuf/include/google/protobuf/descriptor.proto)) into a file. nimpb_build then reads and parses the file, -and generates Nim code from the parsed definitions. -- cgit v1.2.3