bncs_buildTool

BNCS Build Utility

Description

bncs_buildTool is an evolution of the original utility "buildAllPanels".

This tool searches the given path for files of the given extension and then runs the specified command line against each entry from the resulting list.

So if you want to build all the panel projects in your system, search for all the project files and then run the compiler on each.

Configuration

It's extremely likely that you'll want to run this tool with standard tools/command lines so it has presets. These can be found in the config file:

%CC_ROOT%\bncs_buildTool.xml

Note: this is deliberately NOT contained within any particular system since the path to your compiler may be different from someone else's.

If you do not have CC_ROOT environment variable defined then the config is found in the same directory as the executable.

A default file is created if it doesn't exist, but this has paths to the tools on my system not necessarily yours so you might need to go in and adjust paths appropriately.

bncs_buildTool Command Line

The application accepts the following command line options

Argument | Notes
/preset=<value> | The preset to pre-load. This relates directly to the id in the XML configuration below
/stdout | Write the debug window to STDOUT Note this includes a certain amount of HTML
/fireAndClose | Run the selected preset on startup and close when finished
/configFile=<path> | Path to configuration file. At time of writing this cannot contain spaces.

Logging

The application writes the last debug output to

bncs_buildTool.log.html

which is located in the working directory of the application. This has a few simple HTML formatting tags to match the run-time view.

Formulating the Command Line to run

The command line used almost certainly wants to contain some element(s) of the search results. The following placeholders may be resolved dynamically:

Placeholder | Use
%CC_ROOT% | The contents of the environment variable CC_ROOT
%CC_SYSTEM% | The contents of the environment variable CC_SYSTEM
%TARGET% | The entire path to the current file
%TARGET_BASE% | The "base name" of the current file. i.e. if the path is: c:\myRoot\myProject\panels\myPanel\myPanel.vcxproj then the base name is myPanel (as shown above)
%TARGET_EXT% | The extension of the current file
%TARGET_PATH% | Just the path to the current file, not the filename

The tool is deemed to have succeeded if the return value from the command line is zero. If it's non-zero then it's deemed to have failed. This seems to work with most things

Sample Configuration

The following configuration was used during development of this utility:

<build>
    <preset id="Visual Studio 2013 Rebuild Release">
        <commandline>"c:\program files (x86)\microsoft visual studio 12.0\common7\ide\devenv.com" "%TARGET%" /rebuild Release|Win32</commandline>
        <extension>*.vcxproj</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
    <preset id="Visual Studio 6->2013 Project Upgrade">
        <commandline>"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vcupgrade.exe" "%TARGET%"</commandline>
        <extension>*.dsp</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
    <preset id="Visual Studio 6 Rebuild Release">
        <commandline>"C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin\msdev.exe" "%TARGET%" /make /rebuild "%TARGET_BASE% - Win32"</commandline>
        <extension>*.dsw</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
    <preset id="Visual Studio 2013 EXPRESS">
        <commandline>"C:\Program Files\MSBuild\12.0\Bin\msbuild.exe" /p:configuration=Release /p:platform=Win32 "%TARGET%"</commandline>
        <extension>*.vcxproj</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
    <preset id="Visual Studio 2015 EXPRESS">
        <commandline>"C:\Program Files\MSBuild\14.0\Bin\msbuild.exe" /p:configuration=Release /p:platform=Win32 "%TARGET%"</commandline>
        <extension>*.vcxproj</extension>
        <root>%CC_ROOT%\%CC_SYSTEM%\panels</root>
    </preset>
</build>

Points to note

  • command line is quoted if there are spaces (or likely to be spaces within the replaced text e.g. %TARGET%)
  • you can have as many entries as you like

User Interface

The user interface is pretty stupid.....there is a scrolling list of the output from the command line (both STDOUT and STDERR).

On the second tab there is a list of the paths that caused the tool to detect failure (non-zero return value). Single clicking these shows the build output from that step in the lower pane. Double clicking tries to open that path using whatever tool Windows has configured for that extension.

V3

I was going to include the settings for V3, but there are too many hard coded paths to make this useful.

This is what it looks like for me - to use it you need to modify the paths:

  • to the directory where your panels exist (in command line and root)
  • to the batch file to build the panels (build_32bit.bat)
  • to the location of the fresh copy of applcore.exe to bind the UIs
  • to the location of the resource compiler brc32
<preset id="ApplCore Rebind">
    <commandline>"c:\build_32bit.bat" "c:\panels\%TARGET_BASE%"</commandline>
    <extension>*.rc</extension>
    <root>c:\panels\TestPanels</root>
</preset>

...and the batch file referred to (build_32bit.bat) is:

del %1.exe
copy C:\applcore.exe %1.exe
c:\bc45\bin\brc32 -fe"%1.exe" "%1.RC"
exit %errorlevel%

Version Control

Version | Date | Author | Comments
 |  | David Yates | initial release not versioned
1.0.1.0 | 28/01/14 | David Yates | adds failure list minor fix to build step (& removes commented code)
1.0.2.0 | 03/02/14 | David Yates | makes configurable based on presets, adds help
1.0.3.0 | 04/02/13 | David Yates | disables the path/ext controls when the go button is hit
1.0.4.0 | 16/02/15 | David Yates | fix to file browser destination
1.0.5.0 | 19/02/15 | David Yates | writes default config if the file doesn't already exist
1.0.6.0 | 23/10/15 | David Yates | icon to modern standard
1.0.7.0 | 03/02/17 | David Yates | adds TARGET_EXT and TARGET_PATH to text substitutions adds ability to set working directory for tool fixes long-standing issue with reading stderr
 | 27/02/17 | David Yates | Docs conversion to markdown
1.0.8.0 | 03/03/17 | David Yates | Gives command line parameters and log of last run
1.0.9.0 | 06/03/17 | David Yates | Adds configurable "return value for success" value Tiny bugfix to enable state of the working directory edit box
1.0.10.0 | 06/03/17 | David Yates | Adds /configFile command line option
1.0.11.0 | 02/10/17 | David Yates | CORE-162 Trivial fix to open help file with same name as executable
Build: bncs_4.7.5 5800 a1b48197a Atos|Syntel © 2021