MSBuild: Colored cucumber output - windows

When I run cucumber from the windows command line I get colored output (currently using ANSICON).
When I use the following MSBuild target, run from the command line, I don't get colored output
<Target Name="Tests_Functional_Run">
<Exec Command="bundle exec cucumber" />
</Target>
Any ideas how I can get colored output in MSBuild?

First of all, I just had to read this question to see what "Colored Cucumber" was...
Are you building the project in Visual Studio, or using MSBuild from a command line? I ask because MSBuild from a command line puts out all sorts of coloured output, but I've never seen colour in the VS output window.

The coloration is an artifact of the "display module" (for lack of a better term at hand). The Windows console is sensitive to the type of message it displays from command-line output.
You'd need to make or find a VS add-in to colorize the Output pane. Or copy the text into a capable editor and use its colorizing capabilities.

Your terminal needs to support ANSI color. We use something called ANSICon here, it can be set up so it installs itself in all cmd shells and gives color output for cucumber.

Related

Flush output after every line in output window with external build tool

I'm wondering if it's possible to tell Visual Studio to print the output of an external build tool as it gets it.
I have an external build tool (JSIL) called from my .csproj file like so:
...
<Target Name="AfterBuild" Condition="$(JSIL) != 'building'">
<Exec Command="JSILc.exe $(SolutionPath)" />
</Target>
...
This works fine--the output goes to the Visual Studio output window. However, it seems that Visual Studio buffers the output of the command until it exits and then prints that output in its entirety all at once.
Since the JSIL compiler takes a relatively long time and has quite a bit of output, I would like for the output window to reflect that while building.
JSIL outputs commands by printing to stdout or stderr, but manually .Flush()ing these streams doesn't seem to affect the output window. Is there some special API that I need to call to update Visual Studio about the progress of a custom build tool?
Thanks!

How to make MSBuild print output from a custom tool?

I have a project, which use a .rules file to build some non-c++ sources. How to make MSBuild print diagnostic output from this tool? -- Precisely cerr stream.
(I silently presume, the M$ team have not reached that level of insanity, to give the custom building tools functionality without possibility to print errors from them.)
I've actually noticed you marked question with label visual-studio-2008. I guess it means your custom build tool processes non cpp files in vc2008 project? If so, I think it is not built by msbuild but with vcbuild.
In this case try to add echo on in front of command executed by custom tool.
Vcbuild creates batch files in %temp% that first line contains #echo off and then it is executed. So if you add echo on you should see complete output in output window including command line used for command execution.

Command Prompt vs System() in Visual Studio?

I'm attempting to use imagemagick to combine a bunch of .ppm files I create in Visual Studio, each a piece of an animation.
When I complete the program and get all of the output*.ppm files, I can go to my command prompt and say im-convert -delay 80 output*.ppm final.gif, it works perfect and creates the gif. However, using a system("im-convert -delay 80 output*.ppm final.gif"); call in my code, the result says that im-convert is not a recognized command.
I'm not sure how to go about fixing this. Does visual studio not use the same command prompt? Do I need to include the .dll for imagemagick somewhere else where that command prompt will find it?
Thanks :)

Does netbeans support coloring for .sh (bash) scripts?

I use netbeans 6.8 beta and when i load .sh (bash) file it's not colored at all. i can add a new file association for the .sh extension but it doesn't seem that there is a known associated mime type.
I have not tried this myself but you can get shell script support in Netbeans if you install the C/C++ plugin.
old question, time for an update (tested for 8.0.2,8.1,8.2).
Here's what worked for me
Install C/C++ plugin.
This will recognize .sh extensions as bash files
Install nb-noext-mime-resolver (for 8.2 you'll find it as No Extension MIME Resolver) . This will add support for files with no extension by recognizing the shebang line
Go to tools/options/editor/spellchecker and uncheck 'Script and make comments'.(not available after 8.2) This will get rid of the red squiggly lines that appear under 'usr' and other legitimate notations in the shebang line and elsewhere.
You'll get full syntax highlighting as well as the ability to right click and select 'run' which will launch your script in the built in terminal. very nice.
To get the context menu 'run' to work with your shell
Select 'Run'/'Set Project Configuration'/'Customize'
Click 'New' and add a name for your shell like 'bash' or 'cygwin'
Select 'Run As' 'Script (run in command line'
Where it says 'Php Interpreter' (or equivilent) add the path to your bash shell. e.g: C:\cygwin\bin\bash.exe
Click 'ok'.
Also, check out the properties of the bash files and you'll find some helpful ones.
This is very odd. I have NB6.8beta installed with the C/C++ plugin. When I open a .sh file I do see syntax high lighting. Quotes strings show up in orange, commands are in blue.

How to show linker command line in Build output, in Visual Studio?

This question is related to How to show command line build options in Visual C++ 2008
But in addition to showing the Compiler command line, I'd like to see the linker command line.
I have "unset" the /nologo option in the linker options.
But I still don't get the command line in the output window. What do I need to do? Is this possible?
Did you try viewing the build log? This is probably the closest to what you want to see. You view the output window, and where it says "Build log was saved at "path..."", ctrl-click on "path" and it will open the build log.
I often get burned by the wrong configuration being selected when I change things like suppress startup banner.
Did you try setting the selection when all configurations and platforms were selected?

Resources