Installation

What is required to be able to generate source files based on .proto files:

  1. Python 3.8 and up
  2. Pip
  3. Protobuf 3.17.3 and up
  4. Git

In the following to paragraphs a generic installation of Embedded Proto is described for both Linux and Windows. If you are interested in a more specific example on how to integrate Embedded Proto into your toolchain, please visit the Examples page on the website.

Linux

Install the required software and continue with checking out the repository. There is a slight difference for regular users of Embedded Proto and people intending to work on Embedded Proto itself.

For Embedded Proto users

You can clone Embedded Proto from the github repo with your favorite git gui or cli:

git clone https://github.com/Embedded-AMS/EmbeddedProto.git

After pulling the repo you only have to run the setup script. This will create the virtual environment for the python scripts. In this environment the required packages are installed by the setup script.

./setup.sh

After running the setup script use the Embedded Proto protoc plugin in your projects

For Embedded Proto developers

Embedded Proto makes use of CMake 3.16.3 to build unit tests. You need to install CMake when intending to build the unit tests.

Further requirements for the unit tests are GTest and GMock, these are included as a git submodule. When cloning the Embedded Proto repo you can include these by using the recursive option:

git clone --recursive https://github.com/Embedded-AMS/EmbeddedProto.git

Next you enter the Embedded Proto folder and run the setup script. This will create the virtual environment for the python scripts. In this environment the required packages are installed by the setup script.

./setup.sh

After running the setup script use the Embedded Proto protoc plugin in your projects but your are also ready to build the PC unit tests if you have installed CMake:

./build_test.sh

Running the unit tests is done by running the executable in the build/test folder:

./build/test/test_EmbeddedProto

Windows

Install the required software and continue with checking out the repository. Unit tests have not been validated for Windows so pulling the submodule for GTest and GMock is not required.

Version 3.0.0 and up

Next enter the Embedded Proto folder and open a terminal. In this terminal run the batch script to setup the required virtual environment for the generator and build the Embedded Proto options file. The options file is used when setting fixed repeated, string and bytes field lengths. This options file requires a reference to: google/protobuf/descriptor.proto. This file is located in your protobuf installation src folder. For example when installed google protobuf directly on the C:\ drive run the setup script like:

.\setup.bat C:\protobuf\src

You are now ready to use Embedded Proto in your project.

Prior to version 3.0.0

Next you go to the Embedded Proto folder and run setup.bat either by clicking on it or from a command line terminal. This will create the required virtual environment for the generator to work. You can now use the Embedded Proto protoc plugin.