Fork me on GitHub
vsSolutionBuildEvent API

vsSolutionBuildEvent API The vsSolutionBuildEvent is also provides the API level. This can be used with any external application for work with events/actions. For example, this is already implemented in our products as part of vsSolutionBuildEvent project: CI.MSBuild - for work through msbuild.exe (Microsoft Build Tools) Devenv Command-Line - for work through devenv of the Visual Studio Where to begin Scheme of vsSolutionBuildEvent projects: Bridge Download Bridge_v1.4_[50e9a29][net40].zip (SourceForge.net) ~8Kb All binaries of the Bridge: /API/Bridge/ You can use Bridge for accessing to our products. This contains specification of all available features from the vsSol ...

Continuous Integration (CI)

Continuous Integration (CI) world without Visual Studio. The vsSolutionBuildEvent supports CI features [?] and may work without Visual Studio at all. This is possible with additional components: CI.MSBuild - for work via msbuild.exe (MSBuild Tools) To get CI.MSBuild in one click ~10 Kb: get.CIM.bat (Compiled by GetNuTool) Devenv Command-Line - for work via devenv instance of the Visual Studio Other utilities The vsSolutionBuildEvent provides API level. It easy to support any other places. Developer Zone For questions VS + MSBuild & after.<name>.sln.targets Don't forget about after.<name>.sln.targets features if you only need unified a ...

vsSolutionBuildEvent CI.MSBuild

vsSolutionBuildEvent CI.MSBuild Utility to support the CI /Build servers for work with vsSolutionBuildEvent via msbuild.exe (Microsoft Build Tools) see Devenv Command-Line if you need command-line mode of Visual Studio(devenv.exe /.com) How to get & Install Use get.CIM.bat (~10 Kb) to get it in one click. (Compiled by GetNuTool) How to configure project that does not use Visual Studio at all. Currently the CI.MSBuild it's only additional wrapper (~50 kb) for work with vsSolutionBuildEvent plugin through API. You should also have this library for work it means. However, variant with NuGet is also provides main libraries for complete work. Use any conveni ...

vsSolutionBuildEvent Devenv Command-Line

vsSolutionBuildEvent Devenv Command-Line Utility to support the command-line mode of the Visual Studio for work with vsSolutionBuildEvent through Devenv Please note: you can use the CI.MSBuild utility for work through msbuild.exe for special build server etc. The Add-ins are deprecated in Visual Studio 2013 and removed in 14CTP's (also in VS2015 RC) Therefore, this utility supports the next versions: Visual Studio 2010, 2012, 2013. (Want to see in VS2015+ ?) The command-Line features are not available for VSPackages and this possible only with our tricks This reported on MS Connect Issue #1075033 and you can vote or comment here if you want to see this feature on newer versions! ...

Developer Zone

Developer Zone How to build New Component for SBE-Scripts core IPM analyzer Dom & Code Completion API Scheme of vsSolutionBuildEvent projects Ask a question ...

How to build

How to build vsSolutionBuildEvent Branches status: Source Code Nightly builds Snapshots Please note: latest cf21313 revision provides new structure of project files by the new vsSBE.SDK. Now you can use a single vsSolutionBuildEvent.sln and more freely use both .NET 4.0 and 4.5 Variant for Visual Studio Current variant is more convenient for develop & debug. Other are contained below. Requirements C# Language version support: C# 6.0+ starting after 2616b53ae03e9795584cfcde38df4b4bda56e818 C# 4.0+ initially MS Visual Studio 2010 or higher (You can use free Visual Studio Community 2013 or higher) Installed Microsoft Visual Stu ...

Create component for SBE-Scripts core in 5min.

Create component for SBE-Scripts core in 5min. For a quick lexical analysis of properties and methods, you can use our IPM analyzer - It allows to quickly prepare for semantic analysis all of what you want… All components should implement the IComponent interface. Also available abstract Component for rapid implementation of all new features. The Component is already contains basic behaviours with available data. Therefore, create the new component is really easy. DemoComponent Let's try to create new 'DemoComponent' step by step. All components should have postfix Component as part of name, for example: MathComponent Add new class in path /SBEScripts/Components/DemoComponent.cs ...

Developer zone. SBE-Scripts

Developer zone. SBE-Scripts Dom & Code Completion IPM analyzer for SBE-Scripts core ...

Dom & Code Completion

Dom & Code Completion Optional, you can describe your component with SBEScripts/Dom for code completion (Intellisense) or to any generation of documentation. It's easy with next attributes: PropertyAttribute To describe the properties of the component. For example: [Property("propertyName", "Description of the property", CValueType.Boolean, CValueType.Boolean)] protected string yourLogic() { ... } [Property( "IsBuildable", "Gets or Sets whether the project or project item configuration can be built.", "find", "stProjectConf", CValueType.Boolean, CValueType.Boolean )] Syntax: [Property(string name, string description, CValueType get, CValueType ...

IPM analyzer for SBE-Scripts core

IPM analyzer With latest changes you can also use our IPM analyzer for parsing of any properties & methods. It useful for a quick implementation of any logic for new or existing component. Overview All magic of this starts with: IPM pm = new PM(data) Where data it's your raw data 'as is'. Then, you can work with parsed data via pm instance. How about calculating the hash value with MD5 & SHA-1 ? and possible syntax like this: #[Func hash.MD5("test")] #[Func hash.SHA1("test")] ok, here's how to (all minimal logic): IPM pm = new PM(data); // pointed to - ILevel lvlHash // hash.MD5("data") if(pm.FinalEmptyIs(LevelType.Method, "MD5")) { lvlHash.Is("hash.MD5(string da ...

Available Events

Available Events Pre-Build - Before build. Post-Build - After build. Cancel-Build - by user or when occurs error. CommandEvent (DTE) - The Command Events from EnvDTE. Warnings-Build - Warnings during assembly processing. Errors-Build - Errors during assembly processing. Output-Build - Customization and full control by using listener. Sln-Opened - When solution has been opened. Sln-Closed - When solution has been closed. Transmitter - Transmission of the build-data to outer handler. Logging - All processes with internal logging. Information for this section is not complete or temporarily is not available. To fix it, click - ...

CommandEvent (DTE)

CommandEvent (DTE) This can be used for catching of the command events from your VS IDE. For advanced work with all commands beyond of the solution level, use the vsCommandEvent Also available Sniffer as helper for listening all commands from EnvDTE: Find and add all what you want, configure it after, then use with available modes. Get the last command You can use DTEComponent of SBE-Scripts core. Samples: $(lcGuid = #[DTE events.LastCommand.Guid]) $(lcId = #[DTE events.LastCommand.Id]) #[($(lcGuid) == "{1496A755-94DE-11D0-8C3F-00C04FC2AAE2}" && $(lcId) == 1627) { #[File scall("notepad", "#[var log]", 30)] }] or you can use C# Mode etc. References ...

Pre-Build

Pre-Build event It will be triggered when the build is started. Solution-context By default, your actions should be activated before first project at once. To be precise, it works before any build of your projects (solution-context). You should note this if you want to work with cancel command and similar. (the cancel can be executed only when the build is started at least for one [?]) Projects-context also known as Deferred Pre-Build To switch to current context you can use any from the following below. Execution order Execution order list: Select one or more available projects from this list. 'OR logic' between all records: if you select 2 or more project in list, t ...

Sln-Opened

Sln-Opened v0.12.7+ It will be triggered when solution has been opened. This especially useful for definition of new properties at runtime for your solution (to solve problems like this). For the same or similar case it can be is really easy for this event type: Add action for Sln-Opened event. Enable MSBuild support. Define what you need: $(+ProjectName = 'MyUnifiedName') Activate event and click [Apply] Enjoy. Context [ v0.12.8+ ] The new version provides additional contexts of Sln-Opened events. What does it mean ? Working in Visual Studio IDE you may have the following cases: When you need to do something Before initializing projects, for example: ...

Examples

Complete solutions Automatic Version Numbering Manually Wizard - Automatic code generation Simple variant Artefacts. How to prepare as you want Stop build on first error Demo projects Reload projects in solution Advanced work with Git submodules Native scripting. World without Visual Studio Some features Math operations Date & Time .vssbe File format & Unified Project name for different .sln Actions for specific configuration Solution-wide Build Events Confirmation dialog Work with Unit-Tests & EnvDTE Exclude projects from build on Pre-Build event Work with external utilities Increment & Decrement Numbers ...

Artefacts. How to prepare as you want

Artefacts. How to prepare as you want About different Environments Firstly, it doesn't matter where the planned use this script. It can be unified for all environments. It means you should see the same result as for your PC with Visual Studio (for example) and same for X Build Server (CI): Read first: How to work with CI components. .vssbe for each .sln Releases from a few projects Full example you can see in our project: Full script for assembling the vsSolutionBuildEvent v0.12.6 (actual version in current script file) As result you will see this files (i.e. only for example - your variants can be as you want) for deploy or for simple use. Sample: File ...

Demo projects

List of available demo projects as example of basic work, features and similar. Real projects Some features and scripts you can see on the following latest real projects: https://github.com/3F/Conari https://github.com/3F/LunaRoad https://github.com/3F/DllExport CI.MSBuild.Demo For work with MSBuild Tool or for work without Visual Studio you have a few ways. And if your choice the CI.MSBuild you also should select how it will be automatically distributed on another machines (where some of this utilities may not exist at all). The most easy variant it is the non-binary GetNuTool ~8kb. However, you can also use standard NuGet clients and any other tools. In samples below we'll c ...

Stop build on first error

Stop build on first error Immediately stop(at the same time) after the first appearance. For example, If you also used StopOnFirstBuildError before, you can see - that it not resolves important problem for big projects or/and for slow machines… A quick example what it means: If your each project in your solution requires a long time for full compilation (~5-10min average for example)… Well, congratulation.. you still should wait the end of building project where error occurred(~5-10min average for example). Why ? and Why is not exists any settings for this ? we don't know but this is so because the StopOnFirstBuildError used subscription with OnBuildProjConfigDone. However th ...

Git Solutions

Git Solutions Advanced work with Git submodules ...

Advanced work with Git submodules

Advanced work with Git submodules Restore all git submodules when opening Visual Studio IDE Before v0.12.8 you have this way. But now it can be much more easier. Add Action for Sln-Opened event. Set Context: Before Select Script Mode Then add simple script: #[$(moduleConari = "Conari/Conari.sln")] #[( #[IO exists.file("$(moduleConari)")] ) { #[File scall("submodules.bat", "$(moduleConari)", 400)] } else{ #[File call("submodules.bat", "$(moduleConari)", 2000)] }] Create in solution directory submodules.cmd: @echo off echo. checking submodules ... if not exist "%1" goto restore REM ... goto exit :restore echo. echo. We detected that you need to update git submod ...

Native scripting. World without Visual Studio

Native scripting. World without Visual Studio You already should know that we can work without Visual Studio at all. Read about CI Features, configure and have fun. But wait ! What about if you need some scripting via vssbe, but you do not have the .sln, .csproj, .vcxproj, … and any other project files for X place (where you need this). The basic example of this case - GetNuTool project. How to Execute the following command inside parent folder of your files: echo Microsoft Visual Studio Solution File, Format Version 11.00> vssbe.sln Now you can configure .vssbe as you like (via IDE or change it manually) Then create ~ build.bat: To restore vsSolutionBuildEven ...

Reload projects in solution

Reload projects in solution In some cases you may need automatically reload your projects in solution. For example, you have added git submodules for your projects, and you want to update/get it automatically after cloning of your repo when .sln is opened in first time. Starting with v0.12.8 you have also the Contexts for Sln-Opened event. Modern way to Restore all git submodules when opening Visual Studio IDE How to Select event type, for example the Sln-Opened to reload projects when you open Visual Studio with your Solution. Then, add action with C# Mode Now you can write code, for example: https://gist.github.com/3F/a7f8eeb59ade9139d4da4862e03ee ...

Automatic Version Numbering - Variants

Automatic Version Numbering [ View ] Wizard Automatic code generation [ View ] Simple variant The most easy manually way. [ View ] ...

Automatic Version Numbering

Automatic Version Numbering You can also use the Wizard. Easy steps for quick results. The most easy manually way here. Before reading, please note: You can achieve this (or similar) result with our different modes. For simplicity, we consider the Script Mode. However, feel free. Use any other variants if you don't like this, for example: Targets Mode or C# Mode, or with simple caller and other Synopsis This method should automatically generate the Version class, e.g.: ↘ // This code was generated by a vsSolutionBuildEvent. namespace example { internal class Version { public static readonly System.Version number = new System.Version(0, ...

Simple Version Numbering

Simple Version Numbering Did you know: The most easy versioning for your projects can be lighter than it described in 'Manually variant'. And if you want configure all this manually instead of a Wizard, I'll tell you about a simple but still powerful way. Real projects Firstly, you can look this trivial variants on real projects, for example: https://github.com/3F/Conari https://github.com/3F/LunaRoad https://github.com/3F/DllExport Currently all this above has been configured by this simple scheme. How to In 'Manually variant' we create a template of 'Version' file, then generate all of what we need. But here we will create a 'normal Version file' (file that's already sto ...

Wizard - Automatic Version Numbering

Wizard - Automatic Version Numbering Automatic code generation The current code generation wizard is available for v0.12.5+ How to Open wizard from Settings - Wizards - Automatic Version Numbering and choose type of generation. What available: C# Struct C++ Struct C++ macro definitions ( #define ) Direct replacement Configure all required fields for each steps and move to final by pressing Next step ... After the all required steps for selected type you will see final script for SBE-Scripts engine: That's all. The final complex script should be evaluated with our engine, so simply add new action and smile :) You can create new action immediatly from this by clicki ...

Features

Some features Actions for specific configuration Confirmation dialog / Prompt window Custom counters Date & Time ...

Actions for specific configuration

Actions for specific configuration For v0.9+ You can use an additional option "Actions for specific configurations" (see below) or conditional statements with SBE-Scripts core. Turn on support: SBE-Scripts & MSBuild in control window. And use for example: #[( $(Configuration) == "Debug" ){ ... }] also you can check only part of the name, e.g.: #[($(Configuration) ~= "_with_revision") { All configuration with names: * Debug_with_revision, * Release_with_revision, etc. }] and similar. /See ConditionComponent for more details For v0.8+ Actions for specific configurations has been introduced in v0.8 Simply: Select the event type, mode, add the ...

Confirmation dialog / Prompt window

Confirmation dialog / Prompt window In latest versions you can use special option for your scripts. Simply add any action type for any events In Control section set the Confirmation option. This can be useful for most operations. However you can also use own dialogs, see below. Custom dialogs You can use any own dialog if needed, for example: Activate SBE-Scripts support Use script for example: #[(#[File sout("cscript", "//nologo dialog.vbs")]) { ... your action if 'Yes' }] Where dialog.vbs it's a simple vbscript with msgbox, for example: ' Sample of dialog ret = MsgBox("... information ...", vbAbortRetryIgnore + vbDefaultButton3 + vbExclamation , "Custom ...

Custom counters

Custom counters Should be enabled the MSBuild & SBE-Scripts. Increment & Decrement Numbers Syntactic sugar of v0.12.8+ v0.12.8+ Contains syntactic sugar: += & -= #[Box iterate(i = 0; $(i) < 10; i += 1): ... $(numA += 3.14) $(numB -= 1) ] other Very old examples: Read Math page + please fix me Information for this section is not complete or temporarily is not available. To fix it, click - Edit Example of counter in the range 1 - 10: #[( $(counter) == "*Undefined*" ) { #[var counter = 0] }] $(counter = $([MSBuild]::Add($(counter), 1))) #[" The va ...

Date & Time

Date & Time Should be enabled the MSBuild support. In examples below, we use the MSBuild Property Functions and you can use any static method or property of these system classes: System.DateTime System.TimeSpan System.Math System.String System.Decimal System.Double System.UInt32 System.Int32 … Format & Culture Custom Date and Time Format Strings Standard Date and Time Format Strings Sortable format: ~ yyyy/MM/dd, e.g.: 2016/08/21 for InvariantCulture For specific culture, use for example: $([System.DateTime]::Parse("21.08.2016", '$([System.Globalization.CultureInfo]::GetCultureInfo("ru-RU"))')) $([System.DateTime]::Parse("08/21/2016", '$([System.G ...

Work with Unit-Tests & EnvDTE

Work with Unit-Tests & EnvDTE This especially useful for old Visual Studio 2010 where are not exists simple settings to run tests after the build of your application etc. Please remember: newest versions >= VS2012 contains settings for this. See How to. What's exist for VS2010: MSDN: Configure and Run Scheduled Tests After Building Your Application MSDN: Run Automated Tests from the Command Line Using MSTest vsSBE provides flexible actions and also may work with EnvDTE environment. So you can simply run all tests after build, e.g.: Use Operation Mode for your action. Select the operation - "Run all Unit-Tests" or "Debug all Unit-Tests". Optional set specific configu ...

Exclude projects from build on Pre-Build event

Exclude projects from build on Pre-Build event It appeared after request from Q/A (related issue) So if you want activate or deactivate any projects when build is started… well it's possible with vsSolutionBuildEvent How ? This feature is part of SBE-Scripts (controlled by BuildComponent). Therefore you should activate support of this engine. Ok, it's simply… You should use IsBuildable property for get/set value of selected project(s). #[Build projects.find("name").IsBuildable = true|false|1|0] #[Build projects.find("name").IsBuildable] Where name is project name in your solution, for example: "bzip2.vcxproj" "Zenlib\ZenLib.vcxproj" etc. Examples Set true value if n ...

Work with external utilities

Work with external utilities Basic work All simple modes like Files Mode, Interpreter Mode can be used for work with any external utilities. You can call what you want and easy get result from the output (STDOUT, STDERR). For example (old samples): get changes between revisions update revision with data from SCM - git parsing of .html files and generating cshelp.h with C++ macro definitions However! you can much more. see below Advanced work A complex work with data from any external tools and features that are not available for MSBuild: Select suitable mode: Processing modes Try to use existing component of SBE-Scripts engine like: FileComponent - IO operations, i ...

Math operations

Math operations Remarks Numbers in scientific (exponential) notation For example - Double.Parse(): $([System.Double]::Parse('1,19E+7')) $([System.Double]::Parse('1.19E+7')) - Fail: The expression "[System.Double]::Parse(1.19E+7)" cannot be evaluated. Input string was not in a correct format. To avoid error above (for your selected culture) you can use, for example: $([System.Double]::Parse('1.19E+7', '$([System.Globalization.CultureInfo]::GetCultureInfo("en-US"))')) $([System.Double]::Parse('1.19E+7', '$([System.Globalization.CultureInfo]::CurrentUICulture)')) $([System.Double]::Parse('1.19E+7', '$([System.Globalization.CultureInfo]::CurrentUICulture.NumberFormat)')) $([System.Double ...

Remote servers

Remote servers For work with remote servers you can use any available variants from available modes v0.12.6+ is already contains features for work with remote servers. Use FileComponent FTP - C# Mode Upload Artefacts and similar Activate C# Mode Add 'System.dll' reference in Compiler - References Customize cache and check other available flags of optimization. (optional) Use next code, for example: using System; using System.Net; using ICommand = net.r_eg.vsSBE.Actions.ICommand; using ISolutionEvent = net.r_eg.vsSBE.Events.ISolutionEvent; namespace vsSolutionBuildEvent { public class CSharpMode { public static int ...

Solution-wide Build Events

Solution-wide Build Events All your actions for Pre-Build / Post-Build events are already can be for all projects at once or individually for each. (You should remember this for work with MSBuild engine etc.) It should be useful for most cases, for example: Automatic Version Numbering for your projects. Or simple notification like ~ send email before/after building of all projects: mail('yourmail@example.com', 'Build completed', date('H:i:s')); and other. Use it with simple caller (external logic) or as internal scripts with any interpreters such as php, python, PowerShell, Wscript, Node.js, etc. Or use powerfull MSBuild & SBE-Scripts engines, etc. For more complex script ...

Operations with strings

Operations with strings Did you know: v0.12.10+ has multiline support for MSBuild expressions via MSBuildComponent: #[$( [System.TimeSpan]::FromTicks('$( [MSBuild]::Subtract( $(tNow), $(tBase)) )') .TotalMinutes .ToString('0'))] Concatenation v0.12.8+ Contains syntactic sugar +=: $(desc = "Hello ") $(desc += "world !") or you can use: $(desc = "Hello ") $(desc = $([System.String]::Concat($(desc), "world !")) ) Remove newline characters and other problematic symbols Some your results may contain a some problematic characters for different functions. In most cases this applies to MSBuild Property Functions. You can use System.String sta ...

Tricks with strings

Tricks with strings Some additional custom tricks of common operations with strings -> Operations with strings v0.12.6+ Allows evaluation of string arguments with MSBuild engine in File/Function/BuildComponent + some newer. You can also use the MSBuildComponent to force evaluation if still needed. Did you know: v0.12.10+ has multiline support for MSBuild expressions via MSBuildComponent: #[$( [System.Math]::Exp('$( [MSBuild]::Multiply( $([System.Math]::Log(10)), 4 ))' ) )] Did you know: The UserVariableComponent allows the multiline mixed definition: #[var arg = cd \"D:/tmp/\" dir cd .. dir] #[var arg = $(arg.Replace ...

vsSolutionBuildEvent/vsSBE (.vssbe) File

.vssbe All shared settings will be located in solution directory as .vssbe text-based file. v0.9+ uses the JSON format (text-based language-independent data interchange format) You can also ignore this from your repo with scm if needed (.gitignore, .hgignore, .bzrignore, svn:ignore, etc.,) Samples Simple .vssbe from GetNuTool project: for build, test, and zip-packing of binaries. .vssbe for each .sln (Solution File) For v0.11.2+ you can also define the special version of configuration file for specific solution. <SolutionFile>.vssbe For example: If you have a different solution files: app_2012.sln app_2013.sln etc. you can also define specific configuration like t ...

Installation

Installation and removal VSPackage The main plugin. Contains logic for work with events of Visual Studio and core of different actions for anything. To install: Get latest build vsSolutionBuildEvent_v0.12.10.10901_[d37fe51][net40].vsix and restart VS IDE. That's all. If you received file with different extension: simply change on .vsix or install manually with command: VSIXInstaller.exe <downloaded_file> Note: Other problems with getting plugin (Error 500 etc.) try to ask here (our hosting provider) To remove: VS IDE - Tools - Extension and Updates ...: Uninstall or Disable If you need manually: VSIXInstaller.exe /uninstall:94ecd13f-15f3-4f51-9afd-17f0275c6266 CI.MSB ...

How to correctly report

How to correctly report Next information will be helpful: Your version and edition of Visual Studio. For example: VS2013 Professional Version 12.0.30501.00 Update 2 The Version of vsSolutionBuildEvent where you see bug or some problem. The other version where problem not exists if you know. Logs: To enable 'Debug Mode' and reproduce problem again. Any dump of crashes - minidumps or simply like this And most importantly: Steps of how to reproduce your problem. + additional information if you think that's necessary to report: projects type (e.g. C#, C++, ..), data, environments, full moon tonight, and another … Remeber: We support the ...

Processing modes

Processing modes C# Mode Files Mode Interpreter Mode ...

C# Mode

C# Mode This action type for work with C# compiler - feel free with all events & actions. Available control of caching bytecode and full access to ICommand & ISolutionEvent (see /Events) Default Entry point using ICommand = net.r_eg.vsSBE.Actions.ICommand; using ISolutionEvent = net.r_eg.vsSBE.Events.ISolutionEvent; namespace vsSolutionBuildEvent { public class CSharpMode { public static int Init(ICommand cmd, ISolutionEvent evt) { return 0; } } } Compiler settings References Additional assembly names that are referenced by the source to compile. You can use any formats below, for example: EnvDTE.dll C:\WINDOWS\assembly\GAC\E ...

Files Mode

Files Mode This is very simple action type for executing any external files 'as is'. After selecting of this mode you should write file name or list of file names (separated by enter key) with arguments if needed. Note: The solution directory is used by default for all your relative paths or simple file names. You can also enable MSBuild & SBE-Scripts engines for customizing of this list in details. Sample: rev.exe -b 1024 c:\tmp\build.bat $(SolutionDir)\clean.bat Options Information for this section is not complete or temporarily is not available. To fix it, click - Edit Time limit How long to wait the exectio ...

Interpreter Mode

Interpreter Mode This is very simple action type for work with external streaming-interpreters (that allowed running code directly as command). For this mode you should configure used interpreter: Name or full path to executable file with arguments for processing your command below. For example: php -r, or cmd.exe /C, etc. treat newline as option: It allows assign any combination of symbols instead of newline from your command below. wrapper: Use this if also requires escaping of the same characters in your command/script. If used 1 symbol, for example - ": Will be escaped all this in your command/script and result should be as " + c ...

Operation Mode

Operation Mode This action type allows executing the DTE-commands for your Visual Studio. After selecting of this mode, you should write command or list of commands (separated by enter key) with arguments if needed. DTE-Commands All available commands for your IDE you can see with UI-Helper: Settings - Tools - DTE-Commands For testing of commands, you can try with testing tool: Settings - Tools - Execution DTE-Commands a few commands should be separated by newline in your list Examples Activation of specific configuration & platform Build.SolutionConfigurations(Debug) Build.SolutionPlatforms(x86) To cancel build operation Build.Cancel Multiple mixed DTE-Commands ...

Script Mode

Script Mode This action type provides the internal support of scripts from available engines like MSBuild, etc. You can also use other modes for work with any external engines if needed. What's available now ? SBE-Scripts MSBuild References Processing modes Examples & Features Date & Time Operations with strings Automatic Version Numbering ...

Targets Mode

Targets Mode This action type for work with MSBuild Targets / Tasks etc. 'as is' (classic compatible mode). Blank Project v0.12.4+: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Target Name="Init"> <!-- ... --> </Target> <!-- Additional properties: $(ActionName) $(BuildType) $(EventType) $(SupportMSBuild) $(SupportSBEScripts) $(SolutionActiveCfg) $(StartupProject) --> </Project> Obsolete variant: <?xml version="1.0" encoding="utf-8"? ...

Create new page

Create This Wiki works via GitHub services, so simply click here Then create or select any subpath from _doc/ directory and name your file as you want with .md extension. Just add the following header: --- layout: doc title: <Your title> permalink: /doc/<path>/ --- Where <path> should be to .md file without extension. For example, set /doc/My-Page/ if you will add the My Page.md in root _doc directory. Now you're ready to create your awesome page below from this header. Use markdown syntax or see existing pages. Markdown syntax Test on this page https://guides.github.com/features/mastering-markdown/ Highlighting Use this ...

Scheme of vsSolutionBuildEvent projects and their work

Scheme of vsSolutionBuildEvent projects It describes the structure of existing components, illustrates scheme of their work and also shows how it works for Visual Studio Command-Line, MSBuild tools, etc. Basic scheme for v0.12+ Where: vsSolutionBuildEvent The vsSolutionBuildEvent - is the main plugin as a VSPackage. Contains main logic for work with events of Visual Studio via Microsoft.VisualStudio.Shell.Interop. Implements basic model of events with IVsSolutionEvents and IVsUpdateSolutionEvents2 Works with priority processing (i.e. with 'Advise..' methods instead of simple subscription with Events from DTE). See MSDN for more details. Distributed as .vsix for IDE Visual Stud ...

Scripts & Commands

Scripts & Commands The vsSolutionBuildEvent provides advanced actions for all events. User scripts and commands as part of this: SBE-Scripts MSBuild Processing modes - Available modes with C# & MSBuild Targets, etc. References Examples & Features ...

MSBuild

MSBuild The Microsoft Build Engine which is also known as MSBuild. This page contains information of how to work with MSBuild in vsSolutionBuildEvent context. Additional syntax & basic samples are contained below. For work with MSBuild Tools (Microsoft Build Tools) use the CI.MSBuild. For work with MSBuild Targets, Tasks and others, use the Targets Mode. You can also use the SBE-Scripts engine for additional features as a conditions, subcommands, file operations, etc.   MSBuild Property & Property Functions MSDN - Property Functions The vsSolutionBuildEvent uses additional syntax for select specific project. This is so because this can be used for all projects ...

SBE-Scripts

SBE-Scripts SBE-Scripts - it is our engine for additional work over MSBuild - conditions, subcommands, file operations, etc. by components. you can use this as an additional variant and/or if need a some features, for example, special for Visual Studio etc. all of that are not exists/available with MSBuild Components ...

SBE-Scripts. Available Components

SBE-Scripts. Available Components BoxComponent Container of data for operations like a template, repeatin ...

BoxComponent

BoxComponent [ v0.12.8+ ] Container of data for operations like a template, repeating, etc. repeat Executes a block until a specified expression evaluates to false. Available syntax repeat(expression condition [; boolean silent]): mixed data Where: condition - Conditional expression like ((1 < 2) && true) etc. - see examples in ConditionComponent silent - Flag of silent mode. Samples: #[Box repeat($(i) < 10; true): #[File append("test.txt"): #[$(i)] ] $(i = $([MSBuild]::Add($(i), 1))) ] #[Box repeat($(flag)): ... ] iterate Executes a block when condition is true. Available syntax iterate(initializer; condition; iterator): ...

BuildComponent

BuildComponent Managing of build process at runtime. And similar operations for projects and solution. Available operations cancel To immediately cancel the build task if it's possible. Syntax: void cancel = boolean Sample: #[Build cancel = true] projects Work with configuration manager of projects through SolutionContexts. find() To find project by name. It compares part of name, therefore you can use simply like a "ZenLib" or full name "Zenlib\ZenLib.vcxproj" etc. Syntax: #[Build projects.find("name")] IsBuildable Gets or Sets. Whether the project or item configuration of project can be built. Associated with current SolutionContext. Syntax: #[Build projects.find("n ...

CommentComponent

CommentComponent The comments for scripts. Tip: the alternative way to fully avoid evaluation from containers of any components - simply remove the first symbol #. Available syntax The multiline comment: #[""] Samples: #[" Example " Description 1 " " Description 2 " "] #[" Example "] #[" To restore packages with GetNuTool It's important for packages of solution-level in VS2015 https://github.com/NuGet/Home/issues/522 TODO: later it can be as part of engine... "] #[($([System.Convert]::ToInt32("$(VisualStudioVersion.Replace('.', ''))")) >= 140) { #[var msbuild = "$(MSBuildToolsPath)\msbuild.exe"] #[IO scall(#[var msbuild] ...

ConditionComponent

ConditionComponent Conditional statements for scripts. Syntax #[(condition){ body if the condition has true value } else{ body if the condition has false value }] #[(condition){ body if condition has true value }] Available operators ===, !==, ~=, ==, !=, >=, <=, !, >, < v0.11.3+: ^=, =^ Rules of comparison: === Compares as: left == right as string !== Compares as: left != right as string ~= Compares as: left Contains right ? ^= Compares as: left Begins with right ? =^ Compares as: left Ends with right ? == Compares in order of: ...

DTEComponent

DTEComponent For work with EnvDTE (Assembly-wrapped COM library containing the objects and members for Visual Studio core automation. http://msdn.microsoft.com/en-us/library/EnvDTE.aspx) exec Execute the available command. Syntax: #[DTE exec: command(arg)] Sample: #[DTE exec: Build.SolutionPlatforms(x86)] #[DTE exec: Build.SolutionConfigurations(Debug_Exclude_Plugins_All)] #[DTE exec: Build.Cancel] Note: Some commands should be available only for specific context of your environment. For example the Build.Cancel, etc. The raise(guid, id, customIn, customOut) method is available for vsCE users. events Operations with events. LastCommand available with v0.12+ T ...

FileComponent

FileComponent I/O File operations. Remarks Redirection for standard streams for call/scall/sout etc.: All errors can be ~disabled with arguments, for example: stderr to stdout: command 2>&1 stderr to NUL i.e. as disabled: command 2>nul stderr into file: command 2> path_to_file etc. stdout can be a similar: command > destination or command 1> destination Where destination it's similar as above. For more details see: MS Q110930 Support of standard streams STDOUT - Standard output stream. STDERR - Standard error stream. IO alias available with v0.12+ #[IO ...] MSBuild Property Functions. ...

FunctionComponent

FunctionComponent Mixed supported functions. hash v0.12.4+ To work with hash. MD5 Calculate hash value with MD5. Syntax: string #[Func hash.MD5(string data)] Arguments: data - String for calculating. Sample: #[Func hash.MD5("Hello World!")] Result: ED076287532E86365E841E92BFC50D8C SHA1 Calculate hash value with SHA-1. Syntax: string #[Func hash.SHA1(string data)] Arguments: data - String for calculating. Sample: #[Func hash.SHA1("Hello World!")] Result: 2EF7BDE608CE5404E97D5F042F95F89F1C232871 ...

InternalComponent

InternalComponent All internal operations with vsSolutionBuildEvent. Entry point for component The vsSolutionBuildEvent requires the following name for all internal operations: vsSBE or alias Core (v0.12.5+) Samples: #[vsSBE ...] #[Core ...] events Available event types: Pre, Post, Cancel, CommandEvent, Warnings, Errors, OWP, SlnOpened, SlnClosed, Transmitter, Logging Syntax: #[vsSBE events.Type.item(string name)] #[vsSBE events.Type.item(integer index)] Arguments: name - Full name of action. index - Index number of action from list. Range: 1 - n. Sample: #[vsSBE events.Pre.item("Act1")] #[vsSBE events.Pre.item(1)] Enabled Gets or Sets 'Enabled' stat ...

MSBuildComponent

MSBuildComponent Advanced evaluation with MSBuild engine. [ v0.12.6+ ] This is a very simple component (as a mediator) for immediate result from expression via MSBuild. Syntax: #[$(...)] Samples: #[$(name)] #[$([System.String]::Format("v{0}/{1}", $(v), $(r)))] Multiline support [ v0.12.10+ ] Now supports multiline definition of MSBuild data, for example: $([MSBuild]::Add($(revDeltaMin), $([MSBuild]::Modulo($(revBuild), $([MSBuild]::Subtract($(revDeltaMax), $(revDeltaMin))))))) you can format like this: #[$( [MSBuild]::Add( $(revDeltaMin), $([MSBuild]::Modulo( $(revBuild), $([MSBuild]::Subtract( $(revDeltaMax) ...

NuGetComponent

NuGetComponent Support of NuGet packages. gnt [ v0.12.6+ ] For work with packages via GetNuTool logic (you do not need the gtn.core, it is already part of this component). raw Push raw command to GetNuTool core. void gnt.raw(string command) Arguments: command - Available command to execute. For example: #[NuGet gnt.raw("/p:ngpackages=\"7z.Libs/15.12.0;vsSBE.CI.MSBuild/1.5.1:../packages/CI.MSBuild\"")] #[NuGet gnt.raw("/t:pack /p:ngin=\"D:\tmp\7z.Libs\" /p:ngout=\"newdir/\"")] Notes: The solution directory is path by default for all commands. The get command (/t:get) of GetNuTool is command by default as in original tool. References NuGet GetNuTool SBE-S ...

OWPComponent

OWPComponent For work with OWP (Output Window Pane) and similar operations. log v0.11+ Provides data from events of logging. Message Current message from log. Syntax: string log.Message Level The Level of current Message Syntax: string log.Level item [ v0.11+ ] Access to item of the Output window by name. Syntax: item(string name) Arguments: name - Name of item. write Writes data into selected pane. Syntax: void write(boolean force): content Arguments: force - Creates selected item if it does not exist for true value. Sample: #[OWP item("My Item").write(true): mixed data] writeLine Writes data with newline symbol into selected pane. Syntax: vo ...

SevenZipComponent

SevenZipComponent 7-Zip. File archiver with high compression ratio - www.7-zip.org [ v0.12.6+ ] Configuration Available compression methods Value Description Deflate Combination of the LZ77 algorithm and Huffman coding [?] Deflate64 A slightly higher compression ratio and lower compression time (increased dictionary size - 64kB) [?] BZip2 More effectively than Deflate, but is considerably slower [?] Lzma A high compression ratio than bzip2. Uses dictionary (improved variant of LZ77 + range encoding) and special handling of binary data [?] Lzma2 Efficie ...

TryComponent

TryComponent [ v0.12.8+ ] Protects from errors in try{…} block and handles it in catch{…} Available syntax #[try { ... } catch { ... }] With error type and its message: #[try { ... } catch(err, msg) { $(err) - Type of Exception $(msg) - Error Message ... }] Samples: #[try { #[IO copy.file("$(odir)\Release_notes.txt", "$(pDir)bin\$(cfg)\\", true)] #[7z pack.files({ "$(pDir)bin\$(cfg)\Bridge.dll", "$(pDir)bin\$(cfg)\Bridge.pdb", #[( $(Configuration) ~= "Release" ) { "$(pDir)bin\$(cfg)\Bridge.xml", }] "$(pDir)bin\$(cfg)\Release_notes.txt" }, "$(odi ...

UserVariableComponent

UserVariableComponent Support of dynamic variables via User-Variables core. Syntax: #[var name] #[var name = mixed value] Samples: #[var branchSha1 = #[File sout("git", "rev-parse --short HEAD")]] #[var ver = #[var ver].#[var revBuild]] Operations v0.11.3+ Unset variable Operator the '-'(minus). Use this as first symbol for variable name that must be removed: #[var -name] Default value for variable You can use this for re/definition variable with default value for compatibility with variables from MSBuild core. Operator the '+'(plus). Use this as first symbol for variable name that must be re/defined by default: #[var +name] Examples Empty string Allowed in v0. ...

Direct using of the SBE-Scripts engine.

Direct using of the SBE-Scripts engine If you want to work directly with engine, you should remember about protection of evaluation from used strings: All elements inside quotes ("...", '...') will be automatically protected from evaluation. If you work with standard options, you also should remeber this - Dynamic evaluation with both engines MSBuild & SBE-Scripts What to do if really need evaluation Use any convenient variants to avoid using inside quotes or use also the SBE-Scripts for using quotes. For example, for C# Mode: With MSBuild Property Functions: string type = $([System.String]::Format('"{0}";', #[Build type])) With UserVariableComponent #[var _type = ...