Use the command line to call MRS for clean and build projects

This method simulates the effect of compiling/recompiling without opening the IDE. It is necessary to ensure that the project compilation configuration is correct. It is applicable to some scenarios, such as the need to create scripts to automate the compilation process.

"C:\MounRiver\MounRiver_Studio\eclipsec.exe" -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data C:\test -import C:\MRS_DATA\workspace\CH32V103C6T6 -cleanBuild "all"

Parameter meaning:

ParameterDescribeTips
-nosplashDo not display Splash image 

-application org.eclipse.cdt.managedbuilder.core.headlessbuild

Specify the application that eclipsec.exe runs. You must specify the clean and build projects“org.eclipse.cdt.managedbuilder.core.headlessbuild”。

 
-data {workspaceDir}

Specified execution Workspace (Workspace). If the path contains spaces, double quotation marks are required. It is recommended to use the path without Chinese and spaces;

If this parameter is not specified, the defaultWorkspace (work area), i.e“%UserProfile%\workspace”;

Relative paths can be used “ . ” or " .. "。

'' cannot be added at the end of the path. This character will escape the parameter

, resulting in abnormal parameters

-import {projectDir}

Import the project with the specified path to theWorkspace

If multiple projects need to be imported, repeat this parameter

If you do not specify this parameter, the folder of theWorkspace(workspace) specified in the command must contain the project to be cleaned and built

Relative paths can be used&ldquo< strong>. ” or " < strong>.. "。

You cannot add '' at the end of the path. This character will escape the parameter

and cause the parameter to be abnormal
- importAll {projectTreeDir}

Import all projects under the specified path toWorkspace

If you do not specify this parameter, the folder of theWorkspace(workspace) specified in the command must contain the project to be cleaned and built

Relative paths can be used “ < strong>. ” Or"< strong>.. "。

You cannot add '' at the end of the path. This character will escape the parameter

and cause the parameter to be abnormal

-build {projectName[/configName]}

Build < Strong>For the project with the specified name in Workspace, only the specified project name defaults to all configurations in the build project

You can useconfigNameto limit a single configuration, such asDebugorRelease

If you need to build multiple projects, repeat this parameter

Limit a single configuration Pay attention to using backslashes&lsquo< strong>/’
-build {all}Build < Strong>All configurations of all projects in Workspace
- cleanBuild {projectName [/configName]}

Clean and Build < Strong>For the project with the specified name in Workspace, only the specified project name defaults to all configurations in Clean and Build projects

You can useconfigNameto limit a single configuration, such asDebugorRelease

If you need to clean and build multiple projects, repeat this parameter

Limit a single configuration Pay attention to using backslashes&lsquo< strong>/’
- cleanBuild {all}Clean and Build < Strong>All configurations of all projects in Workspace
-- launcher.suppressErrorsDo not display the graphical dialog box to report errors
- console | - consoleLog

A new console window will pop up to output the clean or build process

Matchable parameters&lsquo- noExit’ When used, new windows will not be closed automatically

- noExitAfter the command line is compiled, the console does not automatically exit