https://github.com/3f/vssolutionbuildevent
🎛 Event-Catcher with variety of advanced Actions to service projects, libraries, build processes, runtime environment of the Visual Studio, MSBuild Tools, and …
https://github.com/3f/vssolutionbuildevent
automation build build-automation ci compiler e-msbuild envdte events getnutool msbuild plugin sbe-scripts scripts sevenzip sobascript tools visual-studio vsix vssbe vssolutionbuildevent
Last synced: 7 months ago
JSON representation
🎛 Event-Catcher with variety of advanced Actions to service projects, libraries, build processes, runtime environment of the Visual Studio, MSBuild Tools, and …
- Host: GitHub
- URL: https://github.com/3f/vssolutionbuildevent
- Owner: 3F
- License: other
- Created: 2014-03-13T09:46:51.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-05-24T23:32:12.000Z (over 1 year ago)
- Last Synced: 2025-06-26T13:48:37.041Z (8 months ago)
- Topics: automation, build, build-automation, ci, compiler, e-msbuild, envdte, events, getnutool, msbuild, plugin, sbe-scripts, scripts, sevenzip, sobascript, tools, visual-studio, vsix, vssbe, vssolutionbuildevent
- Language: C#
- Homepage:
- Size: 5.79 MB
- Stars: 83
- Watchers: 8
- Forks: 23
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.txt
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/3F/vsSolutionBuildEvent) [**vsSolutionBuildEvent**](https://github.com/3F/vsSolutionBuildEvent)
**Control everything: Visual Studio, MSBuild Tools, CI, and more …**
🎛 *Event*-Catcher with variety of advanced *Actions* to service projects, libraries, build processes, runtime environment of the Visual Studio, MSBuild Tools, and …
```r
Copyright (c) 2013-2024 Denis Kuzmin github/3F
```
[ 「 ❤ 」 ](https://3F.github.io/fund) [](LICENSE)
[](https://github.com/3F/vsSolutionBuildEvent/releases/latest)
[&url=https://raw.githubusercontent.com/3F/vsSolutionBuildEvent/master/.version)](https://marketplace.visualstudio.com/items?itemName=GitHub3F.vsSolutionBuildEvent-11615)
[](https://www.nuget.org/packages/vsSolutionBuildEvent/)
[](https://ci.appveyor.com/project/3Fs/vssolutionbuildevent/branch/master)
[](https://github.com/3F/GetNuTool)
[](https://github.com/3F/SobaScript)
[](https://github.com/3F/E-MSBuild)
[](https://github.com/3F/MvsSln)
[](https://ci.appveyor.com/project/3Fs/vssolutionbuildevent/history)
## Why vsSolutionBuildEvent
Advanced handler of the most **events** from MS Visual Studio & MSBuild tools. Full control and flexible multi-**actions** for basic pre/post events and other additional such as:
* [CommandEvent](https://3F.github.io/web.vsSBE/doc/Events/CommandEvent/), Errors, Warnings, Cancel-Build, Output-Build, Transmitter, Logging
Ability to handle events for all subprojects at once from the whole solution as an Solution-Events or individually for each separately.
Various modes for everything:
* Files Mode, Operation Mode, Interpreter Mode, [Script Mode](https://3F.github.io/web.vsSBE/doc/Modes/Script/), [Targets Mode](https://3F.github.io/web.vsSBE/doc/Modes/Targets/), [C# Mode](https://3F.github.io/web.vsSBE/doc/Modes/CSharp/)
Supports [Advanced MSBuild](https://3F.github.io/web.vsSBE/doc/Scripts/MSBuild/) & [SBE-Scripts engine](https://3F.github.io/web.vsSBE/doc/Scripts/SBE-Scripts/) for your awesome ideas.
Provides CI support (TeamCity, AppVeyor, Azure DevOps, ...), Command-Line mode and lot of other features for convenient work with the builds, tests, versioning, IO operations, and so on. See the documentation.
* [SBE-Scripts](https://3F.github.io/web.vsSBE/doc/Scripts/SBE-Scripts/)
* [E-MSBuild](https://3F.github.io/web.vsSBE/doc/Scripts/MSBuild/)
* **[Examples](https://3F.github.io/web.vsSBE/doc/Examples/)** *- scripts, solutions, syntax etc.,*
* [Continuous Integration (CI)](https://3F.github.io/web.vsSBE/doc/CI/)
* [Processing modes](https://3F.github.io/web.vsSBE/doc/Modes/)
* [API](https://3F.github.io/web.vsSBE/doc/API/)
[](https://3F.github.io/web.vsSBE/doc/Scheme/)
[](#)
* [Install & Build](https://3F.github.io/web.vsSBE/doc/Dev/How-to-build/) ([Developer Zone](https://3F.github.io/web.vsSBE/doc/Dev/))
* [Wiki](https://3F.github.io/web.vsSBE/) - read or edit
## Advanced MSBuild
Through [E-MSBuild](https://github.com/3F/E-MSBuild) engine.
```js
#[$(
[System.Math]::Exp('$(
[MSBuild]::Multiply(
$([System.Math]::Log(10)),
4
))'
)
)]
```
```js
$(n = 0) $(desc = "Hello ")
$(n += 3.14) $(desc += "from vsSBE !")
$(n += $(n)) $(p1 = " Platform is $(Platform)")
```
```js
$(...)
$(...:project) - from selected project in your solution
$$(...) ... $$(...:project)
```
```js
$(tStart = $([System.DateTime]::Parse("2014/01/01").ToBinary()))
$([System.Guid]::NewGuid())
$([System.TimeSpan]::FromTicks($([MSBuild]::Subtract($(tNow), $(tStart))))
.TotalHours.ToString("0"))
$(pdir = $(ProjectDir:project))
$(pdir = $(ProjectDir.Replace('\', '/'):project))
```
## #SobaScript ##
https://github.com/3F/SobaScript -- Extensible Modular Scripting Programming Language.
```js
#["
#SobaScript in action
"]
just a regular text between
#[$(v = 1.2.3)]
#[$(log = "$(TMP)/v.txt")]
#[($(Configuration) ~= Deb || true)
{
#[var tBase = $([System.DateTime]::Parse('2019/08/01').ToBinary())]
#[var tNow = $([System.DateTime]::UtcNow.Ticks)]
#[var revBuild = #[$(
[System.TimeSpan]::FromTicks('$(
[MSBuild]::Subtract(
$(tNow),
$(tBase))
)')
.TotalMinutes
.ToString('0')
)]]
#[var v = $(v).$([MSBuild]::Modulo($(revBuild), $([System.Math]::Pow(2, 14))))]
}]
#[var v = $([System.String]::Format("v{0}\r\n\t", $(v)))]
#[try
{
#[File write("#[var log]"):> Example #[var v] Generated by a vsSolutionBuildEvent]
#[IO scall("notepad", "#[var log]")]
}
catch(err, msg)
{
$(err) - Type of Exception
$(msg) - Error Message
}]
#[Box iterate(i = 0; $(loop); i += 1): #[try
{
...
}
catch { $(loop = false) }] ]
```
For example, you can exclude projects from build at runtime:
```js
#[Build projects.find("name").IsBuildable = false]
```
Capture data from external utilities:
```js
#[var bSha1 = #[IO sout("git", "rev-parse --short HEAD")]]
```
Do callable actions with arguments:
```js
#[$(shaListDir = $(dbin))] #[$(searchSubDirs = '0')]
#[Core events.Post.item("ShaList").run()]
```
Work with files and archives:
```js
#[IO copy.file("$(odir)/notes.txt", "$(pDirCIM)bin\\$(cfg)\\", true)]
#[7z pack.files({
"$(pDirBridge)bin\$(cfg)\Bridge.*.*",
"CI.MSBuild.dll",
"CI.MSBuild.pdb",
"$(pDirCIM)bin\$(cfg)\*.txt"}, "$(odir)CI.MSBuild_v$(numCIM)_[$(branchSha1)][$(netStamp)].zip")]
```
+DTE-commands, +Access to all MSBuild properties on the fly, +Conditional statements and lot of other components:
```js
#[try
{
#[Box iterate(i = 0; $(i) < 10; i += 1):
...
]
}catch{ }]
#[( #[vsSBE events.Pre.item(1).Enabled] || ($(Configuration) == "Release" && $(sysc)) )
{
#[Build projects.find("name").IsBuildable = false]
}
else
{
#[var bSha1 = #[IO sout("git", "rev-parse --short HEAD")]]
...
}]
```
... [create **new** in 5 minutes](https://3F.github.io/web.vsSBE/doc/Dev/New%20Component/)
## Processing modes
[https://3F.github.io/web.vsSBE/doc/Modes/](https://3F.github.io/web.vsSBE/doc/Modes/)
From simple commands to C# or even msbuild targets:
```xml
```
## CommandEvent (DTE)
You can also use this to catch all command from VS IDE. [Samples:](https://3F.github.io/web.vsSBE/doc/Events/CommandEvent/)
```js
$(lcGuid = #[DTE events.LastCommand.Guid])
$(lcId = #[DTE events.LastCommand.Id])
#[($(lcGuid) == "{1496A755-94DE-11D0-8C3F-00C04FC2AAE2}" && $(lcId) == 1627) {
#[File scall("notepad", "#[var log]", 30)]
}]
```

## Automatic Version Numbering
See our [**Wizard** for automatic code generation **or** use any **custom scripts**.](https://3F.github.io/web.vsSBE/doc/Examples/Version/)

## Various environments
You can easily use this with TeamCity, Azure DevOps, AppVeyor, and any other automated environments:




...
## Solution-wide Build events
Pre-Build / Post-Build events for all projects at once or individually for each separately: [configure what you need.](https://3F.github.io/web.vsSBE/doc/Features/Solution-wide/)

## Stop build on first error
[Immediately stop](https://3F.github.io/web.vsSBE/doc/Examples/Errors.Stop%20build/) (at the same time) after the first appearance (compared with StopOnFirstBuildError plugin [[?]](https://3F.github.io/web.vsSBE/doc/Examples/Errors.Stop%20build/))

## Wiki
[Wiki](https://3F.github.io/web.vsSBE/) - Examples, syntax, developer zone, and other ...
Feel free to improve any pages. Click [Edit] button or [Start new here.](https://3F.github.io/web.vsSBE/doc/New/)
## Screenshots



[**[. . .](https://3F.github.io/web.vsSBE/Screenshots/)**]