Coder Social home page Coder Social logo

protoc-jar's Introduction

protoc-jar

Protocol Buffers protobuf compiler - multi-platform executable protoc JAR and API. Available on Maven Central: http://central.maven.org/maven2/com/github/os72/protoc-jar/3.5.1.1/

Maven Central


Simple convenience JAR that embeds protoc compiler binaries for Linux, Mac/OSX, and Windows, providing some portability across the major platforms. At runtime the library detects the platform and executes the corresponding protoc binary. Supports protoc versions 2.4.1, 2.5.0, 2.6.1, 3.5.1. Also supports downloading protoc from maven central

  • New: Support for Linux on POWER8 platform (linux-ppcle_64), thanks to Apache SystemML folks (nakul02)
  • New: Support for FreeBSD on x86 platform (freebsd-x86_64), thanks kjopek
  • New: Support for Linux on ARM platform (linux-aarch_64; 2.4.1, 2.6.1, 3.4.0), thanks garciagorka

See also

Binaries

Version support

  • protobuf 2.4.1: -v2.4.1, -v241
  • protobuf 2.5.0: -v2.5.0, -v250
  • protobuf 2.6.1: -v2.6.1, -v261
  • protobuf 3.5.1: -v3.5.1, -v351
  • download by maven artifact id: -v:<group>:<artifact>:<version> (eg, -v:com.google.protobuf:protoc:3.0.0)

Usage - executable

$ java -jar protoc-jar-3.5.1.1.jar -v2.4.1 --version
protoc-jar: protoc version: 2.4.1, detected platform: windows-x86_64 (windows 8.1/amd64)
protoc-jar: embedded: bin/2.4.1/protoc-2.4.1-windows-x86_64.exe
protoc-jar: executing: [C:\cygwin64\tmp\protocjar4043021753132417014\bin\protoc.exe, --version]
libprotoc 2.4.1

$ java -jar protoc-jar-3.5.1.1.jar -v2.5.0 --version
protoc-jar: protoc version: 2.5.0, detected platform: windows-x86_64 (windows 8.1/amd64)
protoc-jar: embedded: bin/2.5.0/protoc-2.5.0-windows-x86_64.exe
protoc-jar: executing: [C:\cygwin64\tmp\protocjar1249962506895049512\bin\protoc.exe, --version]
libprotoc 2.5.0

$ java -jar protoc-jar-3.5.1.1.jar -v2.6.1 --version
protoc-jar: protoc version: 2.6.1, detected platform: windows-x86_64 (windows 8.1/amd64)
protoc-jar: embedded: bin/2.6.1/protoc-2.6.1-windows-x86_64.exe
protoc-jar: executing: [C:\cygwin64\tmp\protocjar6776927966028536935\bin\protoc.exe, --version]
libprotoc 2.6.1

$ java -jar protoc-jar-3.5.1.1.jar -v3.5.1 --version
protoc-jar: protoc version: 3.5.1, detected platform: windows-x86_64 (windows 8.1/amd64)
protoc-jar: embedded: bin/3.5.1/protoc-3.5.1-windows-x86_64.exe
protoc-jar: executing: [C:\cygwin64\tmp\protocjar6721276946617095290\bin\protoc.exe, --version]
libprotoc 3.5.1

$ java -jar protoc-jar-3.5.1.1.jar -v3.1.0 --version
protoc-jar: protoc version: 3.1.0, detected platform: windows-x86_64 (windows 8.1/amd64)
protoc-jar: downloading: http://central.maven.org/maven2/com/google/protobuf/protoc/maven-metadata.xml
protoc-jar: saved: C:\cygwin64\tmp\protocjar.webcache\com\google\protobuf\protoc\maven-metadata.xml
protoc-jar: downloading: http://central.maven.org/maven2/com/github/os72/protoc/maven-metadata.xml
protoc-jar: saved: C:\cygwin64\tmp\protocjar.webcache\com\github\os72\protoc\maven-metadata.xml
protoc-jar: cached: C:\cygwin64\tmp\protocjar.webcache\com\google\protobuf\protoc\maven-metadata.xml
protoc-jar: downloading: http://central.maven.org/maven2/com/google/protobuf/protoc/3.1.0-build2/protoc-3.1.0-build2-windows-x86_64.exe
protoc-jar: saved: C:\cygwin64\tmp\protocjar.webcache\com\google\protobuf\protoc\3.1.0-build2\protoc-3.1.0-build2-windows-x86_64.exe
protoc-jar: executing: [C:\cygwin64\tmp\protocjar1755669222845599671\bin\protoc.exe, --version]
libprotoc 3.1.0

Usage - executable, include google.protobuf standard types (option --include_std_types)

$ java -jar protoc-jar-3.5.1.1.jar --include_std_types -I. --java_out=out StdTypeExample.proto
protoc-jar: protoc version: 3.5.1, detected platform: windows-x86_64 (windows 8.1/amd64)
protoc-jar: embedded: bin/3.5.1/protoc-3.5.1-windows-x86_64.exe
protoc-jar: executing: [C:\cygwin64\tmp\protocjar4162580735258750520\bin\protoc.exe, -IC:\cygwin64\tmp\protocjar4162580735258750520\include, -I., --java_out=out, StdTypeExample.proto]

Usage - executable, apply shading for use with protobuf-java-shaded-241 (option --java_shaded_out)

$ java -jar protoc-jar-3.5.1.1.jar -v2.4.1 --java_shaded_out=out PersonSchema.proto
protoc-jar: protoc version: 2.4.1, detected platform: windows-x86_64 (windows 8.1/amd64)
protoc-jar: embedded: bin/2.4.1/protoc-2.4.1-windows-x86_64.exe
protoc-jar: executing: [C:\cygwin64\tmp\protocjar139806143399660474\bin\protoc.exe, --java_out=out, PersonSchema.proto]
protoc-jar: shading (version 2.4.1): out

Usage - API

import com.github.os72.protocjar.Protoc;
...
String[] args = {"-v2.4.1", "--help"};
Protoc.runProtoc(args);

Maven dependency

<dependency>
  <groupId>com.github.os72</groupId>
  <artifactId>protoc-jar</artifactId>
  <version>3.5.1.1</version>
</dependency>

protoc-jar's People

Contributors

os72 avatar kjopek avatar jkukul avatar ralscha avatar nakul02 avatar sandordargo avatar kleinsch avatar trask avatar

Watchers

James Cloos avatar Liu Yongsong avatar

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.