Command Line Execution - Working With Projects

S32 Design Studio as an Eclipse IDE takes care about compiling and building all the projects with source files. One can import, build and clean-build projects using the following options sent to Eclipse at the command line:

eclipse -nosplash

        -application org.eclipse.cdt.managedbuilder.core.headlessbuild
        -import {[uri:/]/path/to/project}
        -build {project_name | all}
        -cleanBuild {projec_name | all}

On Windows, use eclipsec.exe instead of eclipse.exe or tools.exe or s32ds.exe or s32ds.bat to have the build output written to stdout/stderr and so the call blocks until compl

On Linux there is no restrictions, use eclipse or tools or s32ds.

Eclipse offers a huge number of command line options to configure many aspects, some of the most popular ones are:
  • -clean

    If set to "true", any cached data used by the OSGi framework and eclipse runtime will be wiped clean. This will clean the caches used to store bundle dependency resolution and eclipse extension registry data. Using this option will force eclipse to reinitialize these caches.

  • -data

    The instance data location for this session. Plug-ins use this location to store their data. For example, the Resources plug-in uses this as the default location for projects (aka the workspace).

  • -vm

    When passed to the Eclipse executable, this option is used to locate the Java VM to use to run Eclipse. It should be the full file system path to an appropriate: Java jre/bin directory, Java Executable, Java shared library (jvm.dll or libjvm.so), or a Java VM Execution Environment description file. If not specified, the Eclipse executable uses a search algorithm to locate a suitable VM. In any event, the executable then passes the path to the actual VM used to Java Main using the -vm argument.

  • -consoleLog

    If "true", any log output is also sent to Java's System.out (typically back to the command shell if any). Handy when combined with -debug.

Let’s take some examples to see how they work on Windows:
  • Import project into Eclipse workspace

    eclipsec.exe -noSplash \

            -application org.eclipse.cdt.managedbuilder.core.headlessbuild \
            --launcher.ini /path/to/S32DS/installation/eclipse/s32ds.ini \
            -data /path/to/workspace \
            -import /path/to/project

    eclipsec.exe -noSplash \

            -application org.eclipse.cdt.managedbuilder.core.headlessbuild \
            --launcher.ini C:\NXP\S32DS\eclipse\s32ds.ini \
            -data C:\workspace \
            -import C:\temp\testPrj

    This will launch Eclipse without splash screen (-noSplash), uses –launcher.ini option to point to the product .ini file, then the –application command to load the managed make builder (which is used to import and build projects), with -data that specifies the workspace to be used, and with the -import command that will import the project into specified eclipse workspace.

  • Update Code with S32 Configuration Tools and all component dependencies

    eclipsec.exe -noSplash \

            -application com.nxp.swtools.framework.application \
            --launcher.ini /path/to/S32DS/installation/eclipse/s32ds.ini \
            -HeadlessTool Peripherals \
            -importProject /path/to/project \
            -sdkPath /path/to/sdk/manifest/file(s) \
            -data /path/to/workspace

    eclipsec.exe -noSplash \

            -application com.nxp.swtools.framework.application \
            --launcher.ini C:\NXP\S32DS\eclipse\s32ds.ini \
            -HeadlessTool Peripherals \
            -importProject C:\temp\testPrj \
            -sdkPath C:\NXP\S32DS\software\PlatformSDK_S32G_2020_12 \
            -data C:\workspace

    For this command, project must already exist in the workspace.

  • Build project

    eclipsec.exe -noSplash \

            -application org.eclipse.cdt.managedbuilder.core.headlessbuild \
            --launcher.ini /path/to/S32DS/installation/eclipse/s32ds.ini \
            -data /path/to/workspace \
            -cleanBuild /project/name

    The result of the above command is a clean build of the given project configuration from the given workspace.

  • Generate Code with S32 Configuration Tools based on a .mex file

    eclipsec.exe -noSplash \

            -application com.nxp.swtools.framework.application \
            --launcher.ini /path/to/S32DS/installation/eclipse/s32ds.ini \
            -HeadlessTool Pins|Clocks|Peripherals \
            -Load /path/to/existing/mex/file \
            -ExportSrc /path/where/to/save/generated/code
  • Execute S32 Configuration Tools commands from S32 Design Studio command line

    eclipsec.exe -noSplash \

            -application com.nxp.swtools.framework.application \
            --launcher.ini /path/to/S32DS/installation/eclipse/s32ds.ini \
            [tool commands]

On Linux host, replace eclipsec.exe with eclipse or s32ds.