Andes Workshop

It is currently Tue Sep 26, 2017 8:17 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: How to set Pre-build & Post-build steps in AndeSight
PostPosted: Thu Jul 04, 2013 4:24 pm 
Offline

Joined: Fri May 04, 2012 6:49 am
Posts: 16
Engineers who uses AndeSight to compile project with auto-generated Makefile may need do some steps before compiling or after compiling, for example, someone may need copy a file to upper folder to make sure that compiling is passed and then restore it. In this condition it is not appropriate for doing this in Makefile, Andesight provide another way to fulfill this purpose.

We take "Hello-world" project for example to show how to set build steps and the effects.

Ex. 1: We set "Release" as the active build target. Right click the project name, choose "Properties" --> "Setting" --> "C/C++ Build" --> "Setting" --> "Build Steps", input the command, and click "OK". As:
Attachment:
Release-1.png
Release-1.png [ 75.82 KiB | Viewed 3385 times ]


Build "hello-world", in "Console View", the output is:
Attachment:
Release-2.png
Release-2.png [ 23.14 KiB | Viewed 3385 times ]


Ex. 2: We set "Debug" as the active build target. Also input the Pre-build & Post-build commands:
Attachment:
Debug-1.png
Debug-1.png [ 63.8 KiB | Viewed 3385 times ]


Build "hello-world", in "Console View", the output is:
Attachment:
Debug-2.png
Debug-2.png [ 22.56 KiB | Viewed 3385 times ]


From these two examples, we do conclusions as:
1. "Build Steps" Tab provide "Pre-build" and "Post-build" hooks.
2. "Pre-build" and "Post-build" currently only supports bash shell for it will be running in cygwin enviroments.
3. The PATH of executing commands depends on your active build target.


Top
 Profile Send private message E-mail  
 
 Post subject: Re: How to set Pre-build & Post-build steps in AndeSight
PostPosted: Fri Aug 18, 2017 8:22 pm 
Offline

Joined: Mon Dec 12, 2016 5:07 pm
Posts: 3
Add advanced usage.
The previous usage is available when there are limit scripts to run.
While you got decades of script to run, it's hard to use this scenario to debug and run.
You can follow the attachment to use a script file.
The key point is how to add parameter/variable into the script file.
Attachment:
PostBuildScriptwithVariable2.JPG
PostBuildScriptwithVariable2.JPG [ 175.52 KiB | Viewed 45 times ]

    Following the red procedure, the parameters will pass to the script.
    Following the green procedure, the definitions in the .h file will be parsed. You can use this to do extra work.
[*]Note: The green procedure only support simple #define. It does support complex definition, ex #ifdef #define.
    If there are ā€œ/r/nā€ related errors while running the script, use dos2unix.exe to modify the postbuild.sh


Attachments:
PostBuildScriptwithVariable.pdf [494.7 KiB]
Downloaded 3 times
PostBuildScriptwithVariable.zip [260.16 KiB]
Downloaded 5 times
Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group