Code Monkey home page Code Monkey logo

Comments (2)

thesamet avatar thesamet commented on May 11, 2024

Hi Per,

The place to start with is at:
https://github.com/trueaccord/ScalaPB/blob/master/compiler-plugin/src/main/scala/com/trueaccord/scalapb/compiler/Process.scala

In runWithInputStream the request from protoc (in form of a
CodeGeneratorRequest) is parsed and passed to ProtobufGenerator.

protoc supports invoking multiple plugins in a single run. In Process.scala
there is a trick that we do to make protoc send the CodeGeneratorRequest
back to the JVM that invoked it (which is done differently for Windows and
Linux/Mac), but it would be fairly straightforward to extend the trick to
handle multiple plugins...

On Mon, Dec 7, 2015 at 4:34 PM, Per Wiklander [email protected]
wrote:

Since I have all my messages as photo I would like to take advantage of
that and generate all boiler plate code for my application.

Examples of generated code other than plain case classes:

  • Custom JSON ser / dser
  • Slick table models
  • Web forms with input validation

What I'm looking for here is an easy way of pluggin my own custom code
generator into ScalaPB's pipeline.

Any thoughts on that? How hard is it to do this today if I fork the
project?


Reply to this email directly or view it on GitHub
#61.

-Nadav

from scalapb.

thesamet avatar thesamet commented on May 11, 2024

ScalaPB uses a new SBT plugin sbt-protoc, which allows creating custom generators.

See https://github.com/thesamet/sbt-protoc

from scalapb.

Related Issues (20)

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.