Compiling from command line

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

LiorTi
Posts: 3
Joined: Wed Jun 27, 2018 3:16 pm

Compiling from command line

Postby LiorTi » Wed Jun 27, 2018 3:24 pm

Hello,

We recently started using TrueStudio and now I am integrating it into our CI system.
Our site practice is to commit to SVN only the source code and tools setup and scripts (i.e. no binaries or any file that is compile/link generated). this is of course aimed at making sure the build is not broken.

I would like to be able to build the project from command line (i.e. automated through Jenkins), but could not find anywhere any documentation on the matter.
I did find a way to generate a makefile by converting the project to a makefile type, but it is a compiler output and it is also dependent on multiple files across multiple directories (i.e. according to the source code hierarchy). If I use this method, I cannot confirm that the build is broken and its also tricky to make sure the SVN is fully updated with all the .mk files.

Any suggestion on how to compile from Jenkins without adding the many makefiles into SVN?

Thanks
LT

Andy_Blue
Posts: 14
Joined: Fri May 18, 2018 2:57 pm

Re: Compiling from command line

Postby Andy_Blue » Sat Jul 07, 2018 11:42 pm

Try this. This is the way I do on Linux. Some options you need to find out to fit your work

To list and view the full set of available options, use the command:
/opt/Atollic_TrueSTUDIO_for_STM32_x86_64_9.0.0/ide/TrueSTUDIO -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild
To clean and build all the projects in a workspace at the ~/workspace location, use the command:
/opt/Atollic_TrueSTUDIO_for_STM32_x86_64_9.0.0/ide/TrueSTUDIO -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ~/workspace -cleanBuild
To build the Release configuration of project MyProject in workspace ~/workspace, use the command:
/opt/Atollic_TrueSTUDIO_for_STM32_x86_64_9.0.0/ide/TrueSTUDIO -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ~/workspace -build MyProject/Release

LiorTi
Posts: 3
Joined: Wed Jun 27, 2018 3:16 pm

Re: Compiling from command line

Postby LiorTi » Sun Jul 08, 2018 7:42 am

Hi,

Thanks for the elaborate reply.
Unfortunately it doesn't work on my PC. I am running windows with Java SE - jdk-8u171.

I get a JAVA window that says - "Java started but returned exit code=1"

See attached image.


Thanks
LT
You do not have the required permissions to view the files attached to this post.

Mattias Norlander
Posts: 273
Joined: Fri Apr 29, 2016 10:01 am

Re: Compiling from command line

Postby Mattias Norlander » Tue Aug 07, 2018 9:31 am

Hi,

Have you looked into the User Guide p.110? The chapter is called "Headless build".
Basically we provide a file:
C:\Program Files (x86)\Atollic\TrueSTUDIO for ARM 8.1.0\ide\headless.bat
Have Jenkins run this file with the right input parameters. Read more about it in headless.bat file.

LiorTi
Posts: 3
Joined: Wed Jun 27, 2018 3:16 pm

Re: Compiling from command line

Postby LiorTi » Wed Aug 08, 2018 6:06 am

I will look that up.

Thanks
Lior

Champion
Posts: 3
Joined: Thu Mar 30, 2017 2:54 am

Re: Compiling from command line

Postby Champion » Thu Aug 23, 2018 9:34 pm

I have the same jave issue with V9 of truestudio. I have been using headless build for years with no problem until V9.0.0. V8.1.0 was fine.
It happens sometimes on the build server but not on my local machine. I have tried to replace the jre, truestudioc.exe and ini file from V8.1.0 with no luck.

In fact, it will complete the compiling/building, and then pop up with the error at the end.

Any ideas?

Mattias Norlander
Posts: 273
Joined: Fri Apr 29, 2016 10:01 am

Re: Compiling from command line

Postby Mattias Norlander » Wed Aug 29, 2018 8:48 am

LiorTi wrote: I am running windows with Java SE - jdk-8u171.

I get a JAVA window that says - "Java started but returned exit code=1"


LiorTi: TrueSTUDIO comes with a bundled JRE, thus it should not care about which JRD/JDK you have on your PC.

Champion: Sounds strange. Hard to troubleshoot. What about if you run the working 8.1.0 but pointing out the new 9.0.0 toolchain from the 8.1.0 build configuration? You can do that in Toolchain versions tab..

samclark
Posts: 1
Joined: Wed Mar 27, 2019 8:24 pm

Re: Compiling from command line

Postby samclark » Wed Mar 27, 2019 8:29 pm

Hi,

I've also had the same issue as LiorTi. When I run this via command line it returns exit code 1.

I think this is an issue with the JDK. I've seen the fix for eclipse locally ( https://stackoverflow.com/questions/186 ... xit-code-1 ) but i'm unsure how to fix this for this specific issue.

I've looked at the TrueSTUDIO.ini file to see if editing that would help but so far no luck. Any help would be highly appreciated.

Poojakhana
Posts: 1
Joined: Wed May 08, 2019 6:09 am

Re: Compiling from command line

Postby Poojakhana » Wed May 08, 2019 6:20 am

I also had the same issue...Got solution..I got valuable information here. Thanks for such an excellent post! Keep Up!


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 1 guest