Giter Club home page Giter Club logo

protoc-dart's Introduction

protoc-dart

Docker image with protoc and the dart-protoc-plugin.

INFO This image is updated automatically. A nightly build job checks for new versions of dart, protoc and the dart-protoc-plugin every day.

Usage

Consider you have a project structure like this:

my-project
 |- lib
 |   |- src
 |   |   |- generated <- the generated protobuf libraries will be here
 |   |   |...
 |   |
 |   |- my-project.dart
 |
 |- protos
 |   |- api_spec.proto <- we want to compile this
 |
 |- pubspec.yaml
 |...

We want to compile the protos/api_spec.proto and write the output files to the lib/src/generated directory. This can be done using the following command:

docker run --rm -v=${PWD}:/project robojones/protoc-dart:latest protoc -I=protos --dart_out=lib/src/generated protos/api_spec.proto

That's a really long command โ€“ Let's break this down!

  1. First, we make our project accessible inside the docker container. We mount it to /project, which is the default working directory inside the container.
    docker run --rm -v=${PWD}:/project
  2. Next, we specify what version of the image we want to use. We use the latest version.
    robojones/protoc-dart:latest
  3. Finally, we run protoc inside the container. -I=protos tells protoc that protos/ is the root directory for our *.proto files. --dart_out=lib/src/generated means that we want our output files to be in the Dart language and that it should write those files into lib/src/generated. The last parameter, protos/api_spec.proto, tells protoc that we want to compile that specific file.
    protoc -I=protos --dart_out=lib/src/generated protos/api_spec.proto

License

This repository (build script, Dockerfile, etc.) is published unter the MIT license. This project is not affiliated with the owners and publishers of protoc, the dart docker image or the protoc-plugin-dart plugin. Please inform yourself regarding the license terms of protoc, the dart docker image and the protoc-plugin-dart plugin. Their sources can be found here:

protoc-dart's People

Contributors

robojones avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

nikarh zso-pfhr

protoc-dart's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.