Prepare the Workspace
With the following steps, you will prepare the local workspace to build and run the Hello World Application with Pesto/Bazel.
Optional: Make a Copy
If you don’t want to inflict changes to the original Hello World use case, make a copy of the application first.
-
Create an empty directory as a workspace for building and running a copy of your application.
-
Copy the
amsr-vector-app-example-hello-worlddirectory of the original application (located in theExamplesdirectory of your delivery) to your newly created directory. -
Rename the application copy in the newly created directory.
|
If you decide to make a copy and want to use that for the following steps, please adapt the given paths from all instructions (building, adapting, installing and running your application) to match the location of your copy. |
Step 1: Create a Registry
The components of MICROSAR Adaptive are structured as Bazel modules. To make your project aware of all modules, you need to create a registry.
-
Navigate to the directory of your application in your terminal.
This can either be the original Hello World Application directory or the copy you made in Optional: Make a Copy.
-
Set the environmental variable
APP_DIRto the application directory which you want to work with in this tutorial:export APP_DIR="$(pwd)" -
Set the environmental variable
AMSR_SRC_DIRto the root directory of your delivery:export AMSR_SRC_DIR="$(pwd)/../.." -
Create a registry by running the Bazel integration tool located in your delivery:
"${AMSR_SRC_DIR}/BuildSystem/Pesto/addon/bazel_integration/bazel_integration.py" create-registry \ --output bazel_registry \ --source-type local_path \ --module-version latest \ --module-base-path "${AMSR_SRC_DIR}" \ --relative-module-base-path \ --add-to-bazelrc .bazelrc \ --workspace .
|
Depending on your setup, you can adapt the arguments of the Bazel
integration tool to create a registry as shown in the command above.
General information about commands/arguments can be found by running the
tool with
|
Step 2: Generate .bazelrc File
To provide configuration options of MICROSAR Adaptive, a
.bazelrc file must be generated.
-
Create the
.bazelrcfile:"${AMSR_SRC_DIR}/BuildSystem/Pesto/addon/bazel_integration/bazel_integration.py" create-bazelrc \ --output .bazelrc_ves \ --add-to-bazelrc .bazelrc \ --workspace .
|
General information about commands/arguments can be found by running the
tool with
|