Is there a way to programmatically save a copy of the build log into the project output directory? I've found one setting under Project->Properties->C/C++ Build->Logging but there are a couple of short comings which make it not workable for my situation:
1) I work in a multi-developer environment (on multiple OSes, setups, etc.) and so absolute paths are a problem. Project relative paths are necessary.
2) It looks like the same file/location is used regardless of which build Configuration is run. We'd need to separate the "debug" from the "release" logs, etc.
3) It looks like the build log itself encompasses the pre-build and post-build steps, so if either of those accessed the file (say to add a time-stamp to the file name) I suspect VeryBadThings(tm) would happen.
Is there another way to configure build logs so that for every compile I can have a unique, timestamped log saved to the correct configuration's output directory?
Assuming that you haven't change the default log set up for the project/workspace, then adding the following as the final (active) step in your projects post-build step should achieve what you want:
cp ${WorkspaceDirPath}/.metadata/.plugins/org.eclipse.cdt.ui/${ProjName}.build.log buildlog-${current_date}.txt
Regards,
MCUXpresso IDE Support
Oops, I "liked" this too soon. This works great on Linux based systems (which is what I tried it on) but failed on my Windows system because ${WorkspaceDirPath} gets populated with Windows style slashes which then get interpreted as escape sequences in the string. Still, this is a useful bit of insight into Eclipse variables so still very helpful.
I don't suppose anyone has a trick up their sleeve that would convert a Windows path into a Linux compatible path for the purposes of this thread?
Have you tried placing the path in quotes?
cp “complete/path” to/path
I would not have expected that to work since it still has both forward and backward slashes, but at least on a Windows box and a Linux box it worked! I'll get one of the Mac guys to give it a try but I'm optimistic. Thanks!
For completeness, this is what it looks like:
cp "${WorkspaceDirPath}/.metadata/.plugins/org.eclipse.cdt.ui/${ProjName}.build.log" buildlog-${current_date}.txt
One thought though. Have you tried a command line build? You could then capture the output and save to a file of your choice. See Building Eclipse and MCUXpresso IDE Projects from the Command Line | MCU on Eclipse
Something like that was going to be my next step. Thank you for providing the link! I'll take a look and see if I can get it working.
Not sure if I understand your questions.
I don't often use pre/post build command,I ever use arm-none-eabi-objdump to generate disassemble files in the project folder. there is no issue.
To clarify, I have the following setup for my project team:
Currently we use the built-in "build" tool of MCUXpresso to
What I would *like* to do is take all of the scrolling text that whizzes by on the console during the compile/assemble/link portion of the build and save it off to a file - ideally timestamped - so that there is a record of *every* compile/assemble/link we performed. We would like to save this in a different directory for each build target similar to how the other build artifacts are saved by MCUXpresso already. Currently I have not found any indication this is possible so I turn to the forums to see if someone else has tried this already and either succeeded or failed.
Anyone else know if this is possible?
There doesn't appear to be any way. According to a response on the Eclipse CDT forum, one of the developers commented:
No, it does not. This location is intended to keep "temporary" log, just to support "Copy Build Log" icon on the console toolbar. The idea behind it being configurable is to allow using a different filesystem in case of problems with space.
That's a shame, but good to at least know the answer so I'm not spinning my wheels.
Hi Will
You can set build log location here
Have a nice day,
Jun Zhang
I already referenced this field in my original post, and went on at length to describe why it was not suitable for my needs.
To reiterate, I would like to be able to set a per-build configuration file or directory, relative to the project directory, where build logs are stored. Ideally I would also like the ability to either have them time-stamped automatically, or have a way for a post-build step to time-stamp them that wasn't going to interfere with any post-build steps that the build log itself records.