I have blogged on this before including details on how to use it etc. I’ll in the main, skip all of that and cut to the chase with some scripts that I use.
PBScripts are a structured alternative to batch files that you create to run in the Platform Builder (PB) Build context.
I initially used them for some PB plug-ins such as CEDriverWiz and CEComponentWiz so that when they run they get the metainformation about the current OS project.
PBScripts are created, configured and run from :
The PBScripts Menus
The PBScripts Dialog
PBScripts Insert a command options
PBScripts Run Dialog
PBScripts are just text files under Documents
Just copy each script and save as a text file in <Documents>\PBScripts, but with .pbscript extension rather than .txt.
The scripts were created in VS2008 but scripts should work OK in VS2012 and 2013 except for macros.
VSVersion=9.0 Name=BuildAll TargetDetach() SetConfig("Debug") BldDemo(-q) SetConfig("Release") BldDemo(-q) SetConfig("Release No Kitl") BldDemo(-q)
VSVersion=9.0 Name=ReBuildAll TargetDetach() SetConfig("Debug") BldDemo(clean -q) SetConfig("Release") BldDemo(clean -q) SetConfig("Release No Kitl") BldDemo(clean -q)
VSVersion=9.0 Name=BuildBSPEtc_All TargetDetach() VSCommand(-Macros.MyMacros.PBScripts.CloseAllButOutput) SetConfig("Debug") BldDemo(-qbsp) SetConfig("Release") BldDemo(-qbsp) SetConfig("Release No Kitl") BldDemo(-qbsp)
This next script builds the OS in its current configuration but closes all open files except Output. The purpose of this is to make sure nk.bin isn’t open which would block the makeimage phase. (I get caught on this a lot!) I think that a simple check at the start of the build should be included in the build process. The – in the VSCommand is to ignore all errors, eg. if there is nothing to close.
VSVersion=9.0 Name=BuildAll TargetDetach() VSCommand(-Macros.MyMacros.PBScripts.CloseAllButOutput) BldDemo(-q)
It requires a macro module, MyMacros.PBScripts, with the macro CloseAllButOutput
Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports System.Diagnostics Public Module PBScripts Sub CloseAllButOutput() DTE.Windows.Item(Constants.vsWindowKindOutput).Activate() DTE.ExecuteCommand("File.CloseAllButThis") End Sub End Module