blackberry/VSPlugin — pull request #666 by phofman (2014-10-10 00:25:22+00:00)
Title: Optimized MSBuild and Cascades application projects support

This time I am providing another set of refactorings and additions around MSBuild integration and the project behaviors. The intention was to simplify build steps and improve developer's experiences around it.

Biggest changes:
* added Cascades applications support
* removed 'BlackBerrySimulator' platform (you can still build for simulator!)
* package exposes services for the BB DebugEngine - to provide local path of binary executed on the device and to discover a device to attach

The most important changes are around MSBuild files, they now:
* VS2010 uses the legacy version, tweaked to match features introduced in newer versions (differences: some default values for project settings are not identical)
* VS2012 and VS2013 share exactly the same *.targets and *.props codebase - the difference in naming is handled by file linking in VS2013 project itself and thanks to that done on the fly!
* all versions share the same rules *.xml files, designed in the way to replace totally the default VisualStudio settings for C/C++ projects (see attached image)
* extended support to 3 types of BAR projects (ignored if build a dynamic/static library project):
- *regular* as known before, where the whole makefile is generated (and placed inside $(OutDir))
- *cascades*, where makefile is placed inside the project directory and only the *.pri file is automatically generated based on files included in project
- *custom*, where nothing is automatically generated and build simply invokes makefile located in project's directory

---------
Detailed changelog:
* added GdbHost.exe as part of all the VSIX packages to simplify deployments
* changed the location, where registry settings are stored
* extended registry settings with paths to: QNX-tools, bbndk_vs and JavaHome (can be set via plugin's options pages)
* implemented persistent log manager (logs that appear in "BlackBerry" and "BlackBerry - GDB" tabs are stored in a file, if the folder is defined in options of the plugin)
* DebugEngine doesn't use WinForms message-boxes anymore (updated to use Visual Studio Shell ones)
* package exposes a service to discover a device (used by the 'Find...' button, when attaching to device; no need to develop UI in DebugEngine)
* package exposes a service to locate output binary matching the attached process (using evaluation of opened projects' properties - no need to build them and then parse logs) and in case of failure (as *cascades* and *custom* types might define the outcomes in totally random places) it displays the UI allowing user to specify the path; this feature is used when attaching to the running process or when starting the process in debug mode by F5 hit
* removed 'BlackBerrySimulator' hassle, as it was unnecessarily duplicating all MSBuild files; now to build for simulator it enough to change the Target CPU in 'General' project settings; this change will also automatically instruct the deployment tool, which selected device or simulator to use
* *regular* project has added support for $(TargetExt); so the main executable binary can have an extension and when non-empty stop issuing this magic MSBuild warning (however by default extension is empty!)
* extended PATH env variable to make sure *make.exe* is taken from proper NDK (as previously it could be affected by Cygwin installation)
* ported makefile generator from 'custom code' to T4 (which is much easier to read); the *.pri generator was also created using T4
* *regular* projects will receive dedicated defines if build targets tablet, phone and simulator, so it's possible to build-in dedicated code in OpenGL games for all those platforms
* updated BBNativePackager wrapper:
- not to crash, when 'translations' section of bar-descriptor.xml in Cascades app is empty
- allow translations of the application title and description (updated XSD for bar-descriptor)

* fixed few observed crashes and other misbehaviors, plus some UX improvements on few dialogs

In my opinion thanks to those features this plugin deserves the v3.0 badge. The really missing part now are the project and project-item templates. I will try to create at least some simple ones shortly.

![Cascades project settings](https://cloud.githubusercontent.com/assets/475630/4585748/e0a93320-500a-11e4-9476-ee123bc17ed2.png)