Generate Code

To generate the code, use either DaVinci Developer Adaptive or the CLI version.

CLI Script Example

The following example script demonstrates one way such a script could be structured.

  • DAVINCI_DEVA_CORE: Path to the DaVinci CLI core.
    You can use the version from the BSW Package or one downloaded from the download center.

  • BSW_PACKAGE_ROOT: Path to the installation directory created by the AMSR_Generator install component.

  • SRC_GEN_DIR: Path to the directory where the source code should be generated.

  • DAVINCI_PROJECT: Path to the DaVinci project.

  • AMSR_GENERATOR_LIST: List of generators to be used, provided as a comma-separated list.

Reference: Find out more about the DaVinci Adaptive CLI in the chapter Command Line Tool.

bash

#!/bin/bash

SCRIPTDIR=$(/usr/bin/dirname $0)
cd "$SCRIPTDIR"

DAVINCI_DEVA_CORE="<path/to>/CLI/Core"
BSW_PACKAGE_ROOT="<path/to/SDK>/generator"
SRC_GEN_DIR="<dstpath/to/generated_sources>"
DAVINCI_PROJECT="<path/to/davinci_project>"
AMSR_GENERATOR_LIST="<comma separated list of amsr generators>"

"$DAVINCI_DEVA_CORE/DvCliAdaptive" \
  generate \
  -p $DAVINCI_PROJECT \
  --output $SRC_GEN_DIR \
  -b=$BSW_PACKAGE_ROOT \
  -m \"$AMSR_GENERATOR_LIST\"

exit 0