InternalComponent

The plugin and its operations related to events and actions.

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' status for selected action.

Syntax:

boolean events.Pre.item(index | name).Enabled [= boolean]
#[vsSBE events.Pre.item("Act1").Enabled]
#[vsSBE events.Post.item(4).Enabled = false]

run

0.12.10+

To Execute Action with specific context. Returns true value if it was handled.

Syntax:

boolean events.Pre.item(index | name).run([enum context])

Where:

  • optional context - Any available from BuildType, like: Common, Clean, After, Compile
    • Common is used by default.

Sample:

#[Core events.Pre.item("SpecBuild").run()]
#[Core events.Post.item(5).run(Build)]

Use this as functions with arguments, for example:

  1. Create deactivated action with name ShaList;
  2. Add related script that will use shaListDir and searchSubDirs variables;
  3. Invoke created "ShaList" in other actions like:
#[$(shaListDir = $(dbin))] #[$(searchSubDirs = '0')]
#[Core events.Post.item("ShaList").run()]

Starting with 1.16.1 you no longer need to update the Enabled property value.

Before 1.16.1, for example:

#[Core events.Post.item("ShaList").Enabled = true/false]
...
#[Core events.Post.item("ShaList").run()]

Status

Available states for selected action.

HasErrors

Checking of existence of errors after executed action for selected event.

Syntax:

boolean #[vsSBE events.Pre.item("Act1").Status.HasErrors]

Sample:

#[( #[vsSBE events.Pre.item("Act1").Enabled] && !#[vsSBE events.Pre.item("Act1").Status.HasErrors] )
{
    #[Build projects.find("zlib").IsBuildable = false]
}]

stdout

v0.12.7+

Get data from stdout for action which is executed asynchronously.

Syntax:

string events.Pre.item(integer index | string name).stdout

Samples:

#[var sres = #[Core events.Pre.item(1).stdout]]
#[( $(sres.Length) > 0 ){
    #[OWP item("stdout").writeLine(true): #[var sres]]
}]
#[var sres = <#data>#[Core events.Cancel.item("ActData").stdout]</#data>]
#[( $(sres.Length) > 0 ){
    #[OWP item("stdout").writeLine(true): #[var sres]]
}]

stderr

v0.12.7+

Get data from stderr for action which is executed asynchronously.

Syntax:

string events.Pre.item(integer index | string name).stderr

Samples:

#[var res = $(res)#[Core events.Post.item(1).stderr]]

StartUpProject

[v0.12.8+]

To get/set the project by default or "StartUp Project".

Syntax:

string StartUpProject [= string]

note: use full string as it presented in .sln file, for example:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.csproj", "{94C2EB4A-A5BF-4E78-8D2E-EE15A9D939BE}"

The correct value will be ConsoleApplication1\ConsoleApplication1.csproj

Samples:

#[Core StartUpProject = "ConsoleApplication1\ConsoleApplication1.csproj"]
#[Core StartUpProject = TestDllMain\TestDllMain.csproj]
#[( #[Core StartUpProject] ~= "DllMain" ){
    ...
}]

Examples:

$(pdir      = "$(ProjectDir)")              \ConsoleApplication1\ConsoleApplication1
$(pdirDM    = "$(ProjectDir:DllMain)")      \ConsoleApplication1\DllMain

...
#[Core StartUpProject = "DllMain\DllMain.csproj"]
...

$(pdir = "$(ProjectDir)")                   \ConsoleApplication1\DllMain

To reset behavior:

#[Core StartUpProject = ""]
or
#[Core StartUpProject =]