Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Build Events - differences between VM and Arduino IDE (Read 4158 times)
jcgperry
Newbies
*
Offline



Posts: 2
Build Events - differences between VM and Arduino IDE
Jun 4th, 2015 at 8:13am
 
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
 
Visual Micro
Administrator
*****
Online



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



Posts: 2
Re: Build Events - differences between VM and Arduino IDE
Reply #2 - Jun 4th, 2015 at 7:16pm
 
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
 
Visual Micro
Administrator
*****
Online



Posts: 10546
United Kingdom
Re: Build Events - differences between VM and Arduino IDE
Reply #3 - Jun 4th, 2015 at 9:20pm
 
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 Topic Print