This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCSTUDIO: Problem importing CCS project in headless mode (ccs-server-cli) – CdtVariableException with stringListMacro

Part Number: CCSTUDIO

Tool/software:

Hello,

I am trying to build my CCS project in a Jenkins CI environment using CCS 20.2.0 and the ccs-server-cli.sh tool.

The project builds fine inside the CCS GUI, and it also worked in our Docker CI setup with CCS 20.0.2.
However, after updating the Docker image to CCS 20.2.0, the same project can no longer be imported in headless mode.

When running:

sh '/ti/ccs2010/ccs/eclipse/ccs-server-cli.sh -noSplash -data "${WORKSPACE}/workspace_ccs_projects" -workspace "${WORKSPACE}/workspace_ccs_projects" -application com.ti.ccs.apps.initialize -ccs.toolDiscoveryPath "/opt/ti/" '
sh '/ti/ccs2010/ccs/eclipse/ccs-server-cli.sh -noSplash -data "${WORKSPACE}/workspace_ccs_projects" -workspace "${WORKSPACE}/workspace_ccs_projects" -application com.ti.ccs.apps.initialize -ccs.productDiscoveryPath "${WORKSPACE}/ci_dependencies" '
sh '/ti/ccs2010/ccs/eclipse/ccs-server-cli.sh -noSplash -data "${WORKSPACE}/workspace_ccs_projects" -workspace "${WORKSPACE}/workspace_ccs_projects" -application com.ti.ccs.apps.importProject -ccs.overwrite -ccs.location "${BOOTLOADER_LOCATION}"'

I get the following exception:

org.eclipse.cdt.core.cdtvariables.CdtVariableException
at org.eclipse.cdt.core.cdtvariables.CdtVariable.getStringValue(CdtVariable.java:81)
at com.ti.ccs.project.services.ProjectImporter.processVariables(ProjectImporter.java:686)
...

Root cause I found

The issue is triggered by the following section in the .cproject file:

<stringListMacro name="include_directories" type="VALUE_PATH_ANY_LIST">
    <value name="${src}/HardwareAbstractionLayer/third_party/CMSIS/Core/Include"/>
    <value name="${src}/HardwareAbstractionLayer"/>
    <value name="${src}/Common"/>
    <value name="${src}/Bootloader/DeviceAbstraction/CanStack/CanGenerated"/>
    <value name="${src}/Common/CanStack/can_stack_lib/src"/>
    <value name="${src}/Bootloader"/>
</stringListMacro>


If I remove this block, the project imports and builds (but without the include paths).

If I keep it, import fails with CdtVariableException.

In the GUI, the same project works without issue. In CCS 20.0.2 (headless), the same project also imported and built correctly.

Has someone already encountered this problem?

What is the recommended way to define include paths so that they work in both GUI and headless builds?

Thanks in advance!