Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Build Events - differences between VM and Arduino IDE (Read 4994 times)
jcgperry
Newbies
*
Offline


Posts: 2
Joined: Jun 4th, 2015
Build Events - differences between VM and Arduino IDE
Jun 4th, 2015 at 7:13am
Print Post  
This is mainly for information. I've been playing with the prebuild and postbuild hooks and discovered a couple of differences in behaviour between Visual Micro's implementation and the Arduino IDE implementation:
a) In the Arduino IDE, {build.source.path} gets passed as the Source DIRECTORY to any build hook, e.g. "c:\User\blah\blah\blah\Arduino\Blink".
whereas in Visual Micro {build.source.path} it is the source FILE which gets passed i.e. "c:\User\blah\blah\blah\Arduino\Blink\Blink.ino".
b) The Arduino IDE echoes any build command AND correctly redirects any output from a build hook executable to the output window, whereas Visual Micro echoes the command (twice!) but does not redirect the executable output.

A simple Batch Script (PreBuildEvent.bat) is enough to demonstrate this:

@echo off
echo %1

This is invoked from platform.local.txt
with the line:
recipe.hooks.prebuild.0.pattern="C:\Users\blah\blah\PreBuildEvent.bat" "{build.source.path}"

Neither of these are a deal breaker as I have coded around issue a) and put up with issue b)!

This is all using:
Arduino IDE v1.6.4
Visual Micro v1505.19 Sp4
Visual Studio 2013 Community
Windows 8.1

Not tried VM 1505.19 Sp6 yet but I assume there has been no changes in this area.

Sorry for the long post - hope this helps others.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Build Events - differences between VM and Arduino IDE
Reply #1 - Jun 4th, 2015 at 12:04pm
Print Post  
Thanks for the info. Hopefully can resolve those items in the next release.
  
Back to top
WWW  
IP Logged
 
jcgperry
Newbies
*
Offline


Posts: 2
Joined: Jun 4th, 2015
Re: Build Events - differences between VM and Arduino IDE
Reply #2 - Jun 4th, 2015 at 6:16pm
Print Post  
Thanks Tim, keep up the great work and unsurpassed support.

After further digging around and playing with Build Events, I took a peek inside platform.txt to see what other parameters might be useful to pass to a build event hook. Below are some of the results when invoked from VM:

{build.source.path} = "C:\Users\xxxx\Documents\blah\blah\Arduino\Blink\Blink.ino"
{build.path} = C:\Users\xxxx\AppData\Local\Temp\build1285779512254750367.tmp
{build.project_name}  = Blink.cpp
{build.board} = AVR_NANO or = AVR_UNO or = to whatever, not tested any others!
{build.arch} = AVR or some other, again not tested
{compiler.cpp.flags}  = "-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD"
{runtime.ide.version} = 10604
{build.f_cpu} = 16000000L

That's all folks, hope it is of use to some!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Build Events - differences between VM and Arduino IDE
Reply #3 - Jun 4th, 2015 at 8:20pm
Print Post  
You can also switch on "tools>options>visual micro>compiler>show build properties" and "verbose" to see more info. 

I am not sure how early the "pre" event happens. If any required properties are unavailable then pls let me know.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint