Compare commits
18 Commits
dev/lhecke
...
dev/migrie
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d94c5454b | ||
|
|
74d143dbf7 | ||
|
|
5ec45f89f5 | ||
|
|
780ae728b7 | ||
|
|
f5dbd83f61 | ||
|
|
44922ff120 | ||
|
|
9dbe70ac5a | ||
|
|
ca0811ed50 | ||
|
|
eaaa48a15c | ||
|
|
182f562e5f | ||
|
|
ac82746ac4 | ||
|
|
b10d63f9df | ||
|
|
2733ae1e4c | ||
|
|
2f80709c84 | ||
|
|
f035763c39 | ||
|
|
65b0e1b720 | ||
|
|
c7f0010037 | ||
|
|
38d1529f74 |
4
.github/actions/spelling/allow/allow.txt
vendored
@@ -84,6 +84,7 @@ ptys
|
||||
qof
|
||||
qps
|
||||
rclt
|
||||
regexes
|
||||
reimplementation
|
||||
reserialization
|
||||
reserialize
|
||||
@@ -95,7 +96,6 @@ slnt
|
||||
Sos
|
||||
ssh
|
||||
stakeholders
|
||||
sxn
|
||||
timeline
|
||||
timelines
|
||||
timestamped
|
||||
@@ -112,8 +112,6 @@ und
|
||||
unregister
|
||||
versioned
|
||||
vsdevcmd
|
||||
walkthrough
|
||||
walkthroughs
|
||||
We'd
|
||||
wildcards
|
||||
XBox
|
||||
|
||||
7
.github/actions/spelling/allow/apis.txt
vendored
@@ -28,8 +28,8 @@ CYICON
|
||||
Dacl
|
||||
dataobject
|
||||
dcomp
|
||||
delayimp
|
||||
DERR
|
||||
delayimp
|
||||
dlldata
|
||||
DNE
|
||||
DONTADDTORECENT
|
||||
@@ -52,7 +52,6 @@ futex
|
||||
GETDESKWALLPAPER
|
||||
GETHIGHCONTRAST
|
||||
GETMOUSEHOVERTIME
|
||||
GETTEXTLENGTH
|
||||
Hashtable
|
||||
HIGHCONTRASTON
|
||||
HIGHCONTRASTW
|
||||
@@ -111,14 +110,12 @@ lsass
|
||||
LSHIFT
|
||||
LTGRAY
|
||||
MAINWINDOW
|
||||
MAXIMIZEBOX
|
||||
memchr
|
||||
memicmp
|
||||
MENUCOMMAND
|
||||
MENUDATA
|
||||
MENUINFO
|
||||
MENUITEMINFOW
|
||||
MINIMIZEBOX
|
||||
mmeapi
|
||||
MOUSELEAVE
|
||||
mov
|
||||
@@ -187,7 +184,6 @@ snprintf
|
||||
spsc
|
||||
sregex
|
||||
SRWLOC
|
||||
srwlock
|
||||
SRWLOCK
|
||||
STDCPP
|
||||
STDMETHOD
|
||||
@@ -204,7 +200,6 @@ TABROW
|
||||
TASKBARCREATED
|
||||
TBPF
|
||||
THEMECHANGED
|
||||
THICKFRAME
|
||||
tlg
|
||||
TME
|
||||
tmp
|
||||
|
||||
1
.github/actions/spelling/allow/names.txt
vendored
@@ -54,7 +54,6 @@ mikegr
|
||||
mikemaccana
|
||||
miloush
|
||||
miniksa
|
||||
nguyen
|
||||
niksa
|
||||
nvaccess
|
||||
nvda
|
||||
|
||||
1
.github/actions/spelling/expect/alphabet.txt
vendored
@@ -21,7 +21,6 @@ BBBBCCCCC
|
||||
BBGGRR
|
||||
efg
|
||||
EFG
|
||||
efgh
|
||||
EFGh
|
||||
KLMNOQQQQQQQQQQ
|
||||
QQQQQQQQQQABCDEFGHIJ
|
||||
|
||||
64
.github/actions/spelling/expect/expect.txt
vendored
@@ -7,6 +7,7 @@ ABCF
|
||||
abgr
|
||||
abi
|
||||
ABORTIFHUNG
|
||||
ACCESSTOKEN
|
||||
acidev
|
||||
ACIOSS
|
||||
ACover
|
||||
@@ -17,6 +18,7 @@ ADDALIAS
|
||||
ADDREF
|
||||
ADDSTRING
|
||||
ADDTOOL
|
||||
AEnd
|
||||
AFew
|
||||
AFill
|
||||
AFX
|
||||
@@ -115,8 +117,10 @@ binplace
|
||||
binplaced
|
||||
bitcoin
|
||||
bitcrazed
|
||||
bitflag
|
||||
bitmask
|
||||
BITOPERATION
|
||||
bitsets
|
||||
BKCOLOR
|
||||
BKGND
|
||||
Bksp
|
||||
@@ -145,12 +149,12 @@ bufferout
|
||||
buffersize
|
||||
buflen
|
||||
buildtransitive
|
||||
BUILDURI
|
||||
burriter
|
||||
BValue
|
||||
bytebuffer
|
||||
cac
|
||||
cacafire
|
||||
CALLCONV
|
||||
capslock
|
||||
CARETBLINKINGENABLED
|
||||
CARRIAGERETURN
|
||||
@@ -194,6 +198,7 @@ CHT
|
||||
Cic
|
||||
cielab
|
||||
Cielab
|
||||
Clcompile
|
||||
CLE
|
||||
cleartype
|
||||
CLICKACTIVE
|
||||
@@ -224,6 +229,7 @@ codepage
|
||||
codepath
|
||||
codepoints
|
||||
coinit
|
||||
COLLECTIONURI
|
||||
colorizing
|
||||
COLORMATRIX
|
||||
COLORREFs
|
||||
@@ -301,6 +307,7 @@ coordnew
|
||||
COPYCOLOR
|
||||
CORESYSTEM
|
||||
cotaskmem
|
||||
countof
|
||||
CPG
|
||||
cpinfo
|
||||
CPINFOEX
|
||||
@@ -374,6 +381,7 @@ dai
|
||||
DATABLOCK
|
||||
DBatch
|
||||
dbcs
|
||||
DBCSCHAR
|
||||
DBCSFONT
|
||||
dbg
|
||||
DBGALL
|
||||
@@ -495,6 +503,7 @@ devicecode
|
||||
Dext
|
||||
DFactory
|
||||
DFF
|
||||
dhandler
|
||||
dialogbox
|
||||
directio
|
||||
DIRECTX
|
||||
@@ -512,6 +521,7 @@ dllmain
|
||||
DLLVERSIONINFO
|
||||
DLOAD
|
||||
DLOOK
|
||||
dmp
|
||||
DONTCARE
|
||||
doskey
|
||||
dotnet
|
||||
@@ -589,6 +599,7 @@ eplace
|
||||
EPres
|
||||
EQU
|
||||
ERASEBKGND
|
||||
etcoreapp
|
||||
ETW
|
||||
EUDC
|
||||
EVENTID
|
||||
@@ -630,6 +641,7 @@ FGs
|
||||
FILEDESCRIPTION
|
||||
FILESUBTYPE
|
||||
FILESYSPATH
|
||||
fileurl
|
||||
FILEW
|
||||
FILLATTR
|
||||
FILLCONSOLEOUTPUT
|
||||
@@ -678,7 +690,7 @@ FSINFOCLASS
|
||||
fte
|
||||
Ftm
|
||||
Fullscreens
|
||||
Fullwidth
|
||||
fullwidth
|
||||
FUNCTIONCALL
|
||||
fuzzer
|
||||
fuzzmain
|
||||
@@ -811,6 +823,7 @@ HIWORD
|
||||
HKCU
|
||||
hkey
|
||||
hkl
|
||||
HKLM
|
||||
hlocal
|
||||
hlsl
|
||||
HMB
|
||||
@@ -818,6 +831,7 @@ HMK
|
||||
hmod
|
||||
hmodule
|
||||
hmon
|
||||
homeglyphs
|
||||
homoglyph
|
||||
HORZ
|
||||
hostable
|
||||
@@ -905,7 +919,6 @@ INSERTMODE
|
||||
INTERACTIVITYBASE
|
||||
INTERCEPTCOPYPASTE
|
||||
INTERNALNAME
|
||||
Interner
|
||||
intsafe
|
||||
INVALIDARG
|
||||
INVALIDATERECT
|
||||
@@ -922,10 +935,12 @@ itermcolors
|
||||
ITerminal
|
||||
itf
|
||||
Ith
|
||||
itoa
|
||||
IUI
|
||||
IUnknown
|
||||
ivalid
|
||||
IWIC
|
||||
IXMP
|
||||
IXP
|
||||
jconcpp
|
||||
JOBOBJECT
|
||||
@@ -949,6 +964,7 @@ kernelbasestaging
|
||||
KEYBDINPUT
|
||||
keychord
|
||||
keydown
|
||||
keyevent
|
||||
KEYFIRST
|
||||
KEYLAST
|
||||
Keymapping
|
||||
@@ -995,6 +1011,7 @@ LINEWRAP
|
||||
LINKERRCAP
|
||||
LINKERROR
|
||||
linputfile
|
||||
listproperties
|
||||
listptr
|
||||
listptrsize
|
||||
lld
|
||||
@@ -1100,7 +1117,6 @@ MDs
|
||||
MEASUREITEM
|
||||
megamix
|
||||
memallocator
|
||||
meme
|
||||
MENUCHAR
|
||||
MENUCONTROL
|
||||
MENUDROPALIGNMENT
|
||||
@@ -1114,6 +1130,7 @@ MIIM
|
||||
milli
|
||||
mincore
|
||||
mindbogglingly
|
||||
minimizeall
|
||||
minkernel
|
||||
MINMAXINFO
|
||||
minwin
|
||||
@@ -1300,7 +1317,7 @@ onecoreuuid
|
||||
ONECOREWINDOWS
|
||||
onehalf
|
||||
oneseq
|
||||
OOM
|
||||
ONLCR
|
||||
openbash
|
||||
opencode
|
||||
opencon
|
||||
@@ -1310,6 +1327,13 @@ openps
|
||||
openvt
|
||||
ORIGINALFILENAME
|
||||
osc
|
||||
OSCBG
|
||||
OSCCT
|
||||
OSCFG
|
||||
OSCRCC
|
||||
OSCSCB
|
||||
OSCSCC
|
||||
OSCWT
|
||||
OSDEPENDSROOT
|
||||
OSG
|
||||
OSGENG
|
||||
@@ -1441,8 +1465,8 @@ prc
|
||||
prealigned
|
||||
prect
|
||||
prefast
|
||||
preflighting
|
||||
prefs
|
||||
preinstalled
|
||||
prepopulated
|
||||
presorted
|
||||
PREVENTPINNING
|
||||
@@ -1455,6 +1479,7 @@ prioritization
|
||||
processenv
|
||||
processhost
|
||||
PROCESSINFOCLASS
|
||||
procs
|
||||
PROPERTYID
|
||||
PROPERTYKEY
|
||||
PROPERTYVAL
|
||||
@@ -1469,6 +1494,7 @@ propvariant
|
||||
propvarutil
|
||||
psa
|
||||
PSECURITY
|
||||
pseudocode
|
||||
pseudoconsole
|
||||
pseudoterminal
|
||||
psh
|
||||
@@ -1587,6 +1613,7 @@ rgrc
|
||||
rgs
|
||||
rgui
|
||||
rgw
|
||||
rgwch
|
||||
RIGHTALIGN
|
||||
RIGHTBUTTON
|
||||
riid
|
||||
@@ -1747,6 +1774,7 @@ SND
|
||||
SOLIDBOX
|
||||
Solutiondir
|
||||
somefile
|
||||
SOURCEBRANCH
|
||||
sourced
|
||||
spammy
|
||||
SRCCODEPAGE
|
||||
@@ -1781,6 +1809,7 @@ STDMETHODCALLTYPE
|
||||
STDMETHODIMP
|
||||
STGM
|
||||
stl
|
||||
stoutapot
|
||||
Stri
|
||||
Stringable
|
||||
STRINGTABLE
|
||||
@@ -1797,6 +1826,7 @@ SUBLANG
|
||||
subresource
|
||||
subsystemconsole
|
||||
subsystemwindows
|
||||
suiteless
|
||||
swapchain
|
||||
swapchainpanel
|
||||
swappable
|
||||
@@ -1835,11 +1865,13 @@ TBM
|
||||
tchar
|
||||
TCHFORMAT
|
||||
TCI
|
||||
tcome
|
||||
tcommandline
|
||||
tcommands
|
||||
Tdd
|
||||
TDelegated
|
||||
TDP
|
||||
TEAMPROJECT
|
||||
tearoff
|
||||
Teb
|
||||
Techo
|
||||
@@ -1851,16 +1883,22 @@ terminalrenderdata
|
||||
TERMINALSCROLLING
|
||||
terminfo
|
||||
TEs
|
||||
testbuildplatform
|
||||
testcon
|
||||
testd
|
||||
testdlls
|
||||
testenv
|
||||
testlab
|
||||
testlist
|
||||
testmd
|
||||
testmode
|
||||
testname
|
||||
testnameprefix
|
||||
TESTNULL
|
||||
testpass
|
||||
testpasses
|
||||
testtestabc
|
||||
testtesttesttesttest
|
||||
testtimeout
|
||||
TEXCOORD
|
||||
texel
|
||||
@@ -1889,6 +1927,7 @@ TJson
|
||||
TLambda
|
||||
TLDP
|
||||
TLEN
|
||||
Tlgdata
|
||||
TMAE
|
||||
TMPF
|
||||
TMult
|
||||
@@ -1948,14 +1987,11 @@ UAC
|
||||
uap
|
||||
uapadmin
|
||||
UAX
|
||||
UBool
|
||||
ucd
|
||||
uch
|
||||
UChars
|
||||
udk
|
||||
UDM
|
||||
uer
|
||||
UError
|
||||
uget
|
||||
uia
|
||||
UIACCESS
|
||||
@@ -1985,14 +2021,13 @@ unknwn
|
||||
UNORM
|
||||
unparseable
|
||||
unregistering
|
||||
untests
|
||||
untextured
|
||||
untimes
|
||||
UPDATEDISPLAY
|
||||
UPDOWN
|
||||
UPKEY
|
||||
UPSS
|
||||
uregex
|
||||
URegular
|
||||
usebackq
|
||||
USECALLBACK
|
||||
USECOLOR
|
||||
@@ -2014,9 +2049,6 @@ USESIZE
|
||||
USESTDHANDLES
|
||||
usp
|
||||
USRDLL
|
||||
utext
|
||||
UText
|
||||
UTEXT
|
||||
utr
|
||||
UVWX
|
||||
UVWXY
|
||||
@@ -2078,6 +2110,7 @@ vtseq
|
||||
vtterm
|
||||
vttest
|
||||
VWX
|
||||
waaay
|
||||
waitable
|
||||
WANSUNG
|
||||
WANTARROWS
|
||||
@@ -2126,6 +2159,7 @@ windbg
|
||||
WINDEF
|
||||
windll
|
||||
WINDOWALPHA
|
||||
Windowbuffer
|
||||
windowdpiapi
|
||||
WINDOWEDGE
|
||||
windowext
|
||||
@@ -2195,6 +2229,7 @@ wprp
|
||||
wprpi
|
||||
wregex
|
||||
writeback
|
||||
writechar
|
||||
WRITECONSOLE
|
||||
WRITECONSOLEINPUT
|
||||
WRITECONSOLEOUTPUT
|
||||
@@ -2268,6 +2303,7 @@ xunit
|
||||
xutr
|
||||
XVIRTUALSCREEN
|
||||
XWalk
|
||||
xxyyzz
|
||||
yact
|
||||
YCast
|
||||
YCENTER
|
||||
|
||||
@@ -101,7 +101,7 @@ If you don't have any additional info/context to add but would like to indicate
|
||||
|
||||
If you're able & willing to help fix issues and/or implement features, we'd love your contribution!
|
||||
|
||||
The best place to start is the list of ["walkthroughs"](https://aka.ms/terminal-walkthroughs). This is a collection of issues where we've written a "walkthrough", little guides to help get started with a particular issue. These are usually good first issues, and are a great way to get familiar with the codebase. Additionally, the list of ["good first issue"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22++label%3A%22good+first+issue%22+)s is another set of issues that might be easier for first-time contributors. Once you're feeling more comfortable in the codebase, feel free to just use the ["Help Wanted"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22+) label, or just find any issue you're interested in and hop in!
|
||||
The best place to start is the list of ["good first issue"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22++label%3A%22good+first+issue%22+)s. These are bugs or tasks that we on the team believe would be easier to implement for someone without any prior experience in the codebase. Once you're feeling more comfortable in the codebase, feel free to just use the ["Help Wanted"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22+) label, or just find an issue you're interested in and hop in!
|
||||
|
||||
Generally, we categorize issues in the following way, which is largely derived from our old internal work tracking system:
|
||||
* ["Bugs"](https://github.com/microsoft/terminal/issues?q=is%3Aopen+is%3Aissue+label%3A%22Issue-Bug%22+) are parts of the Terminal & Console that are not quite working the right way. There's code to already support some scenario, but it's not quite working right. Fixing these is generally a matter of debugging the broken functionality and fixing the wrong code.
|
||||
|
||||
@@ -422,8 +422,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RenderingTests", "src\tools
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "benchcat", "src\tools\benchcat\benchcat.vcxproj", "{2C836962-9543-4CE5-B834-D28E1F124B66}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleMonitor", "src\tools\ConsoleMonitor\ConsoleMonitor.vcxproj", "{328729E9-6723-416E-9C98-951F1473BBE1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
AuditMode|Any CPU = AuditMode|Any CPU
|
||||
@@ -2816,26 +2814,6 @@ Global
|
||||
{2C836962-9543-4CE5-B834-D28E1F124B66}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{2C836962-9543-4CE5-B834-D28E1F124B66}.Release|x64.ActiveCfg = Release|x64
|
||||
{2C836962-9543-4CE5-B834-D28E1F124B66}.Release|x86.ActiveCfg = Release|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.AuditMode|Any CPU.ActiveCfg = AuditMode|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.AuditMode|ARM.ActiveCfg = AuditMode|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.AuditMode|ARM64.ActiveCfg = Release|ARM64
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.AuditMode|x64.ActiveCfg = Release|x64
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.AuditMode|x86.ActiveCfg = Release|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Debug|ARM.ActiveCfg = Debug|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Fuzzing|ARM.ActiveCfg = Fuzzing|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Release|ARM.ActiveCfg = Release|Win32
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Release|x64.ActiveCfg = Release|x64
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1}.Release|x86.ActiveCfg = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -2943,7 +2921,6 @@ Global
|
||||
{613CCB57-5FA9-48EF-80D0-6B1E319E20C4} = {A10C4720-DCA4-4640-9749-67F4314F527C}
|
||||
{37C995E0-2349-4154-8E77-4A52C0C7F46D} = {A10C4720-DCA4-4640-9749-67F4314F527C}
|
||||
{2C836962-9543-4CE5-B834-D28E1F124B66} = {A10C4720-DCA4-4640-9749-67F4314F527C}
|
||||
{328729E9-6723-416E-9C98-951F1473BBE1} = {A10C4720-DCA4-4640-9749-67F4314F527C}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3140B1B7-C8EE-43D1-A772-D82A7061A271}
|
||||
|
||||
20
README.md
@@ -21,8 +21,7 @@ Related repositories include:
|
||||
|
||||
## Installing and running Windows Terminal
|
||||
|
||||
> **Note**\
|
||||
> Windows Terminal requires Windows 10 2004 (build 19041) or later
|
||||
> **Note**: Windows Terminal requires Windows 10 2004 (build 19041) or later
|
||||
|
||||
### Microsoft Store [Recommended]
|
||||
|
||||
@@ -53,10 +52,9 @@ fails for any reason, you can try the following command at a PowerShell prompt:
|
||||
Add-AppxPackage Microsoft.WindowsTerminal_<versionNumber>.msixbundle
|
||||
```
|
||||
|
||||
> **Note**\
|
||||
> If you install Terminal manually:
|
||||
> **Note**: If you install Terminal manually:
|
||||
>
|
||||
> * You may need to install the [VC++ v14 Desktop Framework Package](https://docs.microsoft.com/troubleshoot/cpp/c-runtime-packages-desktop-bridge#how-to-install-and-update-desktop-framework-packages).
|
||||
> * You may need to install the [VC++ v14 Desktop Framework Package](https://docs.microsoft.com/troubleshoot/cpp/c-runtime-packages-desktop-bridge#how-to-install-and-update-desktop-framework-packages).
|
||||
> This should only be necessary on older builds of Windows 10 and only if you get an error about missing framework packages.
|
||||
> * Terminal will not auto-update when new builds are released so you will need
|
||||
> to regularly install the latest Terminal release to receive all the latest
|
||||
@@ -72,9 +70,6 @@ package:
|
||||
winget install --id Microsoft.WindowsTerminal -e
|
||||
```
|
||||
|
||||
> **Note**\
|
||||
> Due to [a dependency issue](https://github.com/microsoft/terminal/issues/15663), Terminal's current versions cannot be installed via the Windows Package Manager CLI. To install the stable release 1.17 or later, or the Preview release 1.18 or later, please use an alternative installation method.
|
||||
|
||||
#### Via Chocolatey (unofficial)
|
||||
|
||||
[Chocolatey](https://chocolatey.org) users can download and install the latest
|
||||
@@ -240,8 +235,7 @@ Cause: You're launching the incorrect solution in Visual Studio.
|
||||
Solution: Make sure you're building & deploying the `CascadiaPackage` project in
|
||||
Visual Studio.
|
||||
|
||||
> **Note**\
|
||||
> `OpenConsole.exe` is just a locally-built `conhost.exe`, the classic
|
||||
> **Note**: `OpenConsole.exe` is just a locally-built `conhost.exe`, the classic
|
||||
> Windows Console that hosts Windows' command-line infrastructure. OpenConsole
|
||||
> is used by Windows Terminal to connect to and communicate with command-line
|
||||
> applications (via
|
||||
@@ -277,10 +271,10 @@ similar open/closed preexisting issues before creating a new issue.**
|
||||
If you would like to ask a question that you feel doesn't warrant an issue
|
||||
(yet), please reach out to us via Twitter:
|
||||
|
||||
* Christopher Nguyen, Product Manager:
|
||||
[@nguyen_dows](https://twitter.com/nguyen_dows)
|
||||
* Kayla Cinnamon, Program Manager:
|
||||
[@cinnamon\_msft](https://twitter.com/cinnamon_msft)
|
||||
* Dustin Howett, Engineering Lead: [@dhowett](https://twitter.com/DHowett)
|
||||
* Mike Griese, Senior Developer: [@zadjii@mastodon.social](https://mastodon.social/@zadjii)
|
||||
* Mike Griese, Senior Developer: [@zadjii](https://twitter.com/zadjii)
|
||||
* Carlos Zamora, Developer: [@cazamor_msft](https://twitter.com/cazamor_msft)
|
||||
* Pankaj Bhojwani, Developer
|
||||
* Leonard Hecker, Developer: [@LeonardHecker](https://twitter.com/LeonardHecker)
|
||||
|
||||
175
build/Helix/AzurePipelinesHelperScripts.ps1
Normal file
@@ -0,0 +1,175 @@
|
||||
function GetAzureDevOpsBaseUri
|
||||
{
|
||||
Param(
|
||||
[string]$CollectionUri,
|
||||
[string]$TeamProject
|
||||
)
|
||||
|
||||
return $CollectionUri + $TeamProject
|
||||
}
|
||||
|
||||
function GetQueryTestRunsUri
|
||||
{
|
||||
Param(
|
||||
[string]$CollectionUri,
|
||||
[string]$TeamProject,
|
||||
[string]$BuildUri,
|
||||
[switch]$IncludeRunDetails
|
||||
)
|
||||
|
||||
if ($IncludeRunDetails)
|
||||
{
|
||||
$includeRunDetailsParameter = "&includeRunDetails=true"
|
||||
}
|
||||
else
|
||||
{
|
||||
$includeRunDetailsParameter = ""
|
||||
}
|
||||
|
||||
$baseUri = GetAzureDevOpsBaseUri -CollectionUri $CollectionUri -TeamProject $TeamProject
|
||||
$queryUri = "$baseUri/_apis/test/runs?buildUri=$BuildUri$includeRunDetailsParameter&api-version=5.0"
|
||||
return $queryUri
|
||||
}
|
||||
|
||||
function Get-HelixJobTypeFromTestRun
|
||||
{
|
||||
Param ($testRun)
|
||||
|
||||
$testRunSingleResultUri = "$($testRun.url)/results?`$top=1&`$skip=0&api-version=5.1"
|
||||
$singleTestResult = Invoke-RestMethod -Uri $testRunSingleResultUri -Method Get -Headers $azureDevOpsRestApiHeaders
|
||||
$count = $singleTestResult.value.Length
|
||||
if($count -eq 0)
|
||||
{
|
||||
# If the count is 0, then results have not yet been reported for this run.
|
||||
# We only care about completed runs with results, so it is ok to just return 'UNKNOWN' for this run.
|
||||
return "UNKNOWN"
|
||||
}
|
||||
else
|
||||
{
|
||||
$info = ConvertFrom-Json $singleTestResult.value.comment
|
||||
$helixJobId = $info.HelixJobId
|
||||
$job = Invoke-RestMethodWithRetries "https://helix.dot.net/api/2019-06-17/jobs/${helixJobId}?access_token=${HelixAccessToken}"
|
||||
return $job.Type
|
||||
}
|
||||
}
|
||||
|
||||
function Append-HelixAccessTokenToUrl
|
||||
{
|
||||
Param ([string]$url, [string]$token)
|
||||
if($url.Contains("?"))
|
||||
{
|
||||
$url = "$($url)&access_token=$($token)"
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = "$($url)?access_token=$($token)"
|
||||
}
|
||||
return $url
|
||||
}
|
||||
|
||||
|
||||
# The Helix Rest api is sometimes unreliable. So we call these apis with retry logic.
|
||||
# Note: The Azure DevOps apis are stable and do not need to be called with this retry logic.
|
||||
$helixApiRetries = 0
|
||||
$helixApiRetriesMax = 10
|
||||
|
||||
function Download-StringWithRetries
|
||||
{
|
||||
Param ([string]$fileName, [string]$url)
|
||||
|
||||
$result = ""
|
||||
$done = $false
|
||||
|
||||
while(!($done))
|
||||
{
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $fileName"
|
||||
$result = (New-Object System.Net.WebClient).DownloadString($url)
|
||||
$done = $true
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "Failed to download $fileName $($PSItem.Exception)"
|
||||
|
||||
$helixApiRetries = $helixApiRetries + 1
|
||||
if($helixApiRetries -lt $helixApiRetriesMax)
|
||||
{
|
||||
Write-Host "Sleep and retry download of $fileName"
|
||||
Start-Sleep 60
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "Failed to download $fileName"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result
|
||||
}
|
||||
|
||||
function Invoke-RestMethodWithRetries
|
||||
{
|
||||
Param ([string]$url,$Headers)
|
||||
|
||||
$result = @()
|
||||
$done = $false
|
||||
|
||||
while(!($done))
|
||||
{
|
||||
try
|
||||
{
|
||||
$result = Invoke-RestMethod -Uri $url -Method Get -Headers $Headers
|
||||
$done = $true
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "Failed to invoke Rest method $($PSItem.Exception)"
|
||||
|
||||
$helixApiRetries = $helixApiRetries + 1
|
||||
if($helixApiRetries -lt $helixApiRetriesMax)
|
||||
{
|
||||
Write-Host "Sleep and retry invoke"
|
||||
Start-Sleep 60
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "Failed to invoke Rest method"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result
|
||||
}
|
||||
|
||||
function Download-FileWithRetries
|
||||
{
|
||||
Param ([string]$fileurl, [string]$destination)
|
||||
|
||||
$done = $false
|
||||
|
||||
while(!($done))
|
||||
{
|
||||
try
|
||||
{
|
||||
Write-Host "Downloading $destination"
|
||||
$webClient.DownloadFile($fileurl, $destination)
|
||||
$done = $true
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host "Failed to download $destination $($PSItem.Exception)"
|
||||
|
||||
$helixApiRetries = $helixApiRetries + 1
|
||||
if($helixApiRetries -lt $helixApiRetriesMax)
|
||||
{
|
||||
Write-Host "Sleep and retry download of $destination"
|
||||
Start-Sleep 60
|
||||
}
|
||||
else
|
||||
{
|
||||
throw "Failed to download $destination"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,9 @@ Param(
|
||||
$helixResultsContainerUri = $Env:HELIX_RESULTS_CONTAINER_URI
|
||||
$helixResultsContainerRsas = $Env:HELIX_RESULTS_CONTAINER_RSAS
|
||||
|
||||
$rerunPassesRequiredToAvoidFailure = $env:rerunPassesRequiredToAvoidFailure
|
||||
|
||||
Add-Type -Language CSharp -ReferencedAssemblies System.Xml,System.Xml.Linq,System.Runtime.Serialization,System.Runtime.Serialization.Json (Get-Content $PSScriptRoot\HelixTestHelpers.cs -Raw)
|
||||
|
||||
$testResultParser = [HelixTestHelpers.TestResultParser]::new($TestNamePrefix, $helixResultsContainerUri, $helixResultsContainerRsas)
|
||||
$testResultParser.ConvertWttLogToXUnitLog($WttInputPath, $WttSingleRerunInputPath, $WttMultipleRerunInputPath, $XUnitOutputPath)
|
||||
$testResultParser.ConvertWttLogToXUnitLog($WttInputPath, $WttSingleRerunInputPath, $WttMultipleRerunInputPath, $XUnitOutputPath, $rerunPassesRequiredToAvoidFailure)
|
||||
112
build/Helix/EnsureMachineState.ps1
Normal file
@@ -0,0 +1,112 @@
|
||||
$scriptDirectory = $script:MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
|
||||
# List all processes to aid debugging:
|
||||
Write-Host "All processes running:"
|
||||
Get-Process
|
||||
|
||||
tasklist /svc
|
||||
|
||||
# Add this test directory as an exclusion for Windows Defender
|
||||
Write-Host "Add $scriptDirectory as Exclusion Path"
|
||||
Add-MpPreference -ExclusionPath $scriptDirectory
|
||||
Write-Host "Add $($env:HELIX_CORRELATION_PAYLOAD) as Exclusion Path"
|
||||
Add-MpPreference -ExclusionPath $env:HELIX_CORRELATION_PAYLOAD
|
||||
Get-MpPreference
|
||||
Get-MpComputerStatus
|
||||
|
||||
|
||||
# Minimize all windows:
|
||||
$shell = New-Object -ComObject "Shell.Application"
|
||||
$shell.minimizeall()
|
||||
|
||||
# Kill any instances of Windows Security Alert:
|
||||
$windowTitleToMatch = "*Windows Security Alert*"
|
||||
$procs = Get-Process | Where {$_.MainWindowTitle -like "*Windows Security Alert*"}
|
||||
foreach ($proc in $procs)
|
||||
{
|
||||
Write-Host "Found process with '$windowTitleToMatch' title: $proc"
|
||||
$proc.Kill();
|
||||
}
|
||||
|
||||
# Kill processes by name that are known to interfere with our tests:
|
||||
$processNamesToStop = @("Microsoft.Photos", "WinStore.App", "SkypeApp", "SkypeBackgroundHost", "OneDriveSetup", "OneDrive")
|
||||
foreach($procName in $processNamesToStop)
|
||||
{
|
||||
Write-Host "Attempting to kill $procName if it is running"
|
||||
Stop-Process -ProcessName $procName -Verbose -ErrorAction Ignore
|
||||
}
|
||||
Write-Host "All processes running after attempting to kill unwanted processes:"
|
||||
Get-Process
|
||||
|
||||
tasklist /svc
|
||||
|
||||
$platform = $env:testbuildplatform
|
||||
if(!$platform)
|
||||
{
|
||||
$platform = "x86"
|
||||
}
|
||||
|
||||
function UninstallApps {
|
||||
Param([string[]]$appsToUninstall)
|
||||
|
||||
foreach($pkgName in $appsToUninstall)
|
||||
{
|
||||
foreach($pkg in (Get-AppxPackage $pkgName).PackageFullName)
|
||||
{
|
||||
Write-Output "Removing: $pkg"
|
||||
Remove-AppxPackage $pkg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function UninstallTestApps {
|
||||
Param([string[]]$appsToUninstall)
|
||||
|
||||
foreach($pkgName in $appsToUninstall)
|
||||
{
|
||||
foreach($pkg in (Get-AppxPackage $pkgName).PackageFullName)
|
||||
{
|
||||
Write-Output "Removing: $pkg"
|
||||
Remove-AppxPackage $pkg
|
||||
}
|
||||
|
||||
# Sometimes an app can get into a state where it is no longer returned by Get-AppxPackage, but it is still present
|
||||
# which prevents other versions of the app from being installed.
|
||||
# To handle this, we can directly call Remove-AppxPackage against the full name of the package. However, without
|
||||
# Get-AppxPackage to find the PackageFullName, we just have to manually construct the name.
|
||||
$packageFullName = "$($pkgName)_1.0.0.0_$($platform)__8wekyb3d8bbwe"
|
||||
Write-Host "Removing $packageFullName if installed"
|
||||
Remove-AppPackage $packageFullName -ErrorVariable appxerror -ErrorAction SilentlyContinue
|
||||
if($appxerror)
|
||||
{
|
||||
foreach($error in $appxerror)
|
||||
{
|
||||
# In most cases, Remove-AppPackage will fail due to the package not being found. Don't treat this as an error.
|
||||
if(!($error.Exception.Message -match "0x80073CF1"))
|
||||
{
|
||||
Write-Error $error
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Successfully removed $packageFullName"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Uninstall AppX packages that are known to cause issues with our tests"
|
||||
UninstallApps("*Skype*", "*Windows.Photos*")
|
||||
|
||||
Write-Host "Uninstall any of our test apps that may have been left over from previous test runs"
|
||||
UninstallTestApps("NugetPackageTestApp", "NugetPackageTestAppCX", "IXMPTestApp", "MUXControlsTestApp")
|
||||
|
||||
Write-Host "Uninstall MUX Framework package that may have been left over from previous test runs"
|
||||
# We don't want to uninstall all versions of the MUX Framework package, as there may be other apps preinstalled on the system
|
||||
# that depend on it. We only uninstall the Framework package that corresponds to the version of MUX that we are testing.
|
||||
[xml]$versionData = (Get-Content "version.props")
|
||||
$versionMajor = $versionData.GetElementsByTagName("MUXVersionMajor").'#text'
|
||||
$versionMinor = $versionData.GetElementsByTagName("MUXVersionMinor").'#text'
|
||||
UninstallApps("Microsoft.UI.Xaml.$versionMajor.$versionMinor")
|
||||
|
||||
Get-Process
|
||||
336
build/Helix/GenerateTestProjFile.ps1
Normal file
@@ -0,0 +1,336 @@
|
||||
[CmdLetBinding()]
|
||||
Param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$TestFile,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$OutputProjFile,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$JobTestSuiteName,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$TaefPath,
|
||||
|
||||
[string]$TaefQuery
|
||||
)
|
||||
|
||||
Class TestCollection
|
||||
{
|
||||
[string]$Name
|
||||
[string]$SetupMethodName
|
||||
[string]$TeardownMethodName
|
||||
[System.Collections.Generic.Dictionary[string, string]]$Properties
|
||||
|
||||
TestCollection()
|
||||
{
|
||||
if ($this.GetType() -eq [TestCollection])
|
||||
{
|
||||
throw "This class should never be instantiated directly; it should only be derived from."
|
||||
}
|
||||
}
|
||||
|
||||
TestCollection([string]$name)
|
||||
{
|
||||
$this.Init($name)
|
||||
}
|
||||
|
||||
hidden Init([string]$name)
|
||||
{
|
||||
$this.Name = $name
|
||||
$this.Properties = @{}
|
||||
}
|
||||
}
|
||||
|
||||
Class Test : TestCollection
|
||||
{
|
||||
Test([string]$name)
|
||||
{
|
||||
$this.Init($name)
|
||||
}
|
||||
}
|
||||
|
||||
Class TestClass : TestCollection
|
||||
{
|
||||
[System.Collections.Generic.List[Test]]$Tests
|
||||
|
||||
TestClass([string]$name)
|
||||
{
|
||||
$this.Init($name)
|
||||
$this.Tests = @{}
|
||||
}
|
||||
}
|
||||
|
||||
Class TestModule : TestCollection
|
||||
{
|
||||
[System.Collections.Generic.List[TestClass]]$TestClasses
|
||||
|
||||
TestModule([string]$name)
|
||||
{
|
||||
$this.Init($name)
|
||||
$this.TestClasses = @{}
|
||||
}
|
||||
}
|
||||
|
||||
function Parse-TestInfo([string]$taefOutput)
|
||||
{
|
||||
enum LineType
|
||||
{
|
||||
None
|
||||
TestModule
|
||||
TestClass
|
||||
Test
|
||||
Setup
|
||||
Teardown
|
||||
Property
|
||||
}
|
||||
|
||||
[string]$testModuleIndentation = " "
|
||||
[string]$testClassIndentation = " "
|
||||
[string]$testIndentation = " "
|
||||
[string]$setupBeginning = "Setup: "
|
||||
[string]$teardownBeginning = "Teardown: "
|
||||
[string]$propertyBeginning = "Property["
|
||||
|
||||
function Get-LineType([string]$line)
|
||||
{
|
||||
if ($line.Contains($setupBeginning))
|
||||
{
|
||||
return [LineType]::Setup;
|
||||
}
|
||||
elseif ($line.Contains($teardownBeginning))
|
||||
{
|
||||
return [LineType]::Teardown;
|
||||
}
|
||||
elseif ($line.Contains($propertyBeginning))
|
||||
{
|
||||
return [LineType]::Property;
|
||||
}
|
||||
elseif ($line.StartsWith($testModuleIndentation) -and -not $line.StartsWith("$testModuleIndentation "))
|
||||
{
|
||||
return [LineType]::TestModule;
|
||||
}
|
||||
elseif ($line.StartsWith($testClassIndentation) -and -not $line.StartsWith("$testClassIndentation "))
|
||||
{
|
||||
return [LineType]::TestClass;
|
||||
}
|
||||
elseif ($line.StartsWith($testIndentation) -and -not $line.StartsWith("$testIndentation "))
|
||||
{
|
||||
return [LineType]::Test;
|
||||
}
|
||||
else
|
||||
{
|
||||
return [LineType]::None;
|
||||
}
|
||||
}
|
||||
|
||||
[string[]]$lines = $taefOutput.Split(@([Environment]::NewLine, "`n"), [StringSplitOptions]::RemoveEmptyEntries)
|
||||
[System.Collections.Generic.List[TestModule]]$testModules = @()
|
||||
|
||||
[TestModule]$currentTestModule = $null
|
||||
[TestClass]$currentTestClass = $null
|
||||
[Test]$currentTest = $null
|
||||
|
||||
[TestCollection]$lastTestCollection = $null
|
||||
|
||||
foreach ($rawLine in $lines)
|
||||
{
|
||||
[LineType]$lineType = (Get-LineType $rawLine)
|
||||
|
||||
# We don't need the whitespace around the line anymore, so we'll discard it to make things easier.
|
||||
[string]$line = $rawLine.Trim()
|
||||
|
||||
if ($lineType -eq [LineType]::TestModule)
|
||||
{
|
||||
if ($currentTest -ne $null -and $currentTestClass -ne $null)
|
||||
{
|
||||
$currentTestClass.Tests.Add($currentTest)
|
||||
}
|
||||
|
||||
if ($currentTestClass -ne $null -and $currentTestModule -ne $null)
|
||||
{
|
||||
$currentTestModule.TestClasses.Add($currentTestClass)
|
||||
}
|
||||
|
||||
if ($currentTestModule -ne $null)
|
||||
{
|
||||
$testModules.Add($currentTestModule)
|
||||
}
|
||||
|
||||
$currentTestModule = [TestModule]::new($line)
|
||||
$currentTestClass = $null
|
||||
$currentTest = $null
|
||||
$lastTestCollection = $currentTestModule
|
||||
}
|
||||
elseif ($lineType -eq [LineType]::TestClass)
|
||||
{
|
||||
if ($currentTest -ne $null -and $currentTestClass -ne $null)
|
||||
{
|
||||
$currentTestClass.Tests.Add($currentTest)
|
||||
}
|
||||
|
||||
if ($currentTestClass -ne $null -and $currentTestModule -ne $null)
|
||||
{
|
||||
$currentTestModule.TestClasses.Add($currentTestClass)
|
||||
}
|
||||
|
||||
$currentTestClass = [TestClass]::new($line)
|
||||
$currentTest = $null
|
||||
$lastTestCollection = $currentTestClass
|
||||
}
|
||||
elseif ($lineType -eq [LineType]::Test)
|
||||
{
|
||||
if ($currentTest -ne $null -and $currentTestClass -ne $null)
|
||||
{
|
||||
$currentTestClass.Tests.Add($currentTest)
|
||||
}
|
||||
|
||||
$currentTest = [Test]::new($line)
|
||||
$lastTestCollection = $currentTest
|
||||
}
|
||||
elseif ($lineType -eq [LineType]::Setup)
|
||||
{
|
||||
if ($lastTestCollection -ne $null)
|
||||
{
|
||||
$lastTestCollection.SetupMethodName = $line.Replace($setupBeginning, "")
|
||||
}
|
||||
}
|
||||
elseif ($lineType -eq [LineType]::Teardown)
|
||||
{
|
||||
if ($lastTestCollection -ne $null)
|
||||
{
|
||||
$lastTestCollection.TeardownMethodName = $line.Replace($teardownBeginning, "")
|
||||
}
|
||||
}
|
||||
elseif ($lineType -eq [LineType]::Property)
|
||||
{
|
||||
if ($lastTestCollection -ne $null)
|
||||
{
|
||||
foreach ($match in [Regex]::Matches($line, "Property\[(.*)\]\s+=\s+(.*)"))
|
||||
{
|
||||
[string]$propertyKey = $match.Groups[1].Value;
|
||||
[string]$propertyValue = $match.Groups[2].Value;
|
||||
$lastTestCollection.Properties.Add($propertyKey, $propertyValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($currentTest -ne $null -and $currentTestClass -ne $null)
|
||||
{
|
||||
$currentTestClass.Tests.Add($currentTest)
|
||||
}
|
||||
|
||||
if ($currentTestClass -ne $null -and $currentTestModule -ne $null)
|
||||
{
|
||||
$currentTestModule.TestClasses.Add($currentTestClass)
|
||||
}
|
||||
|
||||
if ($currentTestModule -ne $null)
|
||||
{
|
||||
$testModules.Add($currentTestModule)
|
||||
}
|
||||
|
||||
return $testModules
|
||||
}
|
||||
|
||||
Write-Verbose "TaefQuery = $TaefQuery"
|
||||
|
||||
$TaefSelectQuery = ""
|
||||
$TaefQueryToAppend = ""
|
||||
if($TaefQuery)
|
||||
{
|
||||
$TaefSelectQuery = "/select:`"$TaefQuery`""
|
||||
$TaefQueryToAppend = " and $TaefQuery"
|
||||
}
|
||||
Write-Verbose "TaefSelectQuery = $TaefSelectQuery"
|
||||
|
||||
|
||||
$taefExe = "$TaefPath\te.exe"
|
||||
[string]$taefOutput = & "$taefExe" /listproperties $TaefSelectQuery $TestFile | Out-String
|
||||
|
||||
[System.Collections.Generic.List[TestModule]]$testModules = (Parse-TestInfo $taefOutput)
|
||||
|
||||
$projFileContent = @"
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
"@
|
||||
|
||||
foreach ($testModule in $testModules)
|
||||
{
|
||||
foreach ($testClass in $testModules.TestClasses)
|
||||
{
|
||||
Write-Host "Generating Helix work item for test class $($testClass.Name)..."
|
||||
[System.Collections.Generic.List[string]]$testSuiteNames = @()
|
||||
|
||||
$testSuiteExists = $false
|
||||
$suitelessTestExists = $false
|
||||
|
||||
foreach ($test in $testClass.Tests)
|
||||
{
|
||||
# A test method inherits its 'TestSuite' property from its TestClass
|
||||
if (!$test.Properties.ContainsKey("TestSuite") -and $testClass.Properties.ContainsKey("TestSuite"))
|
||||
{
|
||||
$test.Properties["TestSuite"] = $testClass.Properties["TestSuite"]
|
||||
}
|
||||
|
||||
if ($test.Properties.ContainsKey("TestSuite"))
|
||||
{
|
||||
[string]$testSuite = $test.Properties["TestSuite"]
|
||||
|
||||
if (-not $testSuiteNames.Contains($testSuite))
|
||||
{
|
||||
Write-Host " Found test suite $testSuite. Generating Helix work item for it as well."
|
||||
$testSuiteNames.Add($testSuite)
|
||||
}
|
||||
|
||||
$testSuiteExists = $true
|
||||
}
|
||||
else
|
||||
{
|
||||
$suitelessTestExists = $true
|
||||
}
|
||||
}
|
||||
|
||||
$testClassSelectPattern = "$($testClass.Name).*"
|
||||
if($testClass.Name.Contains("::"))
|
||||
{
|
||||
$testClassSelectPattern = "$($testClass.Name)::*"
|
||||
}
|
||||
$testNameQuery= "(@Name='$testClassSelectPattern')"
|
||||
|
||||
$workItemName = $testClass.Name
|
||||
# Native tests use '::' as a separator, which is not valid for workItem names.
|
||||
$workItemName = $workItemName -replace "::", "-"
|
||||
|
||||
if ($suitelessTestExists)
|
||||
{
|
||||
$projFileContent += @"
|
||||
|
||||
<HelixWorkItem Include="$($workItemName)" Condition="'`$(TestSuite)'=='$($JobTestSuiteName)'">
|
||||
<Timeout>00:30:00</Timeout>
|
||||
<Command>call %HELIX_CORRELATION_PAYLOAD%\runtests.cmd /select:"(@Name='$($testClass.Name)*'$(if ($testSuiteExists) { "and not @TestSuite='*'" }))$($TaefQueryToAppend)"</Command>
|
||||
</HelixWorkItem>
|
||||
"@
|
||||
}
|
||||
|
||||
foreach ($testSuiteName in $testSuiteNames)
|
||||
{
|
||||
$projFileContent += @"
|
||||
|
||||
<HelixWorkItem Include="$($workItemName)-$testSuiteName" Condition="'`$(TestSuite)'=='$($JobTestSuiteName)'">
|
||||
<Timeout>00:30:00</Timeout>
|
||||
<Command>call %HELIX_CORRELATION_PAYLOAD%\runtests.cmd /select:"(@Name='$($testClass.Name)*' and @TestSuite='$testSuiteName')$($TaefQueryToAppend)"</Command>
|
||||
</HelixWorkItem>
|
||||
"@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$projFileContent += @"
|
||||
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
"@
|
||||
|
||||
Set-Content $OutputProjFile $projFileContent -NoNewline -Encoding UTF8
|
||||
@@ -20,13 +20,32 @@ namespace HelixTestHelpers
|
||||
public string Name { get; set; }
|
||||
public string SourceWttFile { get; set; }
|
||||
public bool Passed { get; set; }
|
||||
public bool Skipped { get; set; }
|
||||
public bool CleanupPassed { get; set; }
|
||||
public TimeSpan ExecutionTime { get; set; }
|
||||
public string Details { get; set; }
|
||||
|
||||
public List<string> Screenshots { get; private set; }
|
||||
public List<TestResult> RerunResults { get; private set; }
|
||||
|
||||
// Returns true if the test pass rate is sufficient to avoid being counted as a failure.
|
||||
public bool PassedOrUnreliable(int requiredNumberOfPasses)
|
||||
{
|
||||
if(Passed)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(RerunResults.Count == 1)
|
||||
{
|
||||
return RerunResults[0].Passed;
|
||||
}
|
||||
else
|
||||
{
|
||||
return RerunResults.Where(r => r.Passed).Count() >= requiredNumberOfPasses;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -202,9 +221,7 @@ namespace HelixTestHelpers
|
||||
testsExecuting--;
|
||||
|
||||
// If any inner test fails, we'll still fail the outer
|
||||
var value = element.Attribute("Result").Value;
|
||||
currentResult.Passed = value == "Pass";
|
||||
currentResult.Skipped = value == "Skipped";
|
||||
currentResult.Passed &= element.Attribute("Result").Value == "Pass";
|
||||
|
||||
// Only gather execution data if this is the outer test we ran initially
|
||||
if (testsExecuting == 0)
|
||||
@@ -481,7 +498,7 @@ namespace HelixTestHelpers
|
||||
return subResultsJsonByMethod;
|
||||
}
|
||||
|
||||
public void ConvertWttLogToXUnitLog(string wttInputPath, string wttSingleRerunInputPath, string wttMultipleRerunInputPath, string xunitOutputPath)
|
||||
public void ConvertWttLogToXUnitLog(string wttInputPath, string wttSingleRerunInputPath, string wttMultipleRerunInputPath, string xunitOutputPath, int requiredPassRateThreshold)
|
||||
{
|
||||
TestPass testPass = TestPass.ParseTestWttFileWithReruns(wttInputPath, wttSingleRerunInputPath, wttMultipleRerunInputPath, cleanupFailuresAreRegressions: true, truncateTestNames: false);
|
||||
var results = testPass.TestResults;
|
||||
@@ -493,8 +510,8 @@ namespace HelixTestHelpers
|
||||
// If the test failed sufficiently often enough for it to count as a failed test (determined by a property on the
|
||||
// Azure DevOps job), we'll later mark it as failed during test results processing.
|
||||
|
||||
int failedCount = results.Where(r => !r.Passed).Count();
|
||||
int skippedCount = results.Where(r => (!r.Passed && r.Skipped)).Count();
|
||||
int failedCount = results.Where(r => !r.PassedOrUnreliable(requiredPassRateThreshold)).Count();
|
||||
int skippedCount = results.Where(r => !r.Passed && r.PassedOrUnreliable(requiredPassRateThreshold)).Count();
|
||||
|
||||
var root = new XElement("assemblies");
|
||||
|
||||
@@ -540,13 +557,12 @@ namespace HelixTestHelpers
|
||||
|
||||
string resultString = string.Empty;
|
||||
|
||||
if (result.Passed && !result.Skipped)
|
||||
if (result.Passed)
|
||||
{
|
||||
resultString = "Pass";
|
||||
}
|
||||
else if (result.Skipped)
|
||||
else if(result.PassedOrUnreliable(requiredPassRateThreshold))
|
||||
{
|
||||
|
||||
resultString = "Skip";
|
||||
}
|
||||
else
|
||||
@@ -555,25 +571,31 @@ namespace HelixTestHelpers
|
||||
}
|
||||
|
||||
|
||||
test.SetAttributeValue("result", resultString);
|
||||
|
||||
if (!result.Passed)
|
||||
{
|
||||
if (result.Skipped)
|
||||
// If a test failed, we'll have rerun it multiple times.
|
||||
// We'll save the subresults to a JSON text file that we'll upload to the helix results container -
|
||||
// this allows it to be as long as we want, whereas the reason field in Azure DevOps has a 4000 character limit.
|
||||
string subResultsFileName = methodName + "_subresults.json";
|
||||
string subResultsFilePath = Path.Combine(Path.GetDirectoryName(wttInputPath), subResultsFileName);
|
||||
|
||||
if (result.PassedOrUnreliable(requiredPassRateThreshold))
|
||||
{
|
||||
var reason = new XElement("reason");
|
||||
reason.Add(new XCData("Test skipped"));
|
||||
reason.Add(new XCData(GetUploadedFileUrl(subResultsFileName, helixResultsContainerUri, helixResultsContainerRsas)));
|
||||
test.Add(reason);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
var failure = new XElement("failure");
|
||||
var message = new XElement("message");
|
||||
message.Add(new XCData("Test failed"));
|
||||
message.Add(new XCData(GetUploadedFileUrl(subResultsFileName, helixResultsContainerUri, helixResultsContainerRsas)));
|
||||
failure.Add(message);
|
||||
test.Add(failure);
|
||||
}
|
||||
}
|
||||
|
||||
test.SetAttributeValue("result", resultString);
|
||||
|
||||
collection.Add(test);
|
||||
}
|
||||
|
||||
|
||||
12
build/Helix/InstallTestAppDependencies.ps1
Normal file
@@ -0,0 +1,12 @@
|
||||
# Displaying progress is unnecessary and is just distracting.
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
$dependencyFiles = Get-ChildItem -Filter "*Microsoft.VCLibs.*.appx"
|
||||
|
||||
foreach ($file in $dependencyFiles)
|
||||
{
|
||||
Write-Host "Adding dependency $($file)..."
|
||||
|
||||
Add-AppxPackage $file
|
||||
|
||||
}
|
||||
8
build/Helix/OutputFailedTestQuery.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
Param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$WttInputPath
|
||||
)
|
||||
|
||||
Add-Type -Language CSharp -ReferencedAssemblies System.Xml,System.Xml.Linq,System.Runtime.Serialization,System.Runtime.Serialization.Json (Get-Content $PSScriptRoot\HelixTestHelpers.cs -Raw)
|
||||
|
||||
[HelixTestHelpers.FailedTestDetector]::OutputFailedTestQuery($WttInputPath)
|
||||
32
build/Helix/OutputSubResultsJsonFiles.ps1
Normal file
@@ -0,0 +1,32 @@
|
||||
Param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$WttInputPath,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$WttSingleRerunInputPath,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$WttMultipleRerunInputPath,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$TestNamePrefix
|
||||
)
|
||||
|
||||
# Ideally these would be passed as parameters to the script. However ps makes it difficult to deal with string literals containing '&', so we just
|
||||
# read the values directly from the environment variables
|
||||
$helixResultsContainerUri = $Env:HELIX_RESULTS_CONTAINER_URI
|
||||
$helixResultsContainerRsas = $Env:HELIX_RESULTS_CONTAINER_RSAS
|
||||
|
||||
Add-Type -Language CSharp -ReferencedAssemblies System.Xml,System.Xml.Linq,System.Runtime.Serialization,System.Runtime.Serialization.Json (Get-Content $PSScriptRoot\HelixTestHelpers.cs -Raw)
|
||||
|
||||
$testResultParser = [HelixTestHelpers.TestResultParser]::new($TestNamePrefix, $helixResultsContainerUri, $helixResultsContainerRsas)
|
||||
[System.Collections.Generic.Dictionary[string, string]]$subResultsJsonByMethodName = $testResultParser.GetSubResultsJsonByMethodName($WttInputPath, $WttSingleRerunInputPath, $WttMultipleRerunInputPath)
|
||||
|
||||
$subResultsJsonDirectory = [System.IO.Path]::GetDirectoryName($WttInputPath)
|
||||
|
||||
foreach ($methodName in $subResultsJsonByMethodName.Keys)
|
||||
{
|
||||
$subResultsJson = $subResultsJsonByMethodName[$methodName]
|
||||
$subResultsJsonPath = [System.IO.Path]::Combine($subResultsJsonDirectory, $methodName + "_subresults.json")
|
||||
Out-File $subResultsJsonPath -Encoding utf8 -InputObject $subResultsJson
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
Param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$XUnitOutputPath
|
||||
)
|
||||
|
||||
# This script is used to parse the XUnit output from the test runs and print out
|
||||
# the tests that failed.
|
||||
#
|
||||
# Why you might ask? Well, it sure seems like Azure DevOps doesn't like the fact
|
||||
# that we just call our tests in a powershell script. It can't seemingly find
|
||||
# the actual errors in the TAEF logs. That means when you just go to the
|
||||
# "Checks" page on GitHub, the Azure DevOps integration doesn't have anything
|
||||
# meaningful to say other than "PowerShell exited with code '1'". If we however,
|
||||
# just manually emit the test names formatted with "#[error]" in front of them,
|
||||
# well, then the integration will all work like magic.
|
||||
|
||||
# Load the test results as a XML object
|
||||
$testResults = [xml](Get-Content -Path $XUnitOutputPath)
|
||||
|
||||
# Our XML looks like:
|
||||
# <assemblies>
|
||||
# <assembly name="MUXControls.Test.dll" test-framework="TAEF" run-date="2023-08-14" run-time="11:38:01" total="524" passed="520" failed="4" skipped="1" time="8943" errors="0">
|
||||
# <collection total="524" passed="520" failed="4" skipped="1" name="Test collection" time="8943">
|
||||
# <test name="ControlCoreTests::TestSimpleClickSelection" type="ControlCoreTests" method="TestSimpleClickSelection" time="0.016" result="Fail">
|
||||
|
||||
# Iterate over all the assemblies and print all the tests that failed
|
||||
foreach ($assembly in $testResults.assemblies.assembly) {
|
||||
foreach ($collection in $assembly.collection) {
|
||||
foreach ($test in $collection.test) {
|
||||
if ($test.result -eq "Fail") {
|
||||
# This particular format is taken from the Azure DevOps documentation:
|
||||
# https://github.com/microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
|
||||
# This will treat this line as an error message
|
||||
Write-Output "##vso[task.logissue type=error]$($test.name) Failed"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
131
build/Helix/OutputTestResults.ps1
Normal file
@@ -0,0 +1,131 @@
|
||||
Param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[int]$MinimumExpectedTestsExecutedCount,
|
||||
|
||||
[string]$AccessToken = $env:SYSTEM_ACCESSTOKEN,
|
||||
[string]$CollectionUri = $env:SYSTEM_COLLECTIONURI,
|
||||
[string]$TeamProject = $env:SYSTEM_TEAMPROJECT,
|
||||
[string]$BuildUri = $env:BUILD_BUILDURI,
|
||||
[bool]$CheckJobAttempt
|
||||
)
|
||||
|
||||
$azureDevOpsRestApiHeaders = @{
|
||||
"Accept"="application/json"
|
||||
"Authorization"="Basic $([System.Convert]::ToBase64String([System.Text.ASCIIEncoding]::ASCII.GetBytes(":$AccessToken")))"
|
||||
}
|
||||
|
||||
. "$PSScriptRoot/AzurePipelinesHelperScripts.ps1"
|
||||
|
||||
Write-Host "Checking test results..."
|
||||
|
||||
$queryUri = GetQueryTestRunsUri -CollectionUri $CollectionUri -TeamProject $TeamProject -BuildUri $BuildUri -IncludeRunDetails
|
||||
Write-Host "queryUri = $queryUri"
|
||||
|
||||
$testRuns = Invoke-RestMethodWithRetries $queryUri -Headers $azureDevOpsRestApiHeaders
|
||||
[System.Collections.Generic.List[string]]$failingTests = @()
|
||||
[System.Collections.Generic.List[string]]$unreliableTests = @()
|
||||
[System.Collections.Generic.List[string]]$unexpectedResultTest = @()
|
||||
|
||||
[System.Collections.Generic.List[string]]$namesOfProcessedTestRuns = @()
|
||||
$totalTestsExecutedCount = 0
|
||||
|
||||
# We assume that we only have one testRun with a given name that we care about
|
||||
# We only process the last testRun with a given name (based on completedDate)
|
||||
# The name of a testRun is set to the Helix queue that it was run on (e.g. windows.10.amd64.client21h1.xaml)
|
||||
# If we have multiple test runs on the same queue that we care about, we will need to re-visit this logic
|
||||
foreach ($testRun in ($testRuns.value | Sort-Object -Property "completedDate" -Descending))
|
||||
{
|
||||
if ($CheckJobAttempt)
|
||||
{
|
||||
if ($namesOfProcessedTestRuns -contains $testRun.name)
|
||||
{
|
||||
Write-Host "Skipping test run '$($testRun.name)', since we have already processed a test run of that name."
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Processing results from test run '$($testRun.name)'"
|
||||
$namesOfProcessedTestRuns.Add($testRun.name)
|
||||
|
||||
$totalTestsExecutedCount += $testRun.totalTests
|
||||
|
||||
$testRunResultsUri = "$($testRun.url)/results?api-version=5.0"
|
||||
$testResults = Invoke-RestMethodWithRetries "$($testRun.url)/results?api-version=5.0" -Headers $azureDevOpsRestApiHeaders
|
||||
|
||||
foreach ($testResult in $testResults.value)
|
||||
{
|
||||
$shortTestCaseTitle = $testResult.testCaseTitle -replace "[a-zA-Z0-9]+.[a-zA-Z0-9]+.Windows.UI.Xaml.Tests.MUXControls.",""
|
||||
|
||||
if ($testResult.outcome -eq "Failed")
|
||||
{
|
||||
if (-not $failingTests.Contains($shortTestCaseTitle))
|
||||
{
|
||||
$failingTests.Add($shortTestCaseTitle)
|
||||
}
|
||||
}
|
||||
elseif ($testResult.outcome -eq "Warning")
|
||||
{
|
||||
if (-not $unreliableTests.Contains($shortTestCaseTitle))
|
||||
{
|
||||
$unreliableTests.Add($shortTestCaseTitle)
|
||||
}
|
||||
}
|
||||
elseif ($testResult.outcome -ne "Passed")
|
||||
{
|
||||
# We should only see tests with result "Passed", "Failed" or "Warning"
|
||||
if (-not $unexpectedResultTest.Contains($shortTestCaseTitle))
|
||||
{
|
||||
$unexpectedResultTest.Add($shortTestCaseTitle)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($unreliableTests.Count -gt 0)
|
||||
{
|
||||
Write-Host @"
|
||||
##vso[task.logissue type=warning;]Unreliable tests:
|
||||
##vso[task.logissue type=warning;]$($unreliableTests -join "$([Environment]::NewLine)##vso[task.logissue type=warning;]")
|
||||
|
||||
"@
|
||||
}
|
||||
|
||||
if ($failingTests.Count -gt 0)
|
||||
{
|
||||
Write-Host @"
|
||||
##vso[task.logissue type=error;]Failing tests:
|
||||
##vso[task.logissue type=error;]$($failingTests -join "$([Environment]::NewLine)##vso[task.logissue type=error;]")
|
||||
|
||||
"@
|
||||
}
|
||||
|
||||
if ($unexpectedResultTest.Count -gt 0)
|
||||
{
|
||||
Write-Host @"
|
||||
##vso[task.logissue type=error;]Tests with unexpected results:
|
||||
##vso[task.logissue type=error;]$($unexpectedResultTest -join "$([Environment]::NewLine)##vso[task.logissue type=error;]")
|
||||
|
||||
"@
|
||||
}
|
||||
|
||||
if($totalTestsExecutedCount -lt $MinimumExpectedTestsExecutedCount)
|
||||
{
|
||||
Write-Host "Expected at least $MinimumExpectedTestsExecutedCount tests to be executed."
|
||||
Write-Host "Actual executed test count is: $totalTestsExecutedCount"
|
||||
Write-Host "##vso[task.complete result=Failed;]"
|
||||
}
|
||||
elseif ($failingTests.Count -gt 0)
|
||||
{
|
||||
Write-Host "At least one test failed."
|
||||
Write-Host "##vso[task.complete result=Failed;]"
|
||||
}
|
||||
elseif ($unreliableTests.Count -gt 0)
|
||||
{
|
||||
Write-Host "All tests eventually passed, but some initially failed."
|
||||
Write-Host "##vso[task.complete result=Succeeded;]"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "All tests passed."
|
||||
Write-Host "##vso[task.complete result=Succeeded;]"
|
||||
}
|
||||
62
build/Helix/PrepareHelixPayload.ps1
Normal file
@@ -0,0 +1,62 @@
|
||||
[CmdLetBinding()]
|
||||
Param(
|
||||
[string]$Platform,
|
||||
[string]$Configuration,
|
||||
[string]$ArtifactName='drop'
|
||||
)
|
||||
|
||||
$payloadDir = "HelixPayload\$Configuration\$Platform"
|
||||
|
||||
$repoDirectory = Join-Path (Split-Path -Parent $script:MyInvocation.MyCommand.Path) "..\..\"
|
||||
$nugetPackagesDir = Join-Path (Split-Path -Parent $script:MyInvocation.MyCommand.Path) "packages"
|
||||
|
||||
# Create the payload directory. Remove it if it already exists.
|
||||
If(test-path $payloadDir)
|
||||
{
|
||||
Remove-Item $payloadDir -Recurse
|
||||
}
|
||||
New-Item -ItemType Directory -Force -Path $payloadDir
|
||||
|
||||
# Copy files from nuget packages
|
||||
Copy-Item "$nugetPackagesDir\microsoft.windows.apps.test.1.0.181203002\lib\netcoreapp2.1\*.dll" $payloadDir
|
||||
Copy-Item "$nugetPackagesDir\Microsoft.Taef.10.60.210621002\build\Binaries\$Platform\*" $payloadDir
|
||||
Copy-Item "$nugetPackagesDir\Microsoft.Taef.10.60.210621002\build\Binaries\$Platform\NetFx4.5\*" $payloadDir
|
||||
New-Item -ItemType Directory -Force -Path "$payloadDir\.NETCoreApp2.1\"
|
||||
Copy-Item "$nugetPackagesDir\runtime.win-$Platform.microsoft.netcore.app.2.1.0\runtimes\win-$Platform\lib\netcoreapp2.1\*" "$payloadDir\.NETCoreApp2.1\"
|
||||
Copy-Item "$nugetPackagesDir\runtime.win-$Platform.microsoft.netcore.app.2.1.0\runtimes\win-$Platform\native\*" "$payloadDir\.NETCoreApp2.1\"
|
||||
New-Item -ItemType Directory -Force -Path "$payloadDir\content\"
|
||||
Copy-Item "$nugetPackagesDir\Microsoft.Internal.Windows.Terminal.TestContent.1.0.1\content\*" "$payloadDir\content\"
|
||||
|
||||
function Copy-If-Exists
|
||||
{
|
||||
Param($source, $destinationDir)
|
||||
|
||||
if (Test-Path $source)
|
||||
{
|
||||
Write-Host "Copy from '$source' to '$destinationDir'"
|
||||
Copy-Item -Force $source $destinationDir
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "'$source' does not exist."
|
||||
}
|
||||
}
|
||||
|
||||
# Copy files from the 'drop' artifact dir
|
||||
Copy-Item "$repoDirectory\Artifacts\$ArtifactName\$Configuration\$Platform\Test\*" $payloadDir -Recurse
|
||||
|
||||
# Copy files from the repo
|
||||
New-Item -ItemType Directory -Force -Path "$payloadDir"
|
||||
Copy-Item "build\helix\ConvertWttLogToXUnit.ps1" "$payloadDir"
|
||||
Copy-Item "build\helix\OutputFailedTestQuery.ps1" "$payloadDir"
|
||||
Copy-Item "build\helix\OutputSubResultsJsonFiles.ps1" "$payloadDir"
|
||||
Copy-Item "build\helix\HelixTestHelpers.cs" "$payloadDir"
|
||||
Copy-Item "build\helix\runtests.cmd" $payloadDir
|
||||
Copy-Item "build\helix\InstallTestAppDependencies.ps1" "$payloadDir"
|
||||
Copy-Item "build\Helix\EnsureMachineState.ps1" "$payloadDir"
|
||||
|
||||
# Extract the unpackaged distribution of Windows Terminal to the payload directory,
|
||||
# where it will create a subdirectory named terminal-0.0.1.0
|
||||
# This is referenced in TerminalApp.cs later as part of the test harness.
|
||||
& tar -x -v -f "$repoDirectory\Artifacts\$ArtifactName\unpackaged\WindowsTerminalDev_0.0.1.0_x64.zip" -C "$payloadDir"
|
||||
Copy-Item "res\fonts\*.ttf" "$payloadDir\terminal-0.0.1.0"
|
||||
130
build/Helix/ProcessHelixFiles.ps1
Normal file
@@ -0,0 +1,130 @@
|
||||
Param(
|
||||
[string]$AccessToken = $env:SYSTEM_ACCESSTOKEN,
|
||||
[string]$HelixAccessToken = $env:HelixAccessToken,
|
||||
[string]$CollectionUri = $env:SYSTEM_COLLECTIONURI,
|
||||
[string]$TeamProject = $env:SYSTEM_TEAMPROJECT,
|
||||
[string]$BuildUri = $env:BUILD_BUILDURI,
|
||||
[string]$OutputFolder = "HelixOutput"
|
||||
)
|
||||
|
||||
$helixLinkFile = "$OutputFolder\LinksToHelixTestFiles.html"
|
||||
|
||||
|
||||
function Generate-File-Links
|
||||
{
|
||||
Param ([Array[]]$files,[string]$sectionName)
|
||||
if($files.Count -gt 0)
|
||||
{
|
||||
Out-File -FilePath $helixLinkFile -Append -InputObject "<div class=$sectionName>"
|
||||
Out-File -FilePath $helixLinkFile -Append -InputObject "<h4>$sectionName</h4>"
|
||||
Out-File -FilePath $helixLinkFile -Append -InputObject "<ul>"
|
||||
foreach($file in $files)
|
||||
{
|
||||
$url = Append-HelixAccessTokenToUrl $file.Link "{Your-Helix-Access-Token-Here}"
|
||||
Out-File -FilePath $helixLinkFile -Append -InputObject "<li>$($url)</li>"
|
||||
}
|
||||
Out-File -FilePath $helixLinkFile -Append -InputObject "</ul>"
|
||||
Out-File -FilePath $helixLinkFile -Append -InputObject "</div>"
|
||||
}
|
||||
}
|
||||
|
||||
function Append-HelixAccessTokenToUrl
|
||||
{
|
||||
Param ([string]$url, [string]$token)
|
||||
if($token)
|
||||
{
|
||||
if($url.Contains("?"))
|
||||
{
|
||||
$url = "$($url)&access_token=$($token)"
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = "$($url)?access_token=$($token)"
|
||||
}
|
||||
}
|
||||
return $url
|
||||
}
|
||||
|
||||
#Create output directory
|
||||
New-Item $OutputFolder -ItemType Directory
|
||||
|
||||
$azureDevOpsRestApiHeaders = @{
|
||||
"Accept"="application/json"
|
||||
"Authorization"="Basic $([System.Convert]::ToBase64String([System.Text.ASCIIEncoding]::ASCII.GetBytes(":$AccessToken")))"
|
||||
}
|
||||
|
||||
. "$PSScriptRoot/AzurePipelinesHelperScripts.ps1"
|
||||
|
||||
$queryUri = GetQueryTestRunsUri -CollectionUri $CollectionUri -TeamProject $TeamProject -BuildUri $BuildUri -IncludeRunDetails
|
||||
Write-Host "queryUri = $queryUri"
|
||||
|
||||
$testRuns = Invoke-RestMethodWithRetries $queryUri -Headers $azureDevOpsRestApiHeaders
|
||||
$webClient = New-Object System.Net.WebClient
|
||||
[System.Collections.Generic.List[string]]$workItems = @()
|
||||
|
||||
foreach ($testRun in $testRuns.value)
|
||||
{
|
||||
Write-Host "testRunUri = $testRun.url"
|
||||
$testResults = Invoke-RestMethodWithRetries "$($testRun.url)/results?api-version=5.0" -Headers $azureDevOpsRestApiHeaders
|
||||
$isTestRunNameShown = $false
|
||||
|
||||
foreach ($testResult in $testResults.value)
|
||||
{
|
||||
$info = ConvertFrom-Json ([System.Web.HttpUtility]::HtmlDecode($testResult.comment))
|
||||
$helixJobId = $info.HelixJobId
|
||||
$helixWorkItemName = $info.HelixWorkItemName
|
||||
|
||||
$workItem = "$helixJobId-$helixWorkItemName"
|
||||
|
||||
Write-Host "Helix Work Item = $workItem"
|
||||
|
||||
if (-not $workItems.Contains($workItem))
|
||||
{
|
||||
$workItems.Add($workItem)
|
||||
$filesQueryUri = "https://helix.dot.net/api/2019-06-17/jobs/$helixJobId/workitems/$helixWorkItemName/files"
|
||||
$filesQueryUri = Append-HelixAccessTokenToUrl $filesQueryUri $helixAccessToken
|
||||
$files = Invoke-RestMethodWithRetries $filesQueryUri
|
||||
|
||||
$screenShots = $files | where { $_.Name.EndsWith(".jpg") }
|
||||
$dumps = $files | where { $_.Name.EndsWith(".dmp") }
|
||||
$pgcFiles = $files | where { $_.Name.EndsWith(".pgc") }
|
||||
if ($screenShots.Count + $dumps.Count + $pgcFiles.Count -gt 0)
|
||||
{
|
||||
if(-Not $isTestRunNameShown)
|
||||
{
|
||||
Out-File -FilePath $helixLinkFile -Append -InputObject "<h2>$($testRun.name)</h2>"
|
||||
$isTestRunNameShown = $true
|
||||
}
|
||||
Out-File -FilePath $helixLinkFile -Append -InputObject "<h3>$helixWorkItemName</h3>"
|
||||
Generate-File-Links $screenShots "Screenshots"
|
||||
Generate-File-Links $dumps "CrashDumps"
|
||||
Generate-File-Links $pgcFiles "PGC files"
|
||||
$misc = $files | where { ($screenShots -NotContains $_) -And ($dumps -NotContains $_) -And ($visualTreeVerificationFiles -NotContains $_) -And ($pgcFiles -NotContains $_) }
|
||||
Generate-File-Links $misc "Misc"
|
||||
|
||||
foreach($pgcFile in $pgcFiles)
|
||||
{
|
||||
$flavorPath = $testResult.automatedTestName.Split('.')[0]
|
||||
$archPath = $testResult.automatedTestName.Split('.')[1]
|
||||
$fileName = $pgcFile.Name
|
||||
$fullPath = "$OutputFolder\PGO\$flavorPath\$archPath"
|
||||
$destination = "$fullPath\$fileName"
|
||||
|
||||
Write-Host "Copying $($pgcFile.Name) to $destination"
|
||||
|
||||
if (-Not (Test-Path $fullPath))
|
||||
{
|
||||
New-Item $fullPath -ItemType Directory
|
||||
}
|
||||
|
||||
$link = $pgcFile.Link
|
||||
|
||||
Write-Host "Downloading $link to $destination"
|
||||
|
||||
$link = Append-HelixAccessTokenToUrl $link $HelixAccessToken
|
||||
Download-FileWithRetries $link $destination
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
build/Helix/RunTestsInHelix.proj
Normal file
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">
|
||||
<PropertyGroup>
|
||||
<HelixSource>pr/terminal/$(BUILD_SOURCEBRANCH)/</HelixSource>
|
||||
<EnableXUnitReporter>true</EnableXUnitReporter>
|
||||
<EnableAzurePipelinesReporter>true</EnableAzurePipelinesReporter>
|
||||
<FailOnMissionControlTestFailure>true</FailOnMissionControlTestFailure>
|
||||
<HelixPreCommands>$(HelixPreCommands);set testnameprefix=$(Configuration).$(Platform);set testbuildplatform=$(Platform);set rerunPassesRequiredToAvoidFailure=$(rerunPassesRequiredToAvoidFailure)</HelixPreCommands>
|
||||
<OutputPath>..\..\bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<HelixCorrelationPayload Include="..\..\HelixPayload\$(Configuration)\$(Platform)" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- These .proj files are generated by the build machine prior to running tests via GenerateTestProjFile.ps1. -->
|
||||
<Import Project="$(ProjFilesPath)\$(Configuration)\$(Platform)\RunTestsInHelix-TerminalAppLocalTests.proj" Condition=" '$(TestSuite)'=='DevTestSuite' " />
|
||||
<Import Project="$(ProjFilesPath)\$(Configuration)\$(Platform)\RunTestsInHelix-SettingsModelLocalTests.proj" Condition=" '$(TestSuite)'=='DevTestSuite' " />
|
||||
<Import Project="$(ProjFilesPath)\$(Configuration)\$(Platform)\RunTestsInHelix-HostTestsUIA.proj" Condition=" '$(TestSuite)'=='DevTestSuite' " />
|
||||
<Import Project="$(ProjFilesPath)\$(Configuration)\$(Platform)\RunTestsInHelix-WindowsTerminalUIATests.proj" Condition=" '$(TestSuite)'=='PgoInstrumentationSuite' " />
|
||||
</Project>
|
||||
136
build/Helix/UpdateUnreliableTests.ps1
Normal file
@@ -0,0 +1,136 @@
|
||||
[CmdLetBinding()]
|
||||
Param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[int]$RerunPassesRequiredToAvoidFailure,
|
||||
|
||||
[string]$AccessToken = $env:SYSTEM_ACCESSTOKEN,
|
||||
[string]$CollectionUri = $env:SYSTEM_COLLECTIONURI,
|
||||
[string]$TeamProject = $env:SYSTEM_TEAMPROJECT,
|
||||
[string]$BuildUri = $env:BUILD_BUILDURI
|
||||
)
|
||||
|
||||
. "$PSScriptRoot/AzurePipelinesHelperScripts.ps1"
|
||||
|
||||
|
||||
$azureDevOpsRestApiHeaders = @{
|
||||
"Accept"="application/json"
|
||||
"Authorization"="Basic $([System.Convert]::ToBase64String([System.Text.ASCIIEncoding]::ASCII.GetBytes(":$AccessToken")))"
|
||||
}
|
||||
|
||||
$queryUri = GetQueryTestRunsUri -CollectionUri $CollectionUri -TeamProject $TeamProject -BuildUri $BuildUri
|
||||
Write-Host "queryUri = $queryUri"
|
||||
|
||||
# To account for unreliable tests, we'll iterate through all of the tests associated with this build, check to see any tests that were unreliable
|
||||
# (denoted by being marked as "skipped"), and if so, we'll instead mark those tests with a warning and enumerate all of the attempted runs
|
||||
# with their pass/fail states as well as any relevant error messages for failed attempts.
|
||||
$testRuns = Invoke-RestMethodWithRetries $queryUri -Headers $azureDevOpsRestApiHeaders
|
||||
|
||||
$timesSeenByRunName = @{}
|
||||
|
||||
foreach ($testRun in $testRuns.value)
|
||||
{
|
||||
$testRunResultsUri = "$($testRun.url)/results?api-version=5.0"
|
||||
|
||||
Write-Host "Marking test run `"$($testRun.name)`" as in progress so we can change its results to account for unreliable tests."
|
||||
Invoke-RestMethod "$($testRun.url)?api-version=5.0" -Method Patch -Body (ConvertTo-Json @{ "state" = "InProgress" }) -Headers $azureDevOpsRestApiHeaders -ContentType "application/json" | Out-Null
|
||||
|
||||
Write-Host "Retrieving test results..."
|
||||
$testResults = Invoke-RestMethodWithRetries $testRunResultsUri -Headers $azureDevOpsRestApiHeaders
|
||||
|
||||
foreach ($testResult in $testResults.value)
|
||||
{
|
||||
$testNeedsSubResultProcessing = $false
|
||||
if ($testResult.outcome -eq "NotExecuted")
|
||||
{
|
||||
$testNeedsSubResultProcessing = $true
|
||||
}
|
||||
elseif($testResult.outcome -eq "Failed")
|
||||
{
|
||||
$testNeedsSubResultProcessing = $testResult.errorMessage -like "*_subresults.json*"
|
||||
}
|
||||
|
||||
if ($testNeedsSubResultProcessing)
|
||||
{
|
||||
Write-Host " Test $($testResult.testCaseTitle) was detected as unreliable. Updating..."
|
||||
|
||||
# The errorMessage field contains a link to the JSON-encoded rerun result data.
|
||||
$resultsJson = Download-StringWithRetries "Error results" $testResult.errorMessage
|
||||
$rerunResults = ConvertFrom-Json $resultsJson
|
||||
[System.Collections.Generic.List[System.Collections.Hashtable]]$rerunDataList = @()
|
||||
$attemptCount = 0
|
||||
$passCount = 0
|
||||
$totalDuration = 0
|
||||
|
||||
foreach ($rerun in $rerunResults.results)
|
||||
{
|
||||
$rerunData = @{
|
||||
"displayName" = "Attempt #$($attemptCount + 1) - $($testResult.testCaseTitle)";
|
||||
"durationInMs" = $rerun.duration;
|
||||
"outcome" = $rerun.outcome;
|
||||
}
|
||||
|
||||
if ($rerun.outcome -eq "Passed")
|
||||
{
|
||||
$passCount++
|
||||
}
|
||||
|
||||
if ($attemptCount -gt 0)
|
||||
{
|
||||
$rerunData["sequenceId"] = $attemptCount
|
||||
}
|
||||
|
||||
Write-Host " Attempt #$($attemptCount + 1): $($rerun.outcome)"
|
||||
|
||||
if ($rerun.outcome -ne "Passed")
|
||||
{
|
||||
$screenshots = "$($rerunResults.blobPrefix)/$($rerun.screenshots -join @"
|
||||
$($rerunResults.blobSuffix)
|
||||
$($rerunResults.blobPrefix)
|
||||
"@)$($rerunResults.blobSuffix)"
|
||||
|
||||
# We subtract 1 from the error index because we added 1 so we could use 0
|
||||
# as a default value not injected into the JSON in order to keep its size down.
|
||||
# We did this because there's a maximum size enforced for the errorMessage parameter
|
||||
# in the Azure DevOps REST API.
|
||||
$fullErrorMessage = @"
|
||||
Log: $($rerunResults.blobPrefix)/$($rerun.log)$($rerunResults.blobSuffix)
|
||||
|
||||
Screenshots:
|
||||
$screenshots
|
||||
|
||||
Error log:
|
||||
$($rerunResults.errors[$rerun.errorIndex - 1])
|
||||
"@
|
||||
|
||||
$rerunData["errorMessage"] = $fullErrorMessage
|
||||
}
|
||||
|
||||
$attemptCount++
|
||||
$totalDuration += $rerun.duration
|
||||
$rerunDataList.Add($rerunData)
|
||||
}
|
||||
|
||||
$overallOutcome = "Warning"
|
||||
|
||||
if ($attemptCount -eq 2)
|
||||
{
|
||||
Write-Host " Test $($testResult.testCaseTitle) passed on the immediate rerun, so we'll mark it as unreliable."
|
||||
}
|
||||
elseif ($passCount -gt $RerunPassesRequiredToAvoidFailure)
|
||||
{
|
||||
Write-Host " Test $($testResult.testCaseTitle) passed on $passCount of $attemptCount attempts, which is greater than or equal to the $RerunPassesRequiredToAvoidFailure passes required to avoid being marked as failed. Marking as unreliable."
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host " Test $($testResult.testCaseTitle) passed on only $passCount of $attemptCount attempts, which is less than the $RerunPassesRequiredToAvoidFailure passes required to avoid being marked as failed. Marking as failed."
|
||||
$overallOutcome = "Failed"
|
||||
}
|
||||
|
||||
$updateBody = ConvertTo-Json @(@{ "id" = $testResult.id; "outcome" = $overallOutcome; "errorMessage" = " "; "durationInMs" = $totalDuration; "subResults" = $rerunDataList; "resultGroupType" = "rerun" }) -Depth 5
|
||||
Invoke-RestMethod -Uri $testRunResultsUri -Method Patch -Headers $azureDevOpsRestApiHeaders -Body $updateBody -ContentType "application/json" | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Finished updates. Re-marking test run `"$($testRun.name)`" as completed."
|
||||
Invoke-RestMethod -Uri "$($testRun.url)?api-version=5.0" -Method Patch -Body (ConvertTo-Json @{ "state" = "Completed" }) -Headers $azureDevOpsRestApiHeaders -ContentType "application/json" | Out-Null
|
||||
}
|
||||
5
build/Helix/global.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.22525.5"
|
||||
}
|
||||
}
|
||||
9
build/Helix/packages.config
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MUXCustomBuildTasks" version="1.0.48" targetFramework="native" />
|
||||
<package id="Microsoft.Internal.Windows.Terminal.TestContent" version="1.0.1" />
|
||||
<package id="Microsoft.Taef" version="10.60.210621002" targetFramework="native" />
|
||||
<package id="microsoft.windows.apps.test" version="1.0.181203002" targetFramework="native" />
|
||||
<package id="runtime.win-x86.microsoft.netcore.app" version="2.1.0" targetFramework="native" />
|
||||
<package id="runtime.win-x64.microsoft.netcore.app" version="2.1.0" targetFramework="native" />
|
||||
</packages>
|
||||
32
build/Helix/readme.md
Normal file
@@ -0,0 +1,32 @@
|
||||
This directory contains code and configuration files to run WinUI tests in Helix.
|
||||
|
||||
Helix is a cloud hosted test execution environment which is accessed via the Arcade SDK.
|
||||
More details:
|
||||
* [Arcade](https://github.com/dotnet/arcade)
|
||||
* [Helix](https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.Helix/Sdk)
|
||||
|
||||
WinUI tests are scheduled in Helix by the Azure DevOps Pipeline: [RunHelixTests.yml](../RunHelixTests.yml).
|
||||
|
||||
The workflow is as follows:
|
||||
1. NuGet Restore is called on the packages.config in this directory. This downloads any runtime dependencies
|
||||
that are needed to run tests.
|
||||
2. PrepareHelixPayload.ps1 is called. This copies the necessary files from various locations into a Helix
|
||||
payload directory. This directory is what will get sent to the Helix machines.
|
||||
3. RunTestsInHelix.proj is executed. This proj has a dependency on
|
||||
[Microsoft.DotNet.Helix.Sdk](https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.Helix/Sdk)
|
||||
which it uses to publish the Helix payload directory and to schedule the Helix Work Items. The WinUI tests
|
||||
are parallelized into multiple Helix Work Items.
|
||||
4. Each Helix Work Item calls [runtests.cmd](runtests.cmd) with a specific query to pass to
|
||||
[TAEF](https://docs.microsoft.com/en-us/windows-hardware/drivers/taef/) which runs the tests.
|
||||
5. If a test is detected to have failed, we run it again, first once, then eight more times if it fails again.
|
||||
If it fails all ten times, we report the test as failed; otherwise, we report it as unreliable,
|
||||
which will show up as a warning, but which will not fail the build. When a test is reported as unreliable,
|
||||
we include the results for each individual run via a JSON string in the original test's errorMessage field.
|
||||
6. TAEF produces logs in WTT format. Helix is able to process logs in XUnit format. We run
|
||||
[ConvertWttLogToXUnit.ps1](ConvertWttLogToXUnit.ps1) to convert the logs into the necessary format.
|
||||
7. RunTestsInHelix.proj has EnableAzurePipelinesReporter set to true. This allows the XUnit formatted test
|
||||
results to be reported back to the Azure DevOps Pipeline.
|
||||
8. We process unreliable tests once all tests have been reported by reading the JSON string from the
|
||||
errorMessage field and calling the Azure DevOps REST API to modify the unreliable tests to have sub-results
|
||||
added to the test and to mark the test as "warning", which will enable people to see exactly how the test
|
||||
failed in runs where it did.
|
||||
105
build/Helix/runtests.cmd
Normal file
@@ -0,0 +1,105 @@
|
||||
setlocal ENABLEDELAYEDEXPANSION
|
||||
|
||||
echo %TIME%
|
||||
|
||||
robocopy %HELIX_CORRELATION_PAYLOAD% . /s /NP > NUL
|
||||
|
||||
echo %TIME%
|
||||
|
||||
reg add HKLM\Software\Policies\Microsoft\Windows\Appx /v AllowAllTrustedApps /t REG_DWORD /d 1 /f
|
||||
|
||||
rem enable dump collection for our test apps:
|
||||
rem note, this script is run from a 32-bit cmd, but we need to set the native reg-key
|
||||
FOR %%A IN (TestHostApp.exe,te.exe,te.processhost.exe,conhost.exe,OpenConsole.exe,WindowsTerminal.exe) DO (
|
||||
%systemroot%\sysnative\cmd.exe /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\%%A" /v DumpFolder /t REG_EXPAND_SZ /d %HELIX_DUMP_FOLDER% /f
|
||||
%systemroot%\sysnative\cmd.exe /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\%%A" /v DumpType /t REG_DWORD /d 2 /f
|
||||
%systemroot%\sysnative\cmd.exe /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\%%A" /v DumpCount /t REG_DWORD /d 10 /f
|
||||
)
|
||||
|
||||
echo %TIME%
|
||||
|
||||
:: kill dhandler, which is a tool designed to handle unexpected windows appearing. But since our tests are
|
||||
:: expected to show UI we don't want it running.
|
||||
taskkill -f -im dhandler.exe
|
||||
|
||||
echo %TIME%
|
||||
powershell -ExecutionPolicy Bypass .\EnsureMachineState.ps1
|
||||
echo %TIME%
|
||||
powershell -ExecutionPolicy Bypass .\InstallTestAppDependencies.ps1
|
||||
echo %TIME%
|
||||
|
||||
set testBinaryCandidates=TerminalApp.LocalTests.dll SettingsModel.LocalTests.dll Conhost.UIA.Tests.dll WindowsTerminal.UIA.Tests.dll
|
||||
set testBinaries=
|
||||
for %%B in (%testBinaryCandidates%) do (
|
||||
if exist %%B (
|
||||
set "testBinaries=!testBinaries! %%B"
|
||||
)
|
||||
)
|
||||
|
||||
echo %TIME%
|
||||
te.exe %testBinaries% /enablewttlogging /unicodeOutput:false /sessionTimeout:0:15 /testtimeout:0:10 /screenCaptureOnError %*
|
||||
echo %TIME%
|
||||
|
||||
powershell -ExecutionPolicy Bypass Get-Process
|
||||
|
||||
move te.wtl te_original.wtl
|
||||
|
||||
copy /y te_original.wtl %HELIX_WORKITEM_UPLOAD_ROOT%
|
||||
copy /y WexLogFileOutput\*.jpg %HELIX_WORKITEM_UPLOAD_ROOT%
|
||||
copy /y *.pgc %HELIX_WORKITEM_UPLOAD_ROOT%
|
||||
|
||||
set FailedTestQuery=
|
||||
for /F "tokens=* usebackq" %%I IN (`powershell -ExecutionPolicy Bypass .\OutputFailedTestQuery.ps1 te_original.wtl`) DO (
|
||||
set FailedTestQuery=%%I
|
||||
)
|
||||
|
||||
rem The first time, we'll just re-run failed tests once. In many cases, tests fail very rarely, such that
|
||||
rem a single re-run will be sufficient to detect many unreliable tests.
|
||||
if "%FailedTestQuery%" == "" goto :SkipReruns
|
||||
|
||||
echo %TIME%
|
||||
te.exe %testBinaries% /enablewttlogging /unicodeOutput:false /sessionTimeout:0:15 /testtimeout:0:10 /screenCaptureOnError /select:"%FailedTestQuery%"
|
||||
echo %TIME%
|
||||
|
||||
move te.wtl te_rerun.wtl
|
||||
|
||||
copy /y te_rerun.wtl %HELIX_WORKITEM_UPLOAD_ROOT%
|
||||
copy /y WexLogFileOutput\*.jpg %HELIX_WORKITEM_UPLOAD_ROOT%
|
||||
|
||||
rem If there are still failing tests remaining, we'll run them eight more times, so they'll have been run a total of ten times.
|
||||
rem If any tests fail all ten times, we can be pretty confident that these are actual test failures rather than unreliable tests.
|
||||
if not exist te_rerun.wtl goto :SkipReruns
|
||||
|
||||
set FailedTestQuery=
|
||||
for /F "tokens=* usebackq" %%I IN (`powershell -ExecutionPolicy Bypass .\OutputFailedTestQuery.ps1 te_rerun.wtl`) DO (
|
||||
set FailedTestQuery=%%I
|
||||
)
|
||||
|
||||
if "%FailedTestQuery%" == "" goto :SkipReruns
|
||||
|
||||
echo %TIME%
|
||||
te.exe %testBinaries% /enablewttlogging /unicodeOutput:false /sessionTimeout:0:15 /testtimeout:0:10 /screenCaptureOnError /testmode:Loop /LoopTest:8 /select:"%FailedTestQuery%"
|
||||
echo %TIME%
|
||||
|
||||
powershell -ExecutionPolicy Bypass Get-Process
|
||||
|
||||
move te.wtl te_rerun_multiple.wtl
|
||||
|
||||
copy /y te_rerun_multiple.wtl %HELIX_WORKITEM_UPLOAD_ROOT%
|
||||
copy /y WexLogFileOutput\*.jpg %HELIX_WORKITEM_UPLOAD_ROOT%
|
||||
powershell -ExecutionPolicy Bypass .\CopyVisualTreeVerificationFiles.ps1
|
||||
|
||||
:SkipReruns
|
||||
|
||||
powershell -ExecutionPolicy Bypass Get-Process
|
||||
|
||||
echo %TIME%
|
||||
powershell -ExecutionPolicy Bypass .\OutputSubResultsJsonFiles.ps1 te_original.wtl te_rerun.wtl te_rerun_multiple.wtl %testnameprefix%
|
||||
powershell -ExecutionPolicy Bypass .\ConvertWttLogToXUnit.ps1 te_original.wtl te_rerun.wtl te_rerun_multiple.wtl testResults.xml %testnameprefix%
|
||||
echo %TIME%
|
||||
|
||||
copy /y *_subresults.json %HELIX_WORKITEM_UPLOAD_ROOT%
|
||||
|
||||
type testResults.xml
|
||||
|
||||
echo %TIME%
|
||||
51
build/config/ESRPSigning_ConPTY.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"Version": "1.0.0",
|
||||
"UseMinimatch": false,
|
||||
"SignBatches": [
|
||||
{
|
||||
"MatchedPath": [
|
||||
"conpty.dll",
|
||||
"OpenConsole.exe"
|
||||
],
|
||||
"SigningInfo": {
|
||||
"Operations": [
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolSign",
|
||||
"Parameters": [
|
||||
{
|
||||
"parameterName": "OpusName",
|
||||
"parameterValue": "Microsoft"
|
||||
},
|
||||
{
|
||||
"parameterName": "OpusInfo",
|
||||
"parameterValue": "http://www.microsoft.com"
|
||||
},
|
||||
{
|
||||
"parameterName": "FileDigest",
|
||||
"parameterValue": "/fd \"SHA256\""
|
||||
},
|
||||
{
|
||||
"parameterName": "PageHash",
|
||||
"parameterValue": "/NPH"
|
||||
},
|
||||
{
|
||||
"parameterName": "TimeStamp",
|
||||
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
}
|
||||
],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolVerify",
|
||||
"Parameters": [],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
72
build/config/ESRPSigning_Terminal.json
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"Version": "1.0.0",
|
||||
"UseMinimatch": false,
|
||||
"SignBatches": [
|
||||
{
|
||||
"MatchedPath": [
|
||||
// Namespaced DLLs
|
||||
"Microsoft.Terminal.*.dll",
|
||||
"Microsoft.Terminal.*.winmd",
|
||||
|
||||
// ConPTY and DefTerm
|
||||
"OpenConsole.exe",
|
||||
"OpenConsoleProxy.dll",
|
||||
|
||||
// VCRT Forwarders
|
||||
"*_app.dll",
|
||||
|
||||
// Legacy DLLs with old names
|
||||
"TerminalApp.dll",
|
||||
"TerminalApp.winmd",
|
||||
"TerminalConnection.dll",
|
||||
"TerminalThemeHelpers.dll",
|
||||
"WindowsTerminalShellExt.dll",
|
||||
|
||||
// The rest
|
||||
"TerminalAzBridge.exe",
|
||||
"wt.exe",
|
||||
"WindowsTerminal.exe",
|
||||
"elevate-shim.exe"
|
||||
],
|
||||
"SigningInfo": {
|
||||
"Operations": [
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolSign",
|
||||
"Parameters": [
|
||||
{
|
||||
"parameterName": "OpusName",
|
||||
"parameterValue": "Microsoft"
|
||||
},
|
||||
{
|
||||
"parameterName": "OpusInfo",
|
||||
"parameterValue": "http://www.microsoft.com"
|
||||
},
|
||||
{
|
||||
"parameterName": "FileDigest",
|
||||
"parameterValue": "/fd \"SHA256\""
|
||||
},
|
||||
{
|
||||
"parameterName": "PageHash",
|
||||
"parameterValue": "/NPH"
|
||||
},
|
||||
{
|
||||
"parameterName": "TimeStamp",
|
||||
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
}
|
||||
],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolVerify",
|
||||
"Parameters": [],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
[
|
||||
{
|
||||
"MatchedPath": [
|
||||
"conpty.dll",
|
||||
"OpenConsole.exe"
|
||||
],
|
||||
"SigningInfo": {
|
||||
"Operations": [
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolSign",
|
||||
"Parameters": [
|
||||
{
|
||||
"parameterName": "OpusName",
|
||||
"parameterValue": "Microsoft"
|
||||
},
|
||||
{
|
||||
"parameterName": "OpusInfo",
|
||||
"parameterValue": "http://www.microsoft.com"
|
||||
},
|
||||
{
|
||||
"parameterName": "FileDigest",
|
||||
"parameterValue": "/fd \"SHA256\""
|
||||
},
|
||||
{
|
||||
"parameterName": "PageHash",
|
||||
"parameterValue": "/NPH"
|
||||
},
|
||||
{
|
||||
"parameterName": "TimeStamp",
|
||||
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
}
|
||||
],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolVerify",
|
||||
"Parameters": [],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1,65 +0,0 @@
|
||||
[
|
||||
{
|
||||
"MatchedPath": [
|
||||
// Namespaced DLLs
|
||||
"PackageContents/Microsoft.Terminal.*.dll",
|
||||
"PackageContents/Microsoft.Terminal.*.winmd",
|
||||
|
||||
// ConPTY and DefTerm
|
||||
"PackageContents/OpenConsole.exe",
|
||||
"PackageContents/OpenConsoleProxy.dll",
|
||||
|
||||
// Legacy DLLs with old names
|
||||
"PackageContents/TerminalApp.dll",
|
||||
"PackageContents/TerminalApp.winmd",
|
||||
"PackageContents/TerminalConnection.dll",
|
||||
"PackageContents/TerminalThemeHelpers.dll",
|
||||
"PackageContents/WindowsTerminalShellExt.dll",
|
||||
|
||||
// The rest
|
||||
"PackageContents/TerminalAzBridge.exe",
|
||||
"PackageContents/wt.exe",
|
||||
"PackageContents/WindowsTerminal.exe",
|
||||
"PackageContents/elevate-shim.exe"
|
||||
],
|
||||
"SigningInfo": {
|
||||
"Operations": [
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolSign",
|
||||
"Parameters": [
|
||||
{
|
||||
"parameterName": "OpusName",
|
||||
"parameterValue": "Microsoft"
|
||||
},
|
||||
{
|
||||
"parameterName": "OpusInfo",
|
||||
"parameterValue": "http://www.microsoft.com"
|
||||
},
|
||||
{
|
||||
"parameterName": "FileDigest",
|
||||
"parameterValue": "/fd \"SHA256\""
|
||||
},
|
||||
{
|
||||
"parameterName": "PageHash",
|
||||
"parameterValue": "/NPH"
|
||||
},
|
||||
{
|
||||
"parameterName": "TimeStamp",
|
||||
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
}
|
||||
],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolVerify",
|
||||
"Parameters": [],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1,46 +0,0 @@
|
||||
[
|
||||
{
|
||||
"MatchedPath": [
|
||||
"PublicTerminalCore.dll"
|
||||
],
|
||||
"SigningInfo": {
|
||||
"Operations": [
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolSign",
|
||||
"Parameters": [
|
||||
{
|
||||
"parameterName": "OpusName",
|
||||
"parameterValue": "Microsoft"
|
||||
},
|
||||
{
|
||||
"parameterName": "OpusInfo",
|
||||
"parameterValue": "http://www.microsoft.com"
|
||||
},
|
||||
{
|
||||
"parameterName": "FileDigest",
|
||||
"parameterValue": "/fd \"SHA256\""
|
||||
},
|
||||
{
|
||||
"parameterName": "PageHash",
|
||||
"parameterValue": "/NPH"
|
||||
},
|
||||
{
|
||||
"parameterName": "TimeStamp",
|
||||
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
}
|
||||
],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolVerify",
|
||||
"Parameters": [],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1,47 +0,0 @@
|
||||
[
|
||||
{
|
||||
"MatchedPath": [
|
||||
"WpfTerminalControl/net472/Microsoft.Terminal.Wpf.dll",
|
||||
"WpfTerminalControl/net6.0-windows/Microsoft.Terminal.Wpf.dll"
|
||||
],
|
||||
"SigningInfo": {
|
||||
"Operations": [
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolSign",
|
||||
"Parameters": [
|
||||
{
|
||||
"parameterName": "OpusName",
|
||||
"parameterValue": "Microsoft"
|
||||
},
|
||||
{
|
||||
"parameterName": "OpusInfo",
|
||||
"parameterValue": "http://www.microsoft.com"
|
||||
},
|
||||
{
|
||||
"parameterName": "FileDigest",
|
||||
"parameterValue": "/fd \"SHA256\""
|
||||
},
|
||||
{
|
||||
"parameterName": "PageHash",
|
||||
"parameterValue": "/NPH"
|
||||
},
|
||||
{
|
||||
"parameterName": "TimeStamp",
|
||||
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
}
|
||||
],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolVerify",
|
||||
"Parameters": [],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1,5 +1,4 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="Terminal.PGO.props" />
|
||||
<Import Project="$(PkgMicrosoft_PGO_Helpers_Cpp)\build\Microsoft.PGO-Helpers.Cpp.props" />
|
||||
<Import Project="$(PkgMicrosoft_PGO_Helpers_Cpp)\build\Microsoft.PGO-Helpers.Cpp.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -12,6 +12,5 @@
|
||||
<files>
|
||||
<!-- The target directories for pgd files need to remain as is. PGO optimization pass will rely on this exact directory layout. -->
|
||||
<file src="x64\*.pgd" target="tools\x64"/>
|
||||
<file src="arm64\*.pgd" target="tools\arm64"/>
|
||||
</files>
|
||||
</package>
|
||||
|
||||
@@ -46,5 +46,6 @@
|
||||
<PGOCopyRuntime Condition="'$(PGOBuildMode)' == 'Instrument'">true</PGOCopyRuntime>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Do not import PGO-Helpers props here, as it is too early to detect the C++ tools directory -->
|
||||
<!-- Import PGO-Helpers -->
|
||||
<Import Project="$(PkgMicrosoft_PGO_Helpers_Cpp)\build\Microsoft.PGO-Helpers.Cpp.props" />
|
||||
</Project>
|
||||
|
||||
@@ -29,80 +29,76 @@ variables:
|
||||
# 0.0.1904.0900
|
||||
name: 0.0.$(Date:yyMM).$(Date:dd)$(Rev:rr)
|
||||
|
||||
parameters:
|
||||
- name: auditMode
|
||||
displayName: "Build in Audit Mode (x64)"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: runTests
|
||||
displayName: "Run Tests"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
default:
|
||||
- x64
|
||||
- x86
|
||||
- arm64
|
||||
|
||||
stages:
|
||||
- ${{ if eq(parameters.auditMode, true) }}:
|
||||
- stage: Audit_x64
|
||||
displayName: Audit Mode
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: ./templates-v2/job-build-project.yml
|
||||
parameters:
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: SHINE-OSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: SHINE-INT-L
|
||||
buildPlatforms: [x64]
|
||||
buildConfigurations: [AuditMode]
|
||||
buildEverything: true
|
||||
keepAllExpensiveBuildOutputs: false
|
||||
- stage: Audit_x64
|
||||
displayName: Audit Mode
|
||||
dependsOn: []
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: ./templates/build-console-audit-job.yml
|
||||
parameters:
|
||||
platform: x64
|
||||
|
||||
- stage: CodeHealth
|
||||
displayName: Code Health
|
||||
- stage: Build_x64
|
||||
displayName: Build x64
|
||||
dependsOn: []
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: ./templates/build-console-ci.yml
|
||||
parameters:
|
||||
platform: x64
|
||||
- stage: Build_x86
|
||||
displayName: Build x86
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: ./templates-v2/job-check-code-format.yml
|
||||
- template: ./templates/build-console-ci.yml
|
||||
parameters:
|
||||
platform: x86
|
||||
- stage: Build_ARM64
|
||||
displayName: Build ARM64
|
||||
dependsOn: []
|
||||
condition: not(eq(variables['Build.Reason'], 'PullRequest'))
|
||||
jobs:
|
||||
- template: ./templates/build-console-ci.yml
|
||||
parameters:
|
||||
platform: ARM64
|
||||
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- stage: Build_${{ platform }}
|
||||
displayName: Build ${{ platform }}
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: ./templates-v2/job-build-project.yml
|
||||
parameters:
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: SHINE-OSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: SHINE-INT-L
|
||||
buildPlatforms:
|
||||
- ${{ platform }}
|
||||
buildConfigurations: [Release]
|
||||
buildEverything: true
|
||||
keepAllExpensiveBuildOutputs: false
|
||||
- stage: Test_x64
|
||||
displayName: Test x64
|
||||
dependsOn: [Build_x64]
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: ./templates/test-console-ci.yml
|
||||
parameters:
|
||||
platform: x64
|
||||
- stage: Test_x86
|
||||
displayName: Test x86
|
||||
dependsOn: [Build_x86]
|
||||
jobs:
|
||||
- template: ./templates/test-console-ci.yml
|
||||
parameters:
|
||||
platform: x86
|
||||
|
||||
- ${{ if eq(parameters.runTests, true) }}:
|
||||
- stage: Test_${{ platform }}
|
||||
displayName: Test ${{ platform }}
|
||||
dependsOn:
|
||||
- Build_${{ platform }}
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: ./templates-v2/job-test-project.yml
|
||||
parameters:
|
||||
platform: ${{ platform }}
|
||||
# The tests might be run more than once; log one artifact per attempt.
|
||||
outputArtifactStem: -$(System.JobAttempt)
|
||||
- stage: Helix_x64
|
||||
displayName: Helix x64
|
||||
dependsOn: [Build_x64]
|
||||
condition: and(succeeded(), not(eq(variables['Build.Reason'], 'PullRequest')))
|
||||
jobs:
|
||||
- template: ./templates/console-ci-helix-job.yml
|
||||
parameters:
|
||||
platform: x64
|
||||
|
||||
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
|
||||
- stage: CodeIndexer
|
||||
displayName: Github CodeNav Indexer
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: ./templates-v2/job-index-github-codenav.yml
|
||||
- stage: Scripts
|
||||
displayName: Code Health Scripts
|
||||
dependsOn: []
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: ./templates/check-formatting.yml
|
||||
|
||||
|
||||
- stage: CodeIndexer
|
||||
displayName: Github CodeNav Indexer
|
||||
dependsOn: [Build_x64]
|
||||
condition: and(succeeded(), not(eq(variables['Build.Reason'], 'PullRequest')))
|
||||
jobs:
|
||||
- template: ./templates/codenav-indexer.yml
|
||||
|
||||
@@ -27,7 +27,6 @@ steps:
|
||||
clean: true
|
||||
submodules: false
|
||||
fetchDepth: 1 # Don't need a deep checkout for loc files!
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
persistCredentials: true
|
||||
path: s # Adding a second repo made Azure DevOps change where we're checked out.
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ pr:
|
||||
paths:
|
||||
include:
|
||||
- src/features.xml
|
||||
- build/pipelines/feature-flag-ci.yml
|
||||
|
||||
variables:
|
||||
- name: runCodesignValidationInjectionBG
|
||||
@@ -22,19 +21,9 @@ parameters:
|
||||
# Dev is built automatically
|
||||
# WindowsInbox does not typically build with VS.
|
||||
|
||||
stages:
|
||||
jobs:
|
||||
- ${{ each branding in parameters.buildBrandings }}:
|
||||
- stage: Build_${{ branding }}
|
||||
dependsOn: []
|
||||
displayName: Build ${{ branding }}
|
||||
jobs:
|
||||
- template: ./templates-v2/job-build-project.yml
|
||||
parameters:
|
||||
pool: # This only runs in CI
|
||||
name: SHINE-OSS-L
|
||||
buildPlatforms: [x64]
|
||||
buildConfigurations: [Release]
|
||||
buildEverything: true
|
||||
branding: ${{ branding }}
|
||||
keepAllExpensiveBuildOutputs: false
|
||||
artifactStem: -${{ branding }} # Disambiguate artifacts with the same config/platform
|
||||
- template: ./templates/build-console-ci.yml
|
||||
parameters:
|
||||
platform: x64
|
||||
branding: ${{ branding }}
|
||||
|
||||
@@ -16,52 +16,44 @@ pr: none
|
||||
name: 0.0.$(Date:yyMM).$(Date:dd)$(Rev:rr)
|
||||
|
||||
stages:
|
||||
- stage: Build
|
||||
displayName: Fuzzing Build
|
||||
- stage: Build_Fuzz_Config
|
||||
displayName: Build Fuzzers
|
||||
dependsOn: []
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: ./templates-v2/job-build-project.yml
|
||||
parameters:
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: SHINE-OSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: SHINE-INT-L
|
||||
buildPlatforms: [x64]
|
||||
buildConfigurations: [Fuzzing]
|
||||
buildEverything: true
|
||||
keepAllExpensiveBuildOutputs: false
|
||||
|
||||
- stage: Submit
|
||||
displayName: Submit to OneFuzz
|
||||
dependsOn: [Build]
|
||||
- template: ./templates/build-console-fuzzing.yml
|
||||
parameters:
|
||||
platform: x64
|
||||
- stage: OneFuzz
|
||||
displayName: Submit OneFuzz Job
|
||||
dependsOn: ['Build_Fuzz_Config']
|
||||
condition: succeeded()
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
variables:
|
||||
artifactName: fuzzingBuildOutput
|
||||
jobs:
|
||||
- job:
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download artifacts
|
||||
inputs:
|
||||
artifactName: build-x64-Fuzzing
|
||||
downloadPath: $(Build.ArtifactStagingDirectory)
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.x'
|
||||
addToPath: true
|
||||
architecture: 'x64'
|
||||
- bash: |
|
||||
set -ex
|
||||
pip -q install onefuzz
|
||||
onefuzz config --endpoint $(endpoint) --client_id $(client_id) --authority $(authority) --tenant_domain $(tenant_domain) --client_secret $(client_secret)
|
||||
sed -i s/INSERT_PAT_HERE/$(ado_pat)/ build/Fuzz/notifications-ado.json
|
||||
sed -i s/INSERT_ASSIGNED_HERE/$(ado_assigned_to)/ build/Fuzz/notifications-ado.json
|
||||
displayName: Configure OneFuzz
|
||||
- bash: |
|
||||
onefuzz template libfuzzer basic --colocate_all_tasks --vm_count 1 --target_exe $target_exe_path --notification_config @./build/Fuzz/notifications-ado.json OpenConsole $test_name $(Build.SourceVersion) default
|
||||
displayName: Submit OneFuzz Job
|
||||
env:
|
||||
target_exe_path: $(Build.ArtifactStagingDirectory)/OpenConsoleFuzzer.exe
|
||||
test_name: WriteCharsLegacy
|
||||
- job:
|
||||
steps:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
inputs:
|
||||
artifactName: $(artifactName)
|
||||
downloadPath: $(Build.ArtifactStagingDirectory)
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.x'
|
||||
addToPath: true
|
||||
architecture: 'x64'
|
||||
- bash: |
|
||||
set -ex
|
||||
pip -q install onefuzz
|
||||
onefuzz config --endpoint $(endpoint) --client_id $(client_id) --authority $(authority) --tenant_domain $(tenant_domain) --client_secret $(client_secret)
|
||||
sed -i s/INSERT_PAT_HERE/$(ado_pat)/ build/Fuzz/notifications-ado.json
|
||||
sed -i s/INSERT_ASSIGNED_HERE/$(ado_assigned_to)/ build/Fuzz/notifications-ado.json
|
||||
displayName: Configure OneFuzz
|
||||
- bash: |
|
||||
onefuzz template libfuzzer basic --colocate_all_tasks --vm_count 1 --target_exe $target_exe_path --notification_config @./build/Fuzz/notifications-ado.json OpenConsole $test_name $(Build.SourceVersion) default
|
||||
displayName: Submit OneFuzz Job
|
||||
env:
|
||||
target_exe_path: $(Build.ArtifactStagingDirectory)/$(artifactName)/Fuzzing/x64/test/OpenConsoleFuzzer.exe
|
||||
test_name: WriteCharsLegacy
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
trigger: none
|
||||
pr: none
|
||||
schedules:
|
||||
- cron: "30 3 * * 2-6" # Run at 03:30 UTC Tuesday through Saturday (After the work day in Pacific, Mon-Fri)
|
||||
displayName: "Nightly Terminal Build"
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
always: false # only run if there's code changes!
|
||||
|
||||
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
|
||||
|
||||
extends:
|
||||
template: templates-v2\pipeline-full-release-build.yml
|
||||
parameters:
|
||||
branding: Canary
|
||||
buildTerminal: true
|
||||
pgoBuildMode: Optimize
|
||||
codeSign: true
|
||||
generateSbom: true
|
||||
publishSymbolsToPublic: true
|
||||
publishVpackToWindows: false
|
||||
symbolExpiryTime: 15 # Nightly builds do not keep symbols for very long!
|
||||
@@ -1,27 +1,5 @@
|
||||
trigger: none
|
||||
pr: none
|
||||
schedules:
|
||||
- cron: "0 5 * * 2-6" # Run at 05:00 UTC Tuesday through Saturday (Even later than Localization, after the work day in Pacific, Mon-Fri)
|
||||
displayName: "Nightly Instrumentation Build"
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
always: false # only run if there's code changes!
|
||||
|
||||
parameters:
|
||||
- name: branding
|
||||
displayName: "Branding (Build Type)"
|
||||
type: string
|
||||
default: Preview # By default, we'll PGO the Preview builds to get max coverage
|
||||
values:
|
||||
- Release
|
||||
- Preview
|
||||
- Dev
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
default:
|
||||
- x64
|
||||
- arm64
|
||||
|
||||
variables:
|
||||
- name: runCodesignValidationInjectionBG
|
||||
@@ -32,57 +10,18 @@ variables:
|
||||
name: 0.0.$(Date:yyMM).$(Date:dd)$(Rev:rr)
|
||||
|
||||
stages:
|
||||
- stage: Build
|
||||
displayName: Build
|
||||
- stage: Build_x64
|
||||
displayName: Build x64
|
||||
dependsOn: []
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- template: ./templates-v2/job-build-project.yml
|
||||
- template: ./templates/build-console-pgo.yml
|
||||
parameters:
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: SHINE-OSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: SHINE-INT-L
|
||||
branding: ${{ parameters.branding }}
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
buildConfigurations: [Release]
|
||||
buildEverything: true
|
||||
pgoBuildMode: Instrument
|
||||
artifactStem: -instrumentation
|
||||
|
||||
- stage: RunPGO
|
||||
displayName: Run PGO
|
||||
dependsOn: [Build]
|
||||
condition: succeeded()
|
||||
platform: x64
|
||||
- stage: Publish_PGO_Databases
|
||||
displayName: Publish PGO databases
|
||||
dependsOn: ['Build_x64']
|
||||
jobs:
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- template: ./templates-v2/job-run-pgo-tests.yml
|
||||
parameters:
|
||||
# This job chooses its own pools based on platform
|
||||
buildPlatform: ${{ platform }}
|
||||
buildConfiguration: Release
|
||||
artifactStem: -instrumentation
|
||||
|
||||
- stage: FinalizePGO
|
||||
displayName: Finalize PGO and Publish
|
||||
dependsOn: [RunPGO]
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
# This job takes multiple platforms and fans them back in to a single artifact.
|
||||
- template: ./templates-v2/job-pgo-merge-pgd.yml
|
||||
- template: ./templates/pgo-build-and-publish-nuget-job.yml
|
||||
parameters:
|
||||
jobName: MergePGD
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
buildConfiguration: Release
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
artifactStem: -instrumentation
|
||||
|
||||
- template: ./templates-v2/job-pgo-build-nuget-and-publish.yml
|
||||
parameters:
|
||||
pool:
|
||||
vmImage: 'windows-2022'
|
||||
dependsOn: MergePGD
|
||||
buildConfiguration: Release
|
||||
artifactStem: -instrumentation
|
||||
pgoArtifact: 'PGO'
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
# This build should never run as CI or against a pull request.
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
# Expose all of these parameters for user configuration.
|
||||
pool:
|
||||
name: WinDevPool-L
|
||||
demands: ImageOverride -equals WinDevVS17-latest
|
||||
|
||||
parameters:
|
||||
- name: branding
|
||||
displayName: "Branding (Build Type)"
|
||||
@@ -10,12 +14,22 @@ parameters:
|
||||
values:
|
||||
- Release
|
||||
- Preview
|
||||
- Canary
|
||||
- Dev
|
||||
- name: buildTerminal
|
||||
displayName: "Build Windows Terminal MSIX"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: runCompliance
|
||||
displayName: "Run Compliance and Security Build"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: publishSymbolsToPublic
|
||||
displayName: "Publish Symbols to MSDL"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: buildTerminalVPack
|
||||
displayName: "Build Windows Terminal VPack"
|
||||
type: boolean
|
||||
default: false
|
||||
- name: buildConPTY
|
||||
displayName: "Build ConPTY NuGet"
|
||||
type: boolean
|
||||
@@ -33,53 +47,705 @@ parameters:
|
||||
- Instrument
|
||||
- None
|
||||
- name: buildConfigurations
|
||||
displayName: "Build Configurations"
|
||||
type: object
|
||||
default:
|
||||
- Release
|
||||
- name: buildPlatforms
|
||||
displayName: "Build Platforms"
|
||||
type: object
|
||||
default:
|
||||
- x64
|
||||
- x86
|
||||
- arm64
|
||||
- name: codeSign
|
||||
displayName: "Sign all build outputs"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: generateSbom
|
||||
displayName: "Generate a Bill of Materials"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: terminalInternalPackageVersion
|
||||
displayName: "Terminal Internal Package Version"
|
||||
type: string
|
||||
default: '0.0.8'
|
||||
|
||||
- name: publishSymbolsToPublic
|
||||
displayName: "Publish Symbols to MSDL"
|
||||
type: boolean
|
||||
default: true
|
||||
- name: publishVpackToWindows
|
||||
displayName: "Publish VPack to Windows"
|
||||
type: boolean
|
||||
default: false
|
||||
variables:
|
||||
MakeAppxPath: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\MakeAppx.exe'
|
||||
TerminalInternalPackageVersion: "0.0.8"
|
||||
# If we are building a branch called "release-*", change the NuGet suffix
|
||||
# to "preview". If we don't do that, XES will set the suffix to "release1"
|
||||
# because it truncates the value after the first period.
|
||||
# We also want to disable the suffix entirely if we're Release branded while
|
||||
# on a release branch.
|
||||
# main is special, however. XES ignores main. Since we never produce actual
|
||||
# shipping builds from main, we want to force it to have a beta label as
|
||||
# well.
|
||||
#
|
||||
# In effect:
|
||||
# BRANCH / BRANDING | Release | Preview
|
||||
# ------------------|----------------------------|-----------------------------
|
||||
# release-* | 1.12.20220427 | 1.13.20220427-preview
|
||||
# main | 1.14.20220427-experimental | 1.14.20220427-experimental
|
||||
# all others | 1.14.20220427-mybranch | 1.14.20220427-mybranch
|
||||
${{ if startsWith(variables['Build.SourceBranchName'], 'release-') }}:
|
||||
${{ if eq(parameters.branding, 'Release') }}:
|
||||
NoNuGetPackBetaVersion: true
|
||||
${{ else }}:
|
||||
NuGetPackBetaVersion: preview
|
||||
${{ elseif eq(variables['Build.SourceBranchName'], 'main') }}:
|
||||
NuGetPackBetaVersion: experimental
|
||||
|
||||
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
|
||||
resources:
|
||||
repositories:
|
||||
- repository: self
|
||||
type: git
|
||||
ref: main
|
||||
jobs:
|
||||
- job: Build
|
||||
strategy:
|
||||
matrix:
|
||||
${{ each config in parameters.buildConfigurations }}:
|
||||
${{ each platform in parameters.buildPlatforms }}:
|
||||
${{ config }}_${{ platform }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
BuildPlatform: ${{ platform }}
|
||||
displayName: Build
|
||||
timeoutInMinutes: 240
|
||||
cancelTimeoutInMinutes: 1
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- task: PowerShell@2
|
||||
displayName: Rationalize Build Platform
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$Arch = "$(BuildPlatform)"
|
||||
|
||||
extends:
|
||||
template: templates-v2/pipeline-full-release-build.yml
|
||||
parameters:
|
||||
branding: ${{ parameters.branding }}
|
||||
buildTerminal: ${{ parameters.buildTerminal }}
|
||||
buildConPTY: ${{ parameters.buildConPTY }}
|
||||
buildWPF: ${{ parameters.buildWPF }}
|
||||
pgoBuildMode: ${{ parameters.pgoBuildMode }}
|
||||
buildConfigurations: ${{ parameters.buildConfigurations }}
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
codeSign: ${{ parameters.codeSign }}
|
||||
generateSbom: ${{ parameters.generateSbom }}
|
||||
terminalInternalPackageVersion: ${{ parameters.terminalInternalPackageVersion }}
|
||||
publishSymbolsToPublic: ${{ parameters.publishSymbolsToPublic }}
|
||||
publishVpackToWindows: ${{ parameters.publishVpackToWindows }}
|
||||
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
||||
|
||||
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
||||
- template: .\templates\restore-nuget-steps.yml
|
||||
- task: UniversalPackages@0
|
||||
displayName: Download terminal-internal Universal Package
|
||||
inputs:
|
||||
feedListDownload: 2b3f8893-a6e8-411f-b197-a9e05576da48
|
||||
packageListDownload: e82d490c-af86-4733-9dc4-07b772033204
|
||||
versionListDownload: $(TerminalInternalPackageVersion)
|
||||
- task: TouchdownBuildTask@1
|
||||
displayName: Download Localization Files
|
||||
inputs:
|
||||
teamId: 7105
|
||||
authId: $(TouchdownAppId)
|
||||
authKey: $(TouchdownAppKey)
|
||||
resourceFilePath: >-
|
||||
src\cascadia\TerminalApp\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalApp\Resources\en-US\ContextMenu.resw
|
||||
|
||||
src\cascadia\TerminalControl\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalConnection\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalSettingsModel\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalSettingsEditor\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\CascadiaPackage\Resources\en-US\Resources.resw
|
||||
appendRelativeDir: true
|
||||
localizationTarget: false
|
||||
pseudoSetting: Included
|
||||
- task: PowerShell@2
|
||||
displayName: Move Loc files one level up
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$Files = Get-ChildItem . -R -Filter 'Resources.resw' | ? FullName -Like '*en-US\*\Resources.resw'
|
||||
|
||||
$Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore }
|
||||
pwsh: true
|
||||
- task: PowerShell@2
|
||||
displayName: Copy the Context Menu Loc Resources to CascadiaPackage
|
||||
inputs:
|
||||
filePath: ./build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
|
||||
pwsh: true
|
||||
- task: PowerShell@2
|
||||
displayName: Generate NOTICE.html from NOTICE.md
|
||||
inputs:
|
||||
filePath: .\build\scripts\Generate-ThirdPartyNotices.ps1
|
||||
arguments: -MarkdownNoticePath .\NOTICE.md -OutputPath .\src\cascadia\CascadiaPackage\NOTICE.html
|
||||
pwsh: true
|
||||
- ${{ if eq(parameters.buildTerminal, true) }}:
|
||||
- task: VSBuild@1
|
||||
displayName: Build solution **\OpenConsole.sln
|
||||
condition: true
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /t:Terminal\CascadiaPackage /p:WindowsTerminalReleaseBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
maximumCpuCount: true
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: binlog'
|
||||
condition: failed()
|
||||
continueOnError: True
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)\msbuild.binlog
|
||||
ArtifactName: binlog-$(BuildPlatform)
|
||||
- task: PowerShell@2
|
||||
displayName: Check MSIX for common regressions
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$Package = Get-ChildItem -Recurse -Filter "CascadiaPackage_*.msix"
|
||||
|
||||
.\build\scripts\Test-WindowsTerminalPackage.ps1 -Verbose -Path $Package.FullName
|
||||
pwsh: true
|
||||
- ${{ if eq(parameters.buildWPF, true) }}:
|
||||
- task: VSBuild@1
|
||||
displayName: Build solution **\OpenConsole.sln for PublicTerminalCore
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /p:WindowsTerminalReleaseBuild=true /t:Terminal\wpf\PublicTerminalCore
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
- ${{ if eq(parameters.buildConPTY, true) }}:
|
||||
- task: VSBuild@1
|
||||
displayName: Build solution **\OpenConsole.sln for ConPTY
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
msbuildArgs: /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }} /p:WindowsTerminalReleaseBuild=true /t:Conhost\Host_EXE;Conhost\winconpty_DLL
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
- task: PowerShell@2
|
||||
displayName: Source Index PDBs
|
||||
inputs:
|
||||
filePath: build\scripts\Index-Pdbs.ps1
|
||||
arguments: -SearchDir '$(Build.SourcesDirectory)' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
|
||||
errorActionPreference: silentlyContinue
|
||||
pwsh: true
|
||||
- task: PowerShell@2
|
||||
displayName: Run Unit Tests
|
||||
condition: and(succeeded(), or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
||||
enabled: False
|
||||
inputs:
|
||||
filePath: build\scripts\Run-Tests.ps1
|
||||
arguments: -MatchPattern '*unit.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)'
|
||||
- task: PowerShell@2
|
||||
displayName: Run Feature Tests
|
||||
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x64'))
|
||||
enabled: False
|
||||
inputs:
|
||||
filePath: build\scripts\Run-Tests.ps1
|
||||
arguments: -MatchPattern '*feature.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)'
|
||||
- ${{ if eq(parameters.buildTerminal, true) }}:
|
||||
- task: CopyFiles@2
|
||||
displayName: Copy *.msix and symbols to Artifacts
|
||||
inputs:
|
||||
Contents: >-
|
||||
**/*.msix
|
||||
|
||||
**/*.appxsym
|
||||
TargetFolder: $(Build.ArtifactStagingDirectory)/appx
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
|
||||
- pwsh: |-
|
||||
$Package = (Get-ChildItem "$(Build.ArtifactStagingDirectory)/appx" -Recurse -Filter "Cascadia*.msix" | Select -First 1)
|
||||
$PackageFilename = $Package.FullName
|
||||
Write-Host "##vso[task.setvariable variable=WindowsTerminalPackagePath]${PackageFilename}"
|
||||
& "$(MakeAppxPath)" unpack /p $PackageFilename /d "$(Build.SourcesDirectory)\UnpackedTerminalPackage"
|
||||
displayName: Unpack the new Terminal package for signing
|
||||
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit Terminal's binaries for signing
|
||||
inputs:
|
||||
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
||||
FolderPath: '$(Build.SourcesDirectory)\UnpackedTerminalPackage'
|
||||
signType: batchSigning
|
||||
batchSignPolicyFile: '$(Build.SourcesDirectory)\build\config\ESRPSigning_Terminal.json'
|
||||
|
||||
- pwsh: |-
|
||||
$PackageFilename = "$(WindowsTerminalPackagePath)"
|
||||
Remove-Item "$(Build.SourcesDirectory)\UnpackedTerminalPackage\CodeSignSummary*"
|
||||
& "$(MakeAppxPath)" pack /h SHA256 /o /p $PackageFilename /d "$(Build.SourcesDirectory)\UnpackedTerminalPackage"
|
||||
displayName: Re-pack the new Terminal package after signing
|
||||
|
||||
- pwsh: |-
|
||||
$XamlAppxPath = (Get-Item "src\cascadia\CascadiaPackage\AppPackages\*\Dependencies\$(BuildPlatform)\Microsoft.UI.Xaml*.appx").FullName
|
||||
& .\build\scripts\New-UnpackagedTerminalDistribution.ps1 -TerminalAppX $(WindowsTerminalPackagePath) -XamlAppX $XamlAppxPath -Destination "$(Build.ArtifactStagingDirectory)/appx"
|
||||
displayName: Build Unpackaged Distribution
|
||||
|
||||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
||||
displayName: 'Generate SBOM manifest (application)'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/appx'
|
||||
|
||||
- task: DropValidatorTask@0
|
||||
displayName: 'Validate application SBOM manifest'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/appx'
|
||||
OutputPath: 'output.json'
|
||||
ValidateSignature: true
|
||||
Verbosity: 'Verbose'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Artifact (Terminal app)
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)/appx
|
||||
ArtifactName: terminal-$(BuildPlatform)-$(BuildConfiguration)
|
||||
|
||||
- ${{ if eq(parameters.buildConPTY, true) }}:
|
||||
- task: CopyFiles@2
|
||||
displayName: Copy ConPTY to Artifacts
|
||||
inputs:
|
||||
Contents: |-
|
||||
$(Build.SourcesDirectory)/bin/**/conpty.dll
|
||||
$(Build.SourcesDirectory)/bin/**/conpty.lib
|
||||
$(Build.SourcesDirectory)/bin/**/conpty.pdb
|
||||
$(Build.SourcesDirectory)/bin/**/OpenConsole.exe
|
||||
$(Build.SourcesDirectory)/bin/**/OpenConsole.pdb
|
||||
TargetFolder: $(Build.ArtifactStagingDirectory)/conpty
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Artifact (ConPTY)
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)/conpty
|
||||
ArtifactName: conpty-dll-$(BuildPlatform)-$(BuildConfiguration)
|
||||
- ${{ if eq(parameters.buildWPF, true) }}:
|
||||
- task: CopyFiles@2
|
||||
displayName: Copy PublicTerminalCore.dll to Artifacts
|
||||
inputs:
|
||||
Contents: >-
|
||||
**/PublicTerminalCore.dll
|
||||
TargetFolder: $(Build.ArtifactStagingDirectory)/wpf
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Artifact (PublicTerminalCore)
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)/wpf
|
||||
ArtifactName: wpf-dll-$(BuildPlatform)-$(BuildConfiguration)
|
||||
|
||||
- task: PublishSymbols@2
|
||||
displayName: Publish symbols path
|
||||
continueOnError: True
|
||||
inputs:
|
||||
SearchPattern: |
|
||||
$(Build.SourcesDirectory)/bin/**/*.pdb
|
||||
$(Build.SourcesDirectory)/bin/**/*.exe
|
||||
$(Build.SourcesDirectory)/bin/**/*.dll
|
||||
IndexSources: false
|
||||
SymbolServerType: TeamServices
|
||||
|
||||
- ${{ if eq(parameters.runCompliance, true) }}:
|
||||
- template: ./templates/build-console-compliance-job.yml
|
||||
|
||||
- ${{ if eq(parameters.buildTerminal, true) }}:
|
||||
- job: BundleAndSign
|
||||
displayName: Create and sign AppX/MSIX bundles
|
||||
variables:
|
||||
${{ if eq(parameters.branding, 'Release') }}:
|
||||
BundleStemName: Microsoft.WindowsTerminal
|
||||
${{ elseif eq(parameters.branding, 'Preview') }}:
|
||||
BundleStemName: Microsoft.WindowsTerminalPreview
|
||||
${{ else }}:
|
||||
BundleStemName: WindowsTerminalDev
|
||||
dependsOn: Build
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- task: DownloadBuildArtifacts@1
|
||||
displayName: Download Artifacts ${{ platform }}
|
||||
inputs:
|
||||
# Make sure to download the entire artifact, because it includes the SPDX SBOM
|
||||
artifactName: terminal-${{ platform }}-Release
|
||||
# Downloading to the source directory should ensure that the later SBOM generator can see the earlier SBOMs.
|
||||
downloadPath: '$(Build.SourcesDirectory)/appx-artifacts'
|
||||
# Add 3000 to the major version component, but only for the bundle.
|
||||
# This is to ensure that it is newer than "2022.xx.yy.zz" or whatever the original bundle versions were before
|
||||
# we switched to uniform naming.
|
||||
- pwsh: |-
|
||||
$VersionEpoch = 3000
|
||||
$Components = "$(XES_APPXMANIFESTVERSION)" -Split "\."
|
||||
$Components[0] = ([int]$Components[0] + $VersionEpoch)
|
||||
$BundleVersion = $Components -Join "."
|
||||
New-Item -Type Directory "$(System.ArtifactsDirectory)\bundle"
|
||||
.\build\scripts\Create-AppxBundle.ps1 -InputPath "$(Build.SourcesDirectory)/appx-artifacts" -ProjectName CascadiaPackage -BundleVersion $BundleVersion -OutputPath "$(System.ArtifactsDirectory)\bundle\$(BundleStemName)_$(XES_APPXMANIFESTVERSION)_8wekyb3d8bbwe.msixbundle"
|
||||
displayName: Create WindowsTerminal*.msixbundle
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit *.msixbundle to ESRP for code signing
|
||||
inputs:
|
||||
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
||||
FolderPath: $(System.ArtifactsDirectory)\bundle
|
||||
Pattern: $(BundleStemName)*.msixbundle
|
||||
UseMinimatch: true
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: >-
|
||||
[
|
||||
{
|
||||
"KeyCode": "Dynamic",
|
||||
"CertTemplateName": "WINMSAPP1ST",
|
||||
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
|
||||
"OperationCode": "SigntoolSign",
|
||||
"Parameters": {
|
||||
"OpusName": "Microsoft",
|
||||
"OpusInfo": "http://www.microsoft.com",
|
||||
"FileDigest": "/fd \"SHA256\"",
|
||||
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "Dynamic",
|
||||
"CertTemplateName": "WINMSAPP1ST",
|
||||
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
|
||||
"OperationCode": "SigntoolVerify",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
|
||||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
||||
displayName: 'Generate SBOM manifest (bundle)'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/bundle'
|
||||
BuildComponentPath: '$(Build.SourcesDirectory)/appx-artifacts'
|
||||
|
||||
- task: DropValidatorTask@0
|
||||
displayName: 'Validate bundle SBOM manifest'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/bundle'
|
||||
OutputPath: 'output.json'
|
||||
ValidateSignature: true
|
||||
Verbosity: 'Verbose'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: appxbundle-signed'
|
||||
inputs:
|
||||
PathtoPublish: $(System.ArtifactsDirectory)\bundle
|
||||
ArtifactName: appxbundle-signed
|
||||
|
||||
- ${{ if eq(parameters.buildConPTY, true) }}:
|
||||
- job: PackageAndSignConPTY
|
||||
strategy:
|
||||
matrix:
|
||||
${{ each config in parameters.buildConfigurations }}:
|
||||
${{ config }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
displayName: Create NuGet Package (ConPTY)
|
||||
dependsOn: Build
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- task: DownloadBuildArtifacts@1
|
||||
displayName: Download ${{ platform }} ConPTY binaries
|
||||
inputs:
|
||||
artifactName: conpty-dll-${{ platform }}-$(BuildConfiguration)
|
||||
downloadPath: bin\${{ platform }}\$(BuildConfiguration)\
|
||||
extractTars: false
|
||||
- task: PowerShell@2
|
||||
displayName: Move downloaded artifacts around
|
||||
inputs:
|
||||
targetType: inline
|
||||
# Find all artifact files and move them up a directory. Ugh.
|
||||
script: |-
|
||||
Get-ChildItem bin -Recurse -Directory -Filter conpty-dll-* | % {
|
||||
$_ | Get-ChildItem -Recurse -File | % {
|
||||
Move-Item -Verbose $_.FullName $_.Directory.Parent.FullName
|
||||
}
|
||||
}
|
||||
Move-Item bin\x86 bin\Win32
|
||||
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit ConPTY libraries and OpenConsole for code signing
|
||||
inputs:
|
||||
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
||||
FolderPath: '$(Build.SourcesDirectory)/bin'
|
||||
signType: batchSigning
|
||||
batchSignPolicyFile: '$(Build.SourcesDirectory)\build\config\ESRPSigning_ConPTY.json'
|
||||
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Use NuGet 5.10.0
|
||||
inputs:
|
||||
versionSpec: 5.10.0
|
||||
- task: NuGetCommand@2
|
||||
displayName: NuGet pack
|
||||
inputs:
|
||||
command: pack
|
||||
packagesToPack: $(Build.SourcesDirectory)\src\winconpty\package\winconpty.nuspec
|
||||
packDestination: '$(Build.ArtifactStagingDirectory)/nupkg'
|
||||
versioningScheme: byEnvVar
|
||||
versionEnvVar: XES_PACKAGEVERSIONNUMBER
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit *.nupkg to ESRP for code signing
|
||||
inputs:
|
||||
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
||||
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
|
||||
Pattern: '*.nupkg'
|
||||
UseMinimatch: true
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: >-
|
||||
[
|
||||
{
|
||||
"KeyCode": "CP-401405",
|
||||
"OperationCode": "NuGetSign",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-401405",
|
||||
"OperationCode": "NuGetVerify",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Artifact (nupkg)
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)\nupkg
|
||||
ArtifactName: conpty-nupkg-$(BuildConfiguration)
|
||||
|
||||
|
||||
- ${{ if eq(parameters.buildWPF, true) }}:
|
||||
- job: PackageAndSignWPF
|
||||
strategy:
|
||||
matrix:
|
||||
${{ each config in parameters.buildConfigurations }}:
|
||||
${{ config }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
displayName: Create NuGet Package (WPF Terminal Control)
|
||||
dependsOn: Build
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- task: DownloadBuildArtifacts@1
|
||||
displayName: Download ${{ platform }} PublicTerminalCore
|
||||
inputs:
|
||||
artifactName: wpf-dll-${{ platform }}-$(BuildConfiguration)
|
||||
itemPattern: '**/*.dll'
|
||||
downloadPath: bin\${{ platform }}\$(BuildConfiguration)\
|
||||
extractTars: false
|
||||
- task: PowerShell@2
|
||||
displayName: Move downloaded artifacts around
|
||||
inputs:
|
||||
targetType: inline
|
||||
# Find all artifact files and move them up a directory. Ugh.
|
||||
script: |-
|
||||
Get-ChildItem bin -Recurse -Directory -Filter wpf-dll-* | % {
|
||||
$_ | Get-ChildItem -Recurse -File | % {
|
||||
Move-Item -Verbose $_.FullName $_.Directory.Parent.FullName
|
||||
}
|
||||
}
|
||||
Move-Item bin\x86 bin\Win32
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Use NuGet 5.10.0
|
||||
inputs:
|
||||
versionSpec: 5.10.0
|
||||
- task: NuGetCommand@2
|
||||
displayName: NuGet restore copy
|
||||
inputs:
|
||||
selectOrConfig: config
|
||||
nugetConfigPath: NuGet.Config
|
||||
- task: VSBuild@1
|
||||
displayName: Build solution **\OpenConsole.sln for WPF Control
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
msbuildArgs: /p:WindowsTerminalReleaseBuild=$(UseReleaseBranding);Version=$(XES_PACKAGEVERSIONNUMBER) /t:Pack
|
||||
platform: Any CPU
|
||||
configuration: $(BuildConfiguration)
|
||||
maximumCpuCount: true
|
||||
- task: PublishSymbols@2
|
||||
displayName: Publish symbols path
|
||||
continueOnError: True
|
||||
inputs:
|
||||
SearchPattern: |
|
||||
$(Build.SourcesDirectory)/bin/**/*.pdb
|
||||
$(Build.SourcesDirectory)/bin/**/*.exe
|
||||
$(Build.SourcesDirectory)/bin/**/*.dll
|
||||
IndexSources: false
|
||||
SymbolServerType: TeamServices
|
||||
SymbolsArtifactName: Symbols_WPF_$(BuildConfiguration)
|
||||
- task: CopyFiles@2
|
||||
displayName: Copy *.nupkg to Artifacts
|
||||
inputs:
|
||||
Contents: '**/*Wpf*.nupkg'
|
||||
TargetFolder: $(Build.ArtifactStagingDirectory)/nupkg
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit *.nupkg to ESRP for code signing
|
||||
inputs:
|
||||
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
||||
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
|
||||
Pattern: '*.nupkg'
|
||||
UseMinimatch: true
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: >-
|
||||
[
|
||||
{
|
||||
"KeyCode": "CP-401405",
|
||||
"OperationCode": "NuGetSign",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-401405",
|
||||
"OperationCode": "NuGetVerify",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Artifact (nupkg)
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)\nupkg
|
||||
ArtifactName: wpf-nupkg-$(BuildConfiguration)
|
||||
|
||||
- ${{ if eq(parameters.publishSymbolsToPublic, true) }}:
|
||||
- job: PublishSymbols
|
||||
displayName: Publish Symbols
|
||||
dependsOn: BundleAndSign
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
submodules: true
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
|
||||
- template: .\templates\restore-nuget-steps.yml
|
||||
|
||||
# Download the terminal-PLATFORM-CONFIG-VERSION artifact for every platform/version combo
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- task: DownloadBuildArtifacts@1
|
||||
displayName: Download Symbols ${{ platform }}
|
||||
inputs:
|
||||
artifactName: terminal-${{ platform }}-Release
|
||||
itemPattern: '**/*.appxsym'
|
||||
|
||||
# It seems easier to do this -- download every appxsym -- then enumerate all the PDBs in the build directory for the
|
||||
# public symbol push. Otherwise, we would have to list all of the PDB files one by one.
|
||||
- pwsh: |-
|
||||
mkdir $(Build.SourcesDirectory)/appxsym-temp
|
||||
Get-ChildItem "$(System.ArtifactsDirectory)" -Filter *.appxsym -Recurse | % {
|
||||
$src = $_.FullName
|
||||
$dest = Join-Path "$(Build.SourcesDirectory)/appxsym-temp/" $_.Name
|
||||
|
||||
mkdir $dest
|
||||
Write-Host "Extracting $src to $dest..."
|
||||
tar -x -v -f $src -C $dest
|
||||
}
|
||||
displayName: Extract symbols for public consumption
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Source Index PDBs (the public ones)
|
||||
inputs:
|
||||
filePath: build\scripts\Index-Pdbs.ps1
|
||||
arguments: -SearchDir '$(Build.SourcesDirectory)/appxsym-temp' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
|
||||
pwsh: true
|
||||
|
||||
# Publish the app symbols to the public MSDL symbol server
|
||||
# accessible via https://msdl.microsoft.com/download/symbols
|
||||
- task: PublishSymbols@2
|
||||
displayName: 'Publish app symbols to MSDL'
|
||||
inputs:
|
||||
symbolsFolder: '$(Build.SourcesDirectory)/appxsym-temp'
|
||||
searchPattern: '**/*.pdb'
|
||||
SymbolsMaximumWaitTime: 30
|
||||
SymbolServerType: 'TeamServices'
|
||||
SymbolsProduct: 'Windows Terminal Application Binaries'
|
||||
SymbolsVersion: '$(XES_APPXMANIFESTVERSION)'
|
||||
# The ADO task does not support indexing of GitHub sources.
|
||||
indexSources: false
|
||||
detailedLog: true
|
||||
# There is a bug which causes this task to fail if LIB includes an inaccessible path (even though it does not depend on it).
|
||||
# To work around this issue, we just force LIB to be any dir that we know exists.
|
||||
# Copied from https://github.com/microsoft/icu/blob/f869c214adc87415dfe751d81f42f1bca55dcf5f/build/azure-nuget.yml#L564-L583
|
||||
env:
|
||||
LIB: $(Build.SourcesDirectory)
|
||||
ArtifactServices_Symbol_AccountName: microsoftpublicsymbols
|
||||
ArtifactServices_Symbol_PAT: $(ADO_microsoftpublicsymbols_PAT)
|
||||
|
||||
|
||||
- ${{ if eq(parameters.buildTerminalVPack, true) }}:
|
||||
- job: VPack
|
||||
displayName: Create Windows vPack
|
||||
dependsOn: BundleAndSign
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
submodules: true
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
- task: DownloadBuildArtifacts@1
|
||||
displayName: Download Build Artifacts
|
||||
inputs:
|
||||
artifactName: appxbundle-signed
|
||||
extractTars: false
|
||||
- task: PowerShell@2
|
||||
displayName: Rename and stage packages for vpack
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
# Rename to known/fixed name for Windows build system
|
||||
|
||||
Get-ChildItem Microsoft.WindowsTerminal_*.msixbundle | Rename-Item -NewName { 'Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle' }
|
||||
|
||||
|
||||
# Create vpack directory and place item inside
|
||||
|
||||
mkdir WindowsTerminal.app
|
||||
|
||||
mv Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle .\WindowsTerminal.app\
|
||||
workingDirectory: $(System.ArtifactsDirectory)\appxbundle-signed
|
||||
- task: PkgESVPack@12
|
||||
displayName: 'Package ES - VPack'
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
sourceDirectory: $(System.ArtifactsDirectory)\appxbundle-signed\WindowsTerminal.app
|
||||
description: VPack for the Windows Terminal Application
|
||||
pushPkgName: WindowsTerminal.app
|
||||
owner: conhost
|
||||
githubToken: $(GitHubTokenForVpackProvenance)
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: 'Copy VPack Manifest to Drop'
|
||||
inputs:
|
||||
targetPath: $(XES_VPACKMANIFESTDIRECTORY)
|
||||
artifactName: VPackManifest
|
||||
- task: PkgESFCIBGit@12
|
||||
displayName: 'Submit VPack Manifest to Windows'
|
||||
inputs:
|
||||
configPath: '$(Build.SourcesDirectory)\build\config\GitCheckin.json'
|
||||
artifactsDirectory: $(XES_VPACKMANIFESTDIRECTORY)
|
||||
prTimeOut: 5
|
||||
...
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
parameters:
|
||||
- name: buildConfigurations
|
||||
type: object
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
- name: generateSbom
|
||||
type: boolean
|
||||
default: false
|
||||
- name: codeSign
|
||||
type: boolean
|
||||
default: false
|
||||
- name: pool
|
||||
type: object
|
||||
default: []
|
||||
- name: dependsOn
|
||||
type: object
|
||||
default: null
|
||||
- name: artifactStem
|
||||
type: string
|
||||
default: ''
|
||||
- name: jobName
|
||||
type: string
|
||||
default: PackWPF
|
||||
- name: variables
|
||||
type: object
|
||||
default: {}
|
||||
- name: publishArtifacts
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobName }}
|
||||
${{ if ne(length(parameters.pool), 0) }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
${{ if eq(parameters.codeSign, true) }}:
|
||||
displayName: Pack and Sign Microsoft.Terminal.Wpf
|
||||
${{ else }}:
|
||||
displayName: Pack Microsoft.Terminal.Wpf
|
||||
strategy:
|
||||
matrix:
|
||||
${{ each config in parameters.buildConfigurations }}:
|
||||
${{ config }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
variables:
|
||||
OutputBuildPlatform: AnyCPU
|
||||
Terminal.BinDir: $(Build.SourcesDirectory)/bin/$(OutputBuildPlatform)/$(BuildConfiguration)
|
||||
JobOutputDirectory: $(Build.ArtifactStagingDirectory)\nupkg
|
||||
JobOutputArtifactName: wpf-nupkg-$(BuildConfiguration)${{ parameters.artifactStem }}
|
||||
${{ insert }}: ${{ parameters.variables }}
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
|
||||
- template: steps-download-bin-dir-artifact.yml
|
||||
parameters:
|
||||
buildPlatforms:
|
||||
- ${{ parameters.buildPlatforms }}
|
||||
- Any CPU # Make sure we grab the precompiled WPF bits
|
||||
# This build is already matrix'd on configuration, so
|
||||
# just pass a single config into the download template.
|
||||
buildConfigurations:
|
||||
- $(BuildConfiguration)
|
||||
artifactStem: ${{ parameters.artifactStem }}
|
||||
|
||||
- template: .\steps-restore-nuget.yml
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: Build solution OpenConsole.sln for WPF Control (Pack)
|
||||
inputs:
|
||||
solution: 'OpenConsole.sln'
|
||||
msbuildArgs: >-
|
||||
/p:WindowsTerminalReleaseBuild=true;Version=$(XES_PACKAGEVERSIONNUMBER)
|
||||
/p:NoBuild=true
|
||||
/p:IncludeSymbols=true
|
||||
/t:Terminal\wpf\WpfTerminalControl:Pack
|
||||
platform: Any CPU
|
||||
configuration: $(BuildConfiguration)
|
||||
maximumCpuCount: true
|
||||
clean: false
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: Copy *.nupkg to Artifacts
|
||||
inputs:
|
||||
Contents: 'bin/**/*Wpf*.nupkg'
|
||||
TargetFolder: $(Build.ArtifactStagingDirectory)/nupkg
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
|
||||
- ${{ if eq(parameters.codeSign, true) }}:
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit *.nupkg to ESRP for code signing
|
||||
inputs:
|
||||
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
||||
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
|
||||
Pattern: '*.nupkg'
|
||||
UseMinimatch: true
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: >-
|
||||
[
|
||||
{
|
||||
"KeyCode": "CP-401405",
|
||||
"OperationCode": "NuGetSign",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-401405",
|
||||
"OperationCode": "NuGetVerify",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
|
||||
- ${{ if eq(parameters.generateSbom, true) }}:
|
||||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
||||
displayName: 'Generate SBOM manifest (wpf)'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/nupkg'
|
||||
BuildComponentPath: '$(Build.SourcesDirectory)/bin'
|
||||
|
||||
- task: DropValidatorTask@0
|
||||
displayName: 'Validate wpf SBOM manifest'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/nupkg'
|
||||
OutputPath: 'output.json'
|
||||
ValidateSignature: true
|
||||
Verbosity: 'Verbose'
|
||||
|
||||
- ${{ if eq(parameters.publishArtifacts, true) }}:
|
||||
- publish: $(JobOutputDirectory)
|
||||
artifact: $(JobOutputArtifactName)
|
||||
displayName: Publish nupkg
|
||||
@@ -1,279 +0,0 @@
|
||||
parameters:
|
||||
- name: branding
|
||||
type: string
|
||||
default: Dev
|
||||
- name: additionalBuildOptions
|
||||
type: string
|
||||
default: ''
|
||||
- name: buildTerminal
|
||||
type: boolean
|
||||
default: true
|
||||
- name: buildConPTY
|
||||
type: boolean
|
||||
default: false
|
||||
- name: buildWPF
|
||||
type: boolean
|
||||
default: false
|
||||
- name: buildWPFDotNetComponents # This weird hack is to make sure we sign and source index the .NET pieces
|
||||
type: boolean
|
||||
default: false
|
||||
- name: buildEverything
|
||||
displayName: "Build Everything (Overrides all other build options)"
|
||||
type: boolean
|
||||
default: false
|
||||
- name: pgoBuildMode
|
||||
type: string
|
||||
default: None
|
||||
values: [Optimize, Instrument, None]
|
||||
- name: buildConfigurations
|
||||
type: object
|
||||
default:
|
||||
- Release
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
default:
|
||||
- x64
|
||||
- x86
|
||||
- arm64
|
||||
- name: generateSbom
|
||||
type: boolean
|
||||
default: false
|
||||
- name: codeSign
|
||||
type: boolean
|
||||
default: false
|
||||
- name: keepAllExpensiveBuildOutputs
|
||||
type: boolean
|
||||
default: true
|
||||
- name: artifactStem
|
||||
type: string
|
||||
default: ''
|
||||
- name: jobName
|
||||
type: string
|
||||
default: 'Build'
|
||||
- name: pool
|
||||
type: object
|
||||
default: []
|
||||
- name: beforeBuildSteps
|
||||
type: stepList
|
||||
default: []
|
||||
- name: variables
|
||||
type: object
|
||||
default: {}
|
||||
- name: publishArtifacts
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobName }}
|
||||
${{ if ne(length(parameters.pool), 0) }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
strategy:
|
||||
matrix:
|
||||
${{ each config in parameters.buildConfigurations }}:
|
||||
${{ each platform in parameters.buildPlatforms }}:
|
||||
${{ config }}_${{ platform }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
BuildPlatform: ${{ platform }}
|
||||
${{ if eq(platform, 'x86') }}:
|
||||
OutputBuildPlatform: Win32
|
||||
${{ elseif eq(platform, 'Any CPU') }}:
|
||||
OutputBuildPlatform: AnyCPU
|
||||
${{ else }}:
|
||||
OutputBuildPlatform: ${{ platform }}
|
||||
variables:
|
||||
MakeAppxPath: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\MakeAppx.exe'
|
||||
Terminal.BinDir: $(Build.SourcesDirectory)/bin/$(OutputBuildPlatform)/$(BuildConfiguration)
|
||||
# Azure DevOps abhors a vacuum
|
||||
# If these are blank, expansion will fail later on... which will result in direct substitution of the variable *names*
|
||||
# later on. We'll just... set them to a single space and if we need to, check IsNullOrWhiteSpace.
|
||||
# Yup.
|
||||
BuildTargetParameter: ' '
|
||||
SelectedSigningFragments: ' '
|
||||
JobOutputDirectory: $(Terminal.BinDir)
|
||||
JobOutputArtifactName: build-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }}
|
||||
${{ insert }}: ${{ parameters.variables }}
|
||||
displayName: Build
|
||||
timeoutInMinutes: 240
|
||||
cancelTimeoutInMinutes: 1
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
# This generates either nothing for BuildTargetParameter, or /t:X;Y;Z, to control targets later.
|
||||
- pwsh: |-
|
||||
If (-Not [bool]::Parse("${{ parameters.buildEverything }}")) {
|
||||
$BuildTargets = @()
|
||||
$SignFragments = @()
|
||||
If ([bool]::Parse("${{ parameters.buildTerminal }}")) {
|
||||
$BuildTargets += "Terminal\CascadiaPackage"
|
||||
$SignFragments += "terminal_constituents"
|
||||
}
|
||||
If ([bool]::Parse("${{ parameters.buildWPFDotNetComponents }}")) {
|
||||
$BuildTargets += "Terminal\wpf\WpfTerminalControl"
|
||||
$SignFragments += "wpfdotnet"
|
||||
}
|
||||
If ([bool]::Parse("${{ parameters.buildWPF }}")) {
|
||||
$BuildTargets += "Terminal\wpf\PublicTerminalCore"
|
||||
$SignFragments += "wpf"
|
||||
}
|
||||
If ([bool]::Parse("${{ parameters.buildConPTY }}")) {
|
||||
$BuildTargets += "Conhost\Host_EXE;Conhost\winconpty_DLL"
|
||||
$SignFragments += "conpty"
|
||||
}
|
||||
Write-Host "Targets: $($BuildTargets -Join ";")"
|
||||
Write-Host "Sign targets: $($SignFragments -Join ";")"
|
||||
Write-Host "##vso[task.setvariable variable=BuildTargetParameter]/t:$($BuildTargets -Join ";")"
|
||||
Write-Host "##vso[task.setvariable variable=SelectedSigningFragments]$($SignFragments -Join ";")"
|
||||
}
|
||||
displayName: Prepare Build and Sign Targets
|
||||
|
||||
- pwsh: |-
|
||||
.\build\scripts\Generate-ThirdPartyNotices.ps1 -MarkdownNoticePath .\NOTICE.md -OutputPath .\src\cascadia\CascadiaPackage\NOTICE.html
|
||||
displayName: Generate NOTICE.html from NOTICE.md
|
||||
|
||||
- template: .\steps-restore-nuget.yml
|
||||
|
||||
- ${{ parameters.beforeBuildSteps }}
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: Build OpenConsole.sln
|
||||
inputs:
|
||||
solution: 'OpenConsole.sln'
|
||||
msbuildArgs: >-
|
||||
/p:WindowsTerminalOfficialBuild=true;WindowsTerminalBranding=${{ parameters.branding }};PGOBuildMode=${{ parameters.pgoBuildMode }}
|
||||
${{ parameters.additionalBuildOptions }}
|
||||
/bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
$(BuildTargetParameter)
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
maximumCpuCount: true
|
||||
|
||||
- ${{ if eq(parameters.publishArtifacts, true) }}:
|
||||
- publish: $(Build.SourcesDirectory)/msbuild.binlog
|
||||
artifact: logs-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }}
|
||||
condition: always()
|
||||
displayName: Publish Build Log
|
||||
- ${{ else }}:
|
||||
- task: CopyFiles@2
|
||||
displayName: Copy Build Log
|
||||
inputs:
|
||||
contents: $(Build.SourcesDirectory)/msbuild.binlog
|
||||
TargetFolder: $(Terminal.BinDir)
|
||||
|
||||
# This saves ~2GiB per architecture. We won't need these later.
|
||||
# Removes:
|
||||
# - All .lib that do not have an associated .exp (which would indicate that they are import libs)
|
||||
# - All .pdbs from those .libs (which were only used during linking)
|
||||
# - Directories ending in Lib (static lib projects that we fully linked into DLLs which may also contain unnecessary resources)
|
||||
# - All LocalTests_ project outputs, as they were subsumed into TestHostApp
|
||||
# - All PDB files inside the WindowsTerminal/ output, which do not belong there.
|
||||
- pwsh: |-
|
||||
$binDir = '$(Terminal.BinDir)'
|
||||
$ImportLibs = Get-ChildItem $binDir -Recurse -File -Filter '*.exp' | ForEach-Object { $_.FullName -Replace "exp$","lib" }
|
||||
$StaticLibs = Get-ChildItem $binDir -Recurse -File -Filter '*.lib' | Where-Object FullName -NotIn $ImportLibs
|
||||
|
||||
$Items = @()
|
||||
$Items += $StaticLibs
|
||||
$Items += Get-Item ($StaticLibs.FullName -Replace "lib$","pdb") -ErrorAction:Ignore
|
||||
$Items += Get-ChildItem $binDir -Directory -Filter '*Lib'
|
||||
$Items += Get-ChildItem $binDir -Directory -Filter 'LocalTests_*'
|
||||
$Items += Get-ChildItem "${$binDir}\WindowsTerminal" -Filter '*.pdb' -ErrorAction:Ignore
|
||||
|
||||
If (-Not [bool]::Parse('${{ parameters.keepAllExpensiveBuildOutputs }}')) {
|
||||
$Items += Get-ChildItem '$(Terminal.BinDir)' -Filter '*.pdb' -Recurse
|
||||
}
|
||||
|
||||
$Items | Remove-Item -Recurse -Force -Verbose -ErrorAction:Ignore
|
||||
displayName: Clean up static libs and extra symbols
|
||||
errorActionPreference: silentlyContinue # It's OK if this silently fails
|
||||
|
||||
# We cannot index PDBs that we have deleted!
|
||||
- ${{ if eq(parameters.keepAllExpensiveBuildOutputs, true) }}:
|
||||
- pwsh: |-
|
||||
build\scripts\Index-Pdbs.ps1 -SearchDir '$(Terminal.BinDir)' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
|
||||
displayName: Source Index PDBs
|
||||
errorActionPreference: silentlyContinue
|
||||
|
||||
- ${{ if or(parameters.buildTerminal, parameters.buildEverything) }}:
|
||||
- pwsh: |-
|
||||
$Package = (Get-ChildItem -Recurse -Filter "CascadiaPackage*.msix" | Select -First 1)
|
||||
$PackageFilename = $Package.FullName
|
||||
Write-Host "##vso[task.setvariable variable=WindowsTerminalPackagePath]${PackageFilename}"
|
||||
displayName: Locate the MSIX
|
||||
|
||||
# CHECK EXCEPTION
|
||||
# PGO requires a desktop CRT
|
||||
- ${{ if ne(parameters.pgoBuildMode, 'Instrument') }}:
|
||||
- pwsh: |-
|
||||
.\build\scripts\Test-WindowsTerminalPackage.ps1 -Verbose -Path "$(WindowsTerminalPackagePath)"
|
||||
displayName: Check MSIX for common regressions
|
||||
condition: and(succeeded(), ne(variables.WindowsTerminalPackagePath, ''))
|
||||
|
||||
- ${{ if eq(parameters.codeSign, true) }}:
|
||||
- pwsh: |-
|
||||
& "$(MakeAppxPath)" unpack /p "$(WindowsTerminalPackagePath)" /d "$(Terminal.BinDir)/PackageContents"
|
||||
displayName: Unpack the MSIX for signing
|
||||
|
||||
- ${{ if eq(parameters.codeSign, true) }}:
|
||||
- template: steps-create-signing-config.yml
|
||||
parameters:
|
||||
outFile: '$(Build.SourcesDirectory)/ESRPSigningConfig.json'
|
||||
stage: build
|
||||
fragments: $(SelectedSigningFragments)
|
||||
|
||||
# Code-sign everything we just put together.
|
||||
# We run the signing in Terminal.BinDir, because all of the signing batches are relative to the final architecture/configuration output folder.
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit Signing Request
|
||||
inputs:
|
||||
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
||||
FolderPath: '$(Terminal.BinDir)'
|
||||
signType: batchSigning
|
||||
batchSignPolicyFile: '$(Build.SourcesDirectory)/ESRPSigningConfig.json'
|
||||
|
||||
# We only need to re-pack the MSIX if we actually signed, so this can stay in the codeSign conditional
|
||||
- ${{ if or(parameters.buildTerminal, parameters.buildEverything) }}:
|
||||
- pwsh: |-
|
||||
$outDir = New-Item -Type Directory "$(Terminal.BinDir)/_appx" -ErrorAction:Ignore
|
||||
$PackageFilename = Join-Path $outDir.FullName (Split-Path -Leaf "$(WindowsTerminalPackagePath)")
|
||||
& "$(MakeAppxPath)" pack /h SHA256 /o /p $PackageFilename /d "$(Terminal.BinDir)/PackageContents"
|
||||
Write-Host "##vso[task.setvariable variable=WindowsTerminalPackagePath]${PackageFilename}"
|
||||
displayName: Re-pack the new Terminal package after signing
|
||||
|
||||
- ${{ else }}: # No Signing
|
||||
- ${{ if or(parameters.buildTerminal, parameters.buildEverything) }}:
|
||||
- pwsh: |-
|
||||
$outDir = New-Item -Type Directory "$(Terminal.BinDir)/_appx" -ErrorAction:Ignore
|
||||
$PackageFilename = Join-Path $outDir.FullName (Split-Path -Leaf "$(WindowsTerminalPackagePath)")
|
||||
Copy-Item "$(WindowsTerminalPackagePath)" $PackageFilename
|
||||
Write-Host "##vso[task.setvariable variable=WindowsTerminalPackagePath]${PackageFilename}"
|
||||
displayName: Stage the package (unsigned)
|
||||
condition: and(succeeded(), ne(variables.WindowsTerminalPackagePath, ''))
|
||||
|
||||
- ${{ if or(parameters.buildTerminal, parameters.buildEverything) }}:
|
||||
- pwsh: |-
|
||||
$XamlAppxPath = (Get-Item "src\cascadia\CascadiaPackage\AppPackages\*\Dependencies\$(BuildPlatform)\Microsoft.UI.Xaml*.appx").FullName
|
||||
$outDir = New-Item -Type Directory "$(Terminal.BinDir)/_unpackaged" -ErrorAction:Ignore
|
||||
& .\build\scripts\New-UnpackagedTerminalDistribution.ps1 -TerminalAppX $(WindowsTerminalPackagePath) -XamlAppX $XamlAppxPath -Destination $outDir.FullName
|
||||
displayName: Build Unpackaged Distribution (from MSIX)
|
||||
condition: and(succeeded(), ne(variables.WindowsTerminalPackagePath, ''))
|
||||
|
||||
- ${{ if eq(parameters.generateSbom, true) }}:
|
||||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
||||
displayName: 'Generate SBOM manifest'
|
||||
inputs:
|
||||
BuildDropPath: '$(Terminal.BinDir)'
|
||||
|
||||
- task: DropValidatorTask@0
|
||||
displayName: 'Validate SBOM manifest'
|
||||
inputs:
|
||||
BuildDropPath: '$(Terminal.BinDir)'
|
||||
OutputPath: 'output.json'
|
||||
ValidateSignature: true
|
||||
Verbosity: 'Verbose'
|
||||
|
||||
- ${{ if eq(parameters.publishArtifacts, true) }}:
|
||||
- publish: $(Terminal.BinDir)
|
||||
artifact: $(JobOutputArtifactName)
|
||||
displayName: Publish All Outputs
|
||||
@@ -1,15 +0,0 @@
|
||||
jobs:
|
||||
- job: CodeFormatCheck
|
||||
displayName: Check Code Format
|
||||
pool: { vmImage: windows-2022 }
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: 1
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
submodules: false
|
||||
clean: true
|
||||
|
||||
- powershell: |-
|
||||
.\build\scripts\Invoke-FormattingCheck.ps1
|
||||
displayName: 'Run formatters'
|
||||
@@ -1,143 +0,0 @@
|
||||
parameters:
|
||||
- name: branding
|
||||
type: string
|
||||
- name: buildConfigurations
|
||||
type: object
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
- name: generateSbom
|
||||
type: boolean
|
||||
default: false
|
||||
- name: codeSign
|
||||
type: boolean
|
||||
default: false
|
||||
- name: pool
|
||||
type: object
|
||||
default: []
|
||||
- name: dependsOn
|
||||
type: object
|
||||
default: null
|
||||
- name: artifactStem
|
||||
type: string
|
||||
default: ''
|
||||
- name: jobName
|
||||
type: string
|
||||
default: Bundle
|
||||
- name: variables
|
||||
type: object
|
||||
default: {}
|
||||
- name: publishArtifacts
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobName }}
|
||||
${{ if ne(length(parameters.pool), 0) }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
${{ if eq(parameters.codeSign, true) }}:
|
||||
displayName: Pack and Sign Terminal MSIXBundle
|
||||
${{ else }}:
|
||||
displayName: Pack Terminal MSIXBundle
|
||||
strategy:
|
||||
matrix:
|
||||
${{ each config in parameters.buildConfigurations }}:
|
||||
${{ config }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
variables:
|
||||
${{ if eq(parameters.branding, 'Release') }}:
|
||||
BundleStemName: Microsoft.WindowsTerminal
|
||||
${{ elseif eq(parameters.branding, 'Preview') }}:
|
||||
BundleStemName: Microsoft.WindowsTerminalPreview
|
||||
${{ else }}:
|
||||
BundleStemName: WindowsTerminalDev
|
||||
JobOutputDirectory: '$(System.ArtifactsDirectory)/bundle'
|
||||
JobOutputArtifactName: appxbundle-$(BuildConfiguration)${{ parameters.artifactStem }}
|
||||
${{ insert }}: ${{ parameters.variables }}
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- template: steps-download-bin-dir-artifact.yml
|
||||
parameters:
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
# This build is already matrix'd on configuration, so
|
||||
# just pass a single config into the download template.
|
||||
buildConfigurations:
|
||||
- $(BuildConfiguration)
|
||||
artifactStem: ${{ parameters.artifactStem }}
|
||||
|
||||
# Add 3000 to the major version component, but only for the bundle.
|
||||
# This is to ensure that it is newer than "2022.xx.yy.zz" or whatever the original bundle versions were before
|
||||
# we switched to uniform naming.
|
||||
- pwsh: |-
|
||||
$VersionEpoch = 3000
|
||||
$Components = "$(XES_APPXMANIFESTVERSION)" -Split "\."
|
||||
$Components[0] = ([int]$Components[0] + $VersionEpoch)
|
||||
$BundleVersion = $Components -Join "."
|
||||
New-Item -Type Directory "$(System.ArtifactsDirectory)/bundle"
|
||||
.\build\scripts\Create-AppxBundle.ps1 -InputPath 'bin/' -ProjectName CascadiaPackage -BundleVersion $BundleVersion -OutputPath "$(System.ArtifactsDirectory)\bundle\$(BundleStemName)_$(XES_APPXMANIFESTVERSION)_8wekyb3d8bbwe.msixbundle"
|
||||
displayName: Create msixbundle
|
||||
|
||||
- ${{ if eq(parameters.codeSign, true) }}:
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit *.msixbundle to ESRP for code signing
|
||||
inputs:
|
||||
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
||||
FolderPath: $(System.ArtifactsDirectory)\bundle
|
||||
Pattern: $(BundleStemName)*.msixbundle
|
||||
UseMinimatch: true
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: >-
|
||||
[
|
||||
{
|
||||
"KeyCode": "Dynamic",
|
||||
"CertTemplateName": "WINMSAPP1ST",
|
||||
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
|
||||
"OperationCode": "SigntoolSign",
|
||||
"Parameters": {
|
||||
"OpusName": "Microsoft",
|
||||
"OpusInfo": "http://www.microsoft.com",
|
||||
"FileDigest": "/fd \"SHA256\"",
|
||||
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "Dynamic",
|
||||
"CertTemplateName": "WINMSAPP1ST",
|
||||
"CertSubjectName": "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
|
||||
"OperationCode": "SigntoolVerify",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
|
||||
- ${{ if eq(parameters.generateSbom, true) }}:
|
||||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
||||
displayName: 'Generate SBOM manifest (bundle)'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/bundle'
|
||||
BuildComponentPath: '$(Build.SourcesDirectory)/bin'
|
||||
|
||||
- task: DropValidatorTask@0
|
||||
displayName: 'Validate bundle SBOM manifest'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/bundle'
|
||||
OutputPath: 'output.json'
|
||||
ValidateSignature: true
|
||||
Verbosity: 'Verbose'
|
||||
|
||||
- ${{ if eq(parameters.publishArtifacts, true) }}:
|
||||
- publish: $(JobOutputDirectory)
|
||||
artifact: $(JobOutputArtifactName)
|
||||
displayName: Publish msixbundle
|
||||
@@ -1,129 +0,0 @@
|
||||
parameters:
|
||||
- name: buildConfigurations
|
||||
type: object
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
- name: generateSbom
|
||||
type: boolean
|
||||
default: false
|
||||
- name: codeSign
|
||||
type: boolean
|
||||
default: false
|
||||
- name: pool
|
||||
type: object
|
||||
default: []
|
||||
- name: dependsOn
|
||||
type: object
|
||||
default: null
|
||||
- name: artifactStem
|
||||
type: string
|
||||
default: ''
|
||||
- name: jobName
|
||||
type: string
|
||||
default: PackConPTY
|
||||
- name: variables
|
||||
type: object
|
||||
default: {}
|
||||
- name: publishArtifacts
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobName }}
|
||||
${{ if ne(length(parameters.pool), 0) }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
${{ if eq(parameters.codeSign, true) }}:
|
||||
displayName: Pack and Sign Microsoft.Windows.Console.ConPTY
|
||||
${{ else }}:
|
||||
displayName: Pack Microsoft.Windows.Console.ConPTY
|
||||
strategy:
|
||||
matrix:
|
||||
${{ each config in parameters.buildConfigurations }}:
|
||||
${{ config }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
variables:
|
||||
JobOutputDirectory: $(Build.ArtifactStagingDirectory)\nupkg
|
||||
JobOutputArtifactName: conpty-nupkg-$(BuildConfiguration)${{ parameters.artifactStem }}
|
||||
${{ insert }}: ${{ parameters.variables }}
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
|
||||
- template: steps-download-bin-dir-artifact.yml
|
||||
parameters:
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
# This build is already matrix'd on configuration, so
|
||||
# just pass a single config into the download template.
|
||||
buildConfigurations:
|
||||
- $(BuildConfiguration)
|
||||
artifactStem: ${{ parameters.artifactStem }}
|
||||
|
||||
- template: steps-ensure-nuget-version.yml
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: NuGet pack
|
||||
inputs:
|
||||
command: pack
|
||||
packagesToPack: $(Build.SourcesDirectory)\src\winconpty\package\winconpty.nuspec
|
||||
packDestination: '$(Build.ArtifactStagingDirectory)/nupkg'
|
||||
versioningScheme: byEnvVar
|
||||
versionEnvVar: XES_PACKAGEVERSIONNUMBER
|
||||
|
||||
- ${{ if eq(parameters.codeSign, true) }}:
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: Submit *.nupkg to ESRP for code signing
|
||||
inputs:
|
||||
ConnectedServiceName: 9d6d2960-0793-4d59-943e-78dcb434840a
|
||||
FolderPath: $(Build.ArtifactStagingDirectory)/nupkg
|
||||
Pattern: '*.nupkg'
|
||||
UseMinimatch: true
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: >-
|
||||
[
|
||||
{
|
||||
"KeyCode": "CP-401405",
|
||||
"OperationCode": "NuGetSign",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-401405",
|
||||
"OperationCode": "NuGetVerify",
|
||||
"Parameters": {},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
|
||||
- ${{ if eq(parameters.generateSbom, true) }}:
|
||||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
||||
displayName: 'Generate SBOM manifest (conpty)'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/nupkg'
|
||||
BuildComponentPath: '$(Build.SourcesDirectory)/bin'
|
||||
|
||||
- task: DropValidatorTask@0
|
||||
displayName: 'Validate conpty SBOM manifest'
|
||||
inputs:
|
||||
BuildDropPath: '$(System.ArtifactsDirectory)/nupkg'
|
||||
OutputPath: 'output.json'
|
||||
ValidateSignature: true
|
||||
Verbosity: 'Verbose'
|
||||
|
||||
- ${{ if eq(parameters.publishArtifacts, true) }}:
|
||||
- publish: $(JobOutputDirectory)
|
||||
artifact: $(JobOutputArtifactName)
|
||||
displayName: Publish nupkg
|
||||
@@ -1,75 +0,0 @@
|
||||
parameters:
|
||||
- name: buildConfiguration
|
||||
type: string
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
- name: pool
|
||||
type: object
|
||||
default: []
|
||||
- name: dependsOn
|
||||
type: object
|
||||
default: null
|
||||
- name: artifactStem
|
||||
type: string
|
||||
default: ''
|
||||
- name: jobName
|
||||
type: string
|
||||
default: MergePGD
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobName }}
|
||||
${{ if ne(length(parameters.pool), 0) }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
displayName: Merge PGO Counts for ${{ parameters.buildConfiguration }}
|
||||
|
||||
steps:
|
||||
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
|
||||
- script: |
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
|
||||
set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt
|
||||
del %TEMP%\vsinstalldir.txt
|
||||
call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat"
|
||||
echo VCToolsInstallDir = %VCToolsInstallDir%
|
||||
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
|
||||
displayName: 'Retrieve VC tools directory'
|
||||
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download PGO Databases for ${{ platform }}
|
||||
inputs:
|
||||
artifactName: build-${{ platform }}-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
|
||||
itemPattern: '**/*.pgd'
|
||||
downloadPath: '$(Build.SourcesDirectory)/pgd/${{ platform }}/${{ parameters.buildConfiguration }}'
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download PGO Counts for ${{ platform }}
|
||||
inputs:
|
||||
artifactName: pgc-intermediates-${{ platform }}-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
|
||||
downloadPath: '$(Build.SourcesDirectory)/pgc/${{ platform }}/${{ parameters.buildConfiguration }}'
|
||||
- pwsh: |-
|
||||
$Arch = '${{ platform }}'
|
||||
$Conf = '${{ parameters.buildConfiguration }}'
|
||||
$PGCDir = '$(Build.SourcesDirectory)/pgc/${{ platform }}/${{ parameters.buildConfiguration }}'
|
||||
$PGDDir = '$(Build.SourcesDirectory)/pgd/${{ platform }}/${{ parameters.buildConfiguration }}'
|
||||
# Flatten the PGD directory
|
||||
Get-ChildItem $PGDDir -Recurse -Filter *.pgd | Move-Item -Destination $PGDDir -Verbose
|
||||
Get-ChildItem $PGCDir -Filter *.pgc |
|
||||
ForEach-Object {
|
||||
$Parts = $_.Name -Split "!";
|
||||
$_ | Add-Member Module $Parts[0] -PassThru
|
||||
} |
|
||||
Group-Object Module |
|
||||
ForEach-Object {
|
||||
& "$(VCToolsInstallDir)\bin\Hostx64\${{ platform }}\pgomgr.exe" /merge $_.Group.FullName "$PGDDir\$($_.Name).pgd"
|
||||
}
|
||||
displayName: Merge PGO Counts for ${{ platform }}
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy merged pgds to artifact staging'
|
||||
inputs:
|
||||
sourceFolder: '$(Build.SourcesDirectory)/pgd/${{ platform }}/${{ parameters.buildConfiguration }}'
|
||||
contents: '**\*.pgd'
|
||||
targetFolder: '$(Build.ArtifactStagingDirectory)\out-pgd\${{ platform }}'
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)\out-pgd
|
||||
artifact: pgd-merged-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
|
||||
displayName: "Publish merged PGDs"
|
||||
@@ -1,86 +0,0 @@
|
||||
parameters:
|
||||
- name: includePublicSymbolServer
|
||||
type: boolean
|
||||
default: false
|
||||
- name: pool
|
||||
type: object
|
||||
default: []
|
||||
- name: dependsOn
|
||||
type: object
|
||||
default: null
|
||||
- name: artifactStem
|
||||
type: string
|
||||
default: ''
|
||||
- name: jobName
|
||||
type: string
|
||||
default: PublishSymbols
|
||||
- name: symbolExpiryTime
|
||||
type: string
|
||||
default: 36530 # This is the default from PublishSymbols@2
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobName }}
|
||||
${{ if ne(length(parameters.pool), 0) }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
${{ if eq(parameters.includePublicSymbolServer, true) }}:
|
||||
displayName: Publish Symbols to Internal and MSDL
|
||||
${{ else }}:
|
||||
displayName: Publish Symbols Internally
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download all PDBs from all prior build phases
|
||||
inputs:
|
||||
itemPattern: '**/*.pdb'
|
||||
targetPath: '$(Build.SourcesDirectory)/bin'
|
||||
|
||||
- task: PublishSymbols@2
|
||||
displayName: Publish Symbols (to current Azure DevOps tenant)
|
||||
continueOnError: True
|
||||
inputs:
|
||||
SymbolsFolder: '$(Build.SourcesDirectory)/bin'
|
||||
SearchPattern: '**/*.pdb'
|
||||
IndexSources: false
|
||||
DetailedLog: true
|
||||
SymbolsMaximumWaitTime: 30
|
||||
SymbolServerType: 'TeamServices'
|
||||
SymbolsProduct: 'Windows Terminal Converged Symbols'
|
||||
SymbolsVersion: '$(XES_APPXMANIFESTVERSION)'
|
||||
SymbolExpirationInDays: ${{ parameters.symbolExpiryTime }}
|
||||
env:
|
||||
LIB: $(Build.SourcesDirectory)
|
||||
|
||||
- ${{ if eq(parameters.includePublicSymbolServer, true) }}:
|
||||
- task: PublishSymbols@2
|
||||
displayName: 'Publish symbols to MSDL'
|
||||
continueOnError: True
|
||||
inputs:
|
||||
SymbolsFolder: '$(Build.SourcesDirectory)/bin'
|
||||
SearchPattern: '**/*.pdb'
|
||||
IndexSources: false
|
||||
DetailedLog: true
|
||||
SymbolsMaximumWaitTime: 30
|
||||
SymbolServerType: 'TeamServices'
|
||||
SymbolsProduct: 'Windows Terminal Converged Symbols'
|
||||
SymbolsVersion: '$(XES_APPXMANIFESTVERSION)'
|
||||
SymbolExpirationInDays: ${{ parameters.symbolExpiryTime }}
|
||||
# The ADO task does not support indexing of GitHub sources.
|
||||
# There is a bug which causes this task to fail if LIB includes an inaccessible path (even though it does not depend on it).
|
||||
# To work around this issue, we just force LIB to be any dir that we know exists.
|
||||
# Copied from https://github.com/microsoft/icu/blob/f869c214adc87415dfe751d81f42f1bca55dcf5f/build/azure-nuget.yml#L564-L583
|
||||
env:
|
||||
LIB: $(Build.SourcesDirectory)
|
||||
ArtifactServices_Symbol_AccountName: microsoftpublicsymbols
|
||||
ArtifactServices_Symbol_PAT: $(ADO_microsoftpublicsymbols_PAT)
|
||||
@@ -1,82 +0,0 @@
|
||||
parameters:
|
||||
buildConfiguration: 'Release'
|
||||
buildPlatform: ''
|
||||
artifactStem: ''
|
||||
testLogPath: '$(Build.BinariesDirectory)\$(BuildPlatform)\$(BuildConfiguration)\testsOnBuildMachine.wtl'
|
||||
|
||||
jobs:
|
||||
- job: PGO${{ parameters.buildPlatform }}${{ parameters.buildConfiguration }}
|
||||
displayName: PGO ${{ parameters.buildPlatform }} ${{ parameters.buildConfiguration }}
|
||||
variables:
|
||||
BuildConfiguration: ${{ parameters.buildConfiguration }}
|
||||
BuildPlatform: ${{ parameters.buildPlatform }}
|
||||
OutputBuildPlatform: ${{ parameters.buildPlatform }}
|
||||
Terminal.BinDir: $(Build.SourcesDirectory)/bin/$(OutputBuildPlatform)/$(BuildConfiguration)
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
${{ if ne(parameters.buildPlatform, 'ARM64') }}:
|
||||
name: SHINE-OSS-Testing-x64
|
||||
${{ else }}:
|
||||
name: SHINE-OSS-Testing-arm64
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
${{ if ne(parameters.buildPlatform, 'ARM64') }}:
|
||||
name: SHINE-INT-Testing-x64
|
||||
${{ else }}:
|
||||
name: SHINE-INT-Testing-arm64
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: false
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download artifacts
|
||||
inputs:
|
||||
artifactName: build-${{ parameters.buildPlatform }}-$(BuildConfiguration)${{ parameters.artifactStem }}
|
||||
downloadPath: $(Terminal.BinDir)
|
||||
|
||||
# The tests expect Terminal to be an unpackaged distribution named terminal-0.0.1.0 (after the dev build version scheme)
|
||||
# Extract to that folder explicitly and strip the embedded folder name from the unpackaged archive.
|
||||
- powershell: |-
|
||||
$TargetDirectory = New-Item -Type Directory (Join-Path "$(Terminal.BinDir)" "terminal-0.0.1.0")
|
||||
& tar.exe -x -v -f (Get-Item "$(Terminal.BinDir)/_unpackaged/*.zip") -C $TargetDirectory.FullName --strip-components=1
|
||||
displayName: Extract the unpackaged build for PGO
|
||||
|
||||
- template: steps-ensure-nuget-version.yml
|
||||
|
||||
- powershell: |-
|
||||
$Package = 'Microsoft.Internal.Windows.Terminal.TestContent'
|
||||
$Version = '1.0.1'
|
||||
& nuget.exe install $Package -Version $Version
|
||||
Write-Host "##vso[task.setvariable variable=TerminalTestContentPath]$(Build.SourcesDirectory)\packages\${Package}.${Version}\content"
|
||||
displayName: Install Test Content
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Run PGO Tests'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\scripts\Run-Tests.ps1
|
||||
arguments: >-
|
||||
-MatchPattern '*UIA.Tests.dll'
|
||||
-Platform '$(OutputBuildPlatform)'
|
||||
-Configuration '$(BuildConfiguration)'
|
||||
-LogPath '${{ parameters.testLogPath }}'
|
||||
-Root "$(Terminal.BinDir)"
|
||||
-AdditionalTaefArguments '/select:(@IsPGO=true)','/p:WTTestContent=$(TerminalTestContentPath)'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy PGO outputs to Artifacts'
|
||||
condition: always()
|
||||
inputs:
|
||||
Contents: |
|
||||
**/*.pgc
|
||||
${{ parameters.testLogPath }}
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/pgc'
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
|
||||
- publish: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/pgc'
|
||||
artifact: pgc-intermediates-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.artifactStem }}
|
||||
condition: always()
|
||||
@@ -1,81 +0,0 @@
|
||||
parameters:
|
||||
- name: buildConfiguration
|
||||
type: string
|
||||
- name: generateSbom
|
||||
type: boolean
|
||||
default: false
|
||||
- name: pool
|
||||
type: object
|
||||
default: []
|
||||
- name: dependsOn
|
||||
type: object
|
||||
default: null
|
||||
- name: artifactStem
|
||||
type: string
|
||||
default: ''
|
||||
- name: variables
|
||||
type: object
|
||||
default: {}
|
||||
- name: publishArtifacts
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
- job: VPack
|
||||
${{ if ne(length(parameters.pool), 0) }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
displayName: Create and Submit Windows vPack
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
variables:
|
||||
JobOutputDirectory: $(XES_VPACKMANIFESTDIRECTORY)
|
||||
JobOutputArtifactName: vpack-manifest${{ parameters.artifactStem }}
|
||||
${{ insert }}: ${{ parameters.variables }}
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download MSIX Bundle Artifact
|
||||
inputs:
|
||||
artifactName: appxbundle-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
|
||||
downloadPath: '$(Build.SourcesDirectory)/bundle'
|
||||
|
||||
# Rename to known/fixed name for Windows build system
|
||||
- powershell: |-
|
||||
# Create vpack directory and place item inside
|
||||
$TargetFolder = New-Item -Type Directory '$(Build.SourcesDirectory)/WindowsTerminal.app'
|
||||
Get-ChildItem bundle/Microsoft.WindowsTerminal_*.msixbundle | Move-Item (Join-Path $TargetFolder.FullName 'Microsoft.WindowsTerminal_8wekyb3d8bbwe.msixbundle') -Verbose
|
||||
displayName: Stage packages for vpack
|
||||
|
||||
- task: PkgESVPack@12
|
||||
displayName: 'Package ES - VPack'
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
sourceDirectory: '$(Build.SourcesDirectory)/WindowsTerminal.app'
|
||||
description: VPack for the Windows Terminal Application
|
||||
pushPkgName: WindowsTerminal.app
|
||||
owner: conhost
|
||||
githubToken: $(GitHubTokenForVpackProvenance)
|
||||
|
||||
- ${{ if eq(parameters.publishArtifacts, true) }}:
|
||||
- publish: $(JobOutputDirectory)
|
||||
artifact: $(JobOutputArtifactName)
|
||||
displayName: 'Publish VPack Manifest to Drop'
|
||||
|
||||
- task: PkgESFCIBGit@12
|
||||
displayName: 'Submit VPack Manifest to Windows'
|
||||
inputs:
|
||||
configPath: '$(Build.SourcesDirectory)\build\config\GitCheckin.json'
|
||||
artifactsDirectory: $(XES_VPACKMANIFESTDIRECTORY)
|
||||
prTimeOut: 5
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
# This build should never run as CI or against a pull request.
|
||||
trigger: none
|
||||
|
||||
parameters:
|
||||
- name: branding
|
||||
type: string
|
||||
default: Release
|
||||
- name: buildTerminal
|
||||
type: boolean
|
||||
default: true
|
||||
- name: buildConPTY
|
||||
type: boolean
|
||||
default: false
|
||||
- name: buildWPF
|
||||
type: boolean
|
||||
default: false
|
||||
- name: pgoBuildMode
|
||||
type: string
|
||||
default: Optimize
|
||||
values:
|
||||
- Optimize
|
||||
- Instrument
|
||||
- None
|
||||
- name: buildConfigurations
|
||||
type: object
|
||||
default:
|
||||
- Release
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
default:
|
||||
- x64
|
||||
- x86
|
||||
- arm64
|
||||
- name: codeSign
|
||||
type: boolean
|
||||
default: true
|
||||
- name: generateSbom
|
||||
type: boolean
|
||||
default: true
|
||||
- name: terminalInternalPackageVersion
|
||||
type: string
|
||||
default: '0.0.8'
|
||||
|
||||
- name: publishSymbolsToPublic
|
||||
type: boolean
|
||||
default: true
|
||||
- name: symbolExpiryTime
|
||||
type: string
|
||||
default: 36530 # This is the default from PublishSymbols@2
|
||||
- name: publishVpackToWindows
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
- name: pool
|
||||
type: object
|
||||
default:
|
||||
name: SHINE-INT-S # By default, send jobs to the small agent pool.
|
||||
demands: ImageOverride -equals SHINE-VS17-Latest
|
||||
|
||||
variables:
|
||||
# If we are building a branch called "release-*", change the NuGet suffix
|
||||
# to "preview". If we don't do that, XES will set the suffix to "release1"
|
||||
# because it truncates the value after the first period.
|
||||
# We also want to disable the suffix entirely if we're Release branded while
|
||||
# on a release branch.
|
||||
# main is special, however. XES ignores main. Since we never produce actual
|
||||
# shipping builds from main, we want to force it to have a beta label as
|
||||
# well.
|
||||
#
|
||||
# In effect:
|
||||
# BRANCH / BRANDING | Release | Preview
|
||||
# ------------------|----------------------------|-----------------------------
|
||||
# release-* | 1.12.20220427 | 1.13.20220427-preview
|
||||
# main | 1.14.20220427-experimental | 1.14.20220427-experimental
|
||||
# all others | 1.14.20220427-mybranch | 1.14.20220427-mybranch
|
||||
${{ if startsWith(variables['Build.SourceBranchName'], 'release-') }}:
|
||||
${{ if eq(parameters.branding, 'Release') }}:
|
||||
NoNuGetPackBetaVersion: true
|
||||
${{ else }}:
|
||||
NuGetPackBetaVersion: preview
|
||||
${{ elseif eq(variables['Build.SourceBranchName'], 'main') }}:
|
||||
NuGetPackBetaVersion: experimental
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: self
|
||||
type: git
|
||||
ref: main
|
||||
|
||||
stages:
|
||||
- stage: Build
|
||||
displayName: Build
|
||||
pool: ${{ parameters.pool }}
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: ./job-build-project.yml
|
||||
parameters:
|
||||
pool:
|
||||
name: SHINE-INT-L # Run the compilation on the large agent pool, rather than the default small one.
|
||||
demands: ImageOverride -equals SHINE-VS17-Latest
|
||||
branding: ${{ parameters.branding }}
|
||||
buildTerminal: ${{ parameters.buildTerminal }}
|
||||
buildConPTY: ${{ parameters.buildConPTY }}
|
||||
buildWPF: ${{ parameters.buildWPF }}
|
||||
pgoBuildMode: ${{ parameters.pgoBuildMode }}
|
||||
buildConfigurations: ${{ parameters.buildConfigurations }}
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
generateSbom: ${{ parameters.generateSbom }}
|
||||
codeSign: ${{ parameters.codeSign }}
|
||||
beforeBuildSteps: # Right before we build, lay down the universal package and localizations
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
|
||||
- task: UniversalPackages@0
|
||||
displayName: Download terminal-internal Universal Package
|
||||
inputs:
|
||||
feedListDownload: 2b3f8893-a6e8-411f-b197-a9e05576da48
|
||||
packageListDownload: e82d490c-af86-4733-9dc4-07b772033204
|
||||
versionListDownload: ${{ parameters.terminalInternalPackageVersion }}
|
||||
|
||||
- template: ./steps-fetch-and-prepare-localizations.yml
|
||||
parameters:
|
||||
includePseudoLoc: true
|
||||
|
||||
- ${{ if eq(parameters.buildWPF, true) }}:
|
||||
# Add an Any CPU build flavor for the WPF control bits
|
||||
- template: ./job-build-project.yml
|
||||
parameters:
|
||||
# This job is allowed to run on the default small pool.
|
||||
jobName: BuildWPF
|
||||
branding: ${{ parameters.branding }}
|
||||
buildTerminal: false
|
||||
buildWPFDotNetComponents: true
|
||||
buildConfigurations: ${{ parameters.buildConfigurations }}
|
||||
buildPlatforms:
|
||||
- Any CPU
|
||||
generateSbom: ${{ parameters.generateSbom }}
|
||||
codeSign: ${{ parameters.codeSign }}
|
||||
beforeBuildSteps:
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
# WPF doesn't need the localizations or the universal package, but if it does... put them here.
|
||||
|
||||
- stage: Package
|
||||
displayName: Package
|
||||
pool: ${{ parameters.pool }}
|
||||
dependsOn: [Build]
|
||||
jobs:
|
||||
- ${{ if eq(parameters.buildTerminal, true) }}:
|
||||
- template: ./job-merge-msix-into-bundle.yml
|
||||
parameters:
|
||||
jobName: Bundle
|
||||
branding: ${{ parameters.branding }}
|
||||
buildConfigurations: ${{ parameters.buildConfigurations }}
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
generateSbom: ${{ parameters.generateSbom }}
|
||||
codeSign: ${{ parameters.codeSign }}
|
||||
|
||||
- ${{ if eq(parameters.buildConPTY, true) }}:
|
||||
- template: ./job-package-conpty.yml
|
||||
parameters:
|
||||
buildConfigurations: ${{ parameters.buildConfigurations }}
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
generateSbom: ${{ parameters.generateSbom }}
|
||||
codeSign: ${{ parameters.codeSign }}
|
||||
|
||||
- ${{ if eq(parameters.buildWPF, true) }}:
|
||||
- template: ./job-build-package-wpf.yml
|
||||
parameters:
|
||||
buildConfigurations: ${{ parameters.buildConfigurations }}
|
||||
buildPlatforms: ${{ parameters.buildPlatforms }}
|
||||
generateSbom: ${{ parameters.generateSbom }}
|
||||
codeSign: ${{ parameters.codeSign }}
|
||||
|
||||
- stage: Publish
|
||||
displayName: Publish
|
||||
pool: ${{ parameters.pool }}
|
||||
dependsOn: [Build, Package]
|
||||
jobs:
|
||||
# We only support the vpack for Release builds that include Terminal
|
||||
- ${{ if and(containsValue(parameters.buildConfigurations, 'Release'), parameters.buildTerminal, parameters.publishVpackToWindows) }}:
|
||||
- template: ./job-submit-windows-vpack.yml
|
||||
parameters:
|
||||
buildConfiguration: Release
|
||||
generateSbom: ${{ parameters.generateSbom }}
|
||||
|
||||
- template: ./job-publish-symbols.yml
|
||||
parameters:
|
||||
includePublicSymbolServer: ${{ parameters.publishSymbolsToPublic }}
|
||||
symbolExpiryTime: ${{ parameters.symbolExpiryTime }}
|
||||
|
||||
...
|
||||
@@ -1,35 +0,0 @@
|
||||
parameters:
|
||||
- name: stage
|
||||
type: string
|
||||
- name: outFile
|
||||
type: string
|
||||
- name: fragments
|
||||
type: string
|
||||
|
||||
# This build step template takes all files named "esrp.STAGE.batch.*.json"
|
||||
# and merges them into a single output signing config.
|
||||
#
|
||||
# We generate the batch signing config by sticking together multiple "batches".
|
||||
# The filter below (with Fragments) works by splitting the filename, esrp.s.batch.x.json,
|
||||
# to get 'x' and then checking whether x is in Fragments.
|
||||
# We have to manually strip comments out of the batch fragments due to https://github.com/PowerShell/PowerShell/issues/14553
|
||||
|
||||
steps:
|
||||
- pwsh: |-
|
||||
$SignBatchFiles = (Get-Item build/config/esrp.${{ parameters.stage }}.batch.*.json)
|
||||
$Fragments = "${{ parameters.fragments }}"
|
||||
If (-Not [String]::IsNullOrWhiteSpace($Fragments)) {
|
||||
$FragmentList = $Fragments -Split ";"
|
||||
If ($FragmentList.Length -Gt 0) {
|
||||
$SignBatchFiles = $SignBatchFiles | Where-Object { ($_.Name -Split '\.')[3] -In $FragmentList }
|
||||
}
|
||||
}
|
||||
Write-Host "Found $(@($SignBatchFiles).Length) Signing Configs"
|
||||
Write-Host ($SignBatchFiles.Name -Join ";")
|
||||
$FinalSignConfig = @{
|
||||
Version = "1.0.0";
|
||||
UseMinimatch = $false;
|
||||
SignBatches = @($SignBatchFiles | ForEach-Object { Get-Content $_ | Where-Object { $_ -NotMatch "^\s*\/\/" } | ConvertFrom-Json -Depth 10 });
|
||||
}
|
||||
$FinalSignConfig | ConvertTo-Json -Depth 10 | Out-File -Encoding utf8 "${{ parameters.outFile }}"
|
||||
displayName: Merge ${{ parameters.stage }} signing configs (${{ parameters.outFile }})
|
||||
@@ -1,24 +0,0 @@
|
||||
parameters:
|
||||
- name: buildConfigurations
|
||||
type: object
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
- name: artifactStem
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
steps:
|
||||
- ${{ each configuration in parameters.buildConfigurations }}:
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download artifacts for ${{ platform }} ${{ configuration }}
|
||||
inputs:
|
||||
# Make sure to download the entire artifact, because it includes the SPDX SBOM
|
||||
artifactName: build-${{ platform }}-${{ configuration }}${{ parameters.artifactStem }}
|
||||
# Downloading to the source directory should ensure that the later SBOM generator can see the earlier SBOMs.
|
||||
${{ if eq(platform, 'x86') }}:
|
||||
downloadPath: '$(Build.SourcesDirectory)/bin/Win32/${{ configuration }}'
|
||||
${{ elseif eq(platform, 'Any CPU') }}:
|
||||
downloadPath: '$(Build.SourcesDirectory)/bin/AnyCPU/${{ configuration }}'
|
||||
${{ else }}:
|
||||
downloadPath: '$(Build.SourcesDirectory)/bin/${{ platform }}/${{ configuration }}'
|
||||
@@ -1,5 +0,0 @@
|
||||
steps:
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: Use NuGet 6.6.1
|
||||
inputs:
|
||||
versionSpec: 6.6.1
|
||||
@@ -1,27 +0,0 @@
|
||||
parameters:
|
||||
- name: includePseudoLoc
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
steps:
|
||||
- task: TouchdownBuildTask@1
|
||||
displayName: Download Localization Files
|
||||
inputs:
|
||||
teamId: 7105
|
||||
authId: $(TouchdownAppId)
|
||||
authKey: $(TouchdownAppKey)
|
||||
resourceFilePath: |
|
||||
src\cascadia\**\en-US\*.resw
|
||||
appendRelativeDir: true
|
||||
localizationTarget: false
|
||||
${{ if eq(parameters.includePseudoLoc, true) }}:
|
||||
pseudoSetting: Included
|
||||
|
||||
- pwsh: |-
|
||||
$Files = Get-ChildItem . -R -Filter 'Resources.resw' | ? FullName -Like '*en-US\*\Resources.resw'
|
||||
$Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore }
|
||||
displayName: Move Loc files into final locations
|
||||
|
||||
- pwsh: |-
|
||||
./build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
|
||||
displayName: Copy the Context Menu Loc Resources to CascadiaPackage
|
||||
34
build/pipelines/templates/build-console-audit-job.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
parameters:
|
||||
platform: ''
|
||||
additionalBuildArguments: ''
|
||||
|
||||
jobs:
|
||||
- job: Build${{ parameters.platform }}AuditMode
|
||||
displayName: Static Analysis Build ${{ parameters.platform }}
|
||||
variables:
|
||||
BuildConfiguration: AuditMode
|
||||
BuildPlatform: ${{ parameters.platform }}
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPoolOSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPool-L
|
||||
demands: ImageOverride -equals WinDevVS17-latest
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: true
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
|
||||
- template: restore-nuget-steps.yml
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build solution **\OpenConsole.sln'
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: ${{ parameters.additionalBuildArguments }}
|
||||
clean: true
|
||||
maximumCpuCount: true
|
||||
31
build/pipelines/templates/build-console-ci.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
parameters:
|
||||
configuration: 'Release'
|
||||
branding: 'Dev'
|
||||
platform: ''
|
||||
additionalBuildArguments: ''
|
||||
|
||||
jobs:
|
||||
- job: Build${{ parameters.platform }}${{ parameters.configuration }}${{ parameters.branding }}
|
||||
displayName: Build ${{ parameters.platform }} ${{ parameters.configuration }} ${{ parameters.branding }}
|
||||
variables:
|
||||
BuildConfiguration: ${{ parameters.configuration }}
|
||||
BuildPlatform: ${{ parameters.platform }}
|
||||
WindowsTerminalBranding: ${{ parameters.branding }}
|
||||
EnableRichCodeNavigation: true
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPoolOSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPool-L
|
||||
demands: ImageOverride -equals WinDevVS17-latest
|
||||
|
||||
steps:
|
||||
- template: build-console-steps.yml
|
||||
parameters:
|
||||
additionalBuildArguments: ${{ parameters.additionalBuildArguments }}
|
||||
|
||||
# It appears that the Component Governance build task that gets automatically injected stopped working
|
||||
# when we renamed our main branch.
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: 'Component Detection'
|
||||
condition: and(succeededOrFailed(), not(eq(variables['Build.Reason'], 'PullRequest')))
|
||||
203
build/pipelines/templates/build-console-compliance-job.yml
Normal file
@@ -0,0 +1,203 @@
|
||||
jobs:
|
||||
- job: Compliance
|
||||
# We don't *need* a matrix but there's no other way to set parameters on a "job"
|
||||
# in the AzDO YAML syntax. It would have to be a "stage" or a "template".
|
||||
# Doesn't matter. We're going to do compliance on Release x64 because
|
||||
# that's the one all the tooling works against for sure.
|
||||
strategy:
|
||||
matrix:
|
||||
Release_x64:
|
||||
BuildConfiguration: Release
|
||||
BuildPlatform: x64
|
||||
displayName: Validate Security and Compliance
|
||||
timeoutInMinutes: 240
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
- task: PkgESSetupBuild@12
|
||||
displayName: Package ES - Setup Build
|
||||
inputs:
|
||||
disableOutputRedirect: true
|
||||
- task: PowerShell@2
|
||||
displayName: Rationalize Build Platform
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$Arch = "$(BuildPlatform)"
|
||||
|
||||
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
||||
|
||||
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
||||
- template: restore-nuget-steps.yml
|
||||
- task: UniversalPackages@0
|
||||
displayName: Download terminal-internal Universal Package
|
||||
inputs:
|
||||
feedListDownload: 2b3f8893-a6e8-411f-b197-a9e05576da48
|
||||
packageListDownload: e82d490c-af86-4733-9dc4-07b772033204
|
||||
versionListDownload: $(TerminalInternalPackageVersion)
|
||||
- task: TouchdownBuildTask@1
|
||||
displayName: Download Localization Files
|
||||
inputs:
|
||||
teamId: 7105
|
||||
authId: $(TouchdownAppId)
|
||||
authKey: $(TouchdownAppKey)
|
||||
resourceFilePath: >-
|
||||
src\cascadia\TerminalApp\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalControl\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalConnection\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalSettingsModel\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\TerminalSettingsEditor\Resources\en-US\Resources.resw
|
||||
|
||||
src\cascadia\CascadiaPackage\Resources\en-US\Resources.resw
|
||||
appendRelativeDir: true
|
||||
localizationTarget: false
|
||||
pseudoSetting: Included
|
||||
- task: PowerShell@2
|
||||
displayName: Move Loc files one level up
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: >-
|
||||
$Files = Get-ChildItem . -R -Filter 'Resources.resw' | ? FullName -Like '*en-US\*\Resources.resw'
|
||||
|
||||
$Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore }
|
||||
pwsh: true
|
||||
|
||||
# 1ES Component Governance onboarding (Detects open source components). See https://docs.opensource.microsoft.com/tools/cg.html
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: Component Detection
|
||||
|
||||
# # PREfast and PoliCheck need Node. Install that first.
|
||||
- task: NodeTool@0
|
||||
|
||||
# !!! NOTE !!! Run PREfast first. Some of the other tasks are going to run on a completed build.
|
||||
# PREfast is going to build the code as a part of its analysis and the generated sources
|
||||
# and output binaries will be sufficient for the rest of the analysis.
|
||||
# If you disable this, the other tasks won't likely work. You would have to add a build
|
||||
# step instead that builds the code normally before calling them.
|
||||
# Also... PREfast will rebuild anyway so that's why we're not running a normal build first.
|
||||
# Waste of time to build twice.
|
||||
# PREfast. See https://www.1eswiki.com/wiki/SDL_Native_Rules_Build_Task
|
||||
|
||||
# The following 1ES tasks all operate completely differently and have a different syntax for usage.
|
||||
# Most notable is every one of them has a different way of excluding things.
|
||||
# Go see their 1eswiki.com pages to figure out how to exclude things.
|
||||
# When writing exclusions, try to make them narrow so when new projects/binaries are added, they
|
||||
# cause an error here and have to be explicitly pulled out. Don't write an exclusion so broad
|
||||
# that it will catch other new stuff.
|
||||
|
||||
# https://www.1eswiki.com/wiki/PREfast_Build_Task
|
||||
# Builds the project with C/C++ static analysis tools to find coding flaws and vulnerabilities
|
||||
# !!! WARNING !!! It doesn't work with WAPPROJ packaging projects. Build the sub-projects instead.
|
||||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-prefast.SDLNativeRules@3
|
||||
displayName: 'Run the PREfast SDL Native Rules for MSBuild'
|
||||
condition: succeededOrFailed()
|
||||
inputs:
|
||||
setupCommandlines: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat"'
|
||||
msBuildCommandline: msbuild.exe /nologo /m /p:WindowsTerminalOfficialBuild=true /p:WindowsTerminalBranding=${{ parameters.branding }} /p:WindowsTerminalReleaseBuild=true /p:platform=$(BuildPlatform) /p:configuration=$(BuildConfiguration) /t:Terminal\Window\WindowsTerminal /p:VisualStudioVersion=17.0 $(Build.SourcesDirectory)\OpenConsole.sln
|
||||
msBuildVersion: "17.0"
|
||||
|
||||
# Copies output from PREfast SDL Native Rules task to expected location for consumption by PkgESSecComp
|
||||
- task: CopyFiles@1
|
||||
displayName: 'Copy PREfast xml files to SDLNativeRulesDir'
|
||||
inputs:
|
||||
SourceFolder: '$(Agent.BuildDirectory)'
|
||||
Contents: |
|
||||
**\*.nativecodeanalysis.xml
|
||||
TargetFolder: '$(Agent.BuildDirectory)\_sdt\logs\SDLNativeRules'
|
||||
|
||||
# https://www.1eswiki.com/index.php?title=PoliCheck_Build_Task
|
||||
# Scans the text of source code, comments, and content for terminology that could be sensitive for legal, cultural, or geopolitical reasons.
|
||||
# (Also finds vulgarities... takes all the fun out of everything.)
|
||||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@2
|
||||
displayName: 'Run PoliCheck'
|
||||
inputs:
|
||||
targetType: F
|
||||
targetArgument: $(Build.SourcesDirectory)
|
||||
result: PoliCheck.xml
|
||||
optionsFC: 1
|
||||
optionsXS: 1
|
||||
optionsUEPath: $(Build.SourcesDirectory)\build\config\PolicheckExclusions.xml
|
||||
optionsHMENABLE: 0
|
||||
continueOnError: true
|
||||
|
||||
# https://www.1eswiki.com/wiki/CredScan_Azure_DevOps_Build_Task
|
||||
# Searches through source code and build outputs for a credential left behind in the open
|
||||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3
|
||||
displayName: 'Run CredScan'
|
||||
inputs:
|
||||
outputFormat: pre
|
||||
# suppressionsFile: LocalSuppressions.json
|
||||
batchSize: 20
|
||||
debugMode: false
|
||||
continueOnError: true
|
||||
|
||||
# https://www.1eswiki.com/wiki/BinSkim_Build_Task
|
||||
# Searches managed and unmanaged binaries for known security vulnerabilities.
|
||||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@4
|
||||
displayName: 'Run BinSkim'
|
||||
inputs:
|
||||
TargetPattern: guardianGlob
|
||||
# See https://aka.ms/gdn-globs for how to do match patterns
|
||||
AnalyzeTargetGlob: $(Build.SourcesDirectory)\bin\**\*.dll;$(Build.SourcesDirectory)\bin\**\*.exe;-:file|**\Microsoft.UI.Xaml.dll;-:file|**\Microsoft.Toolkit.Win32.UI.XamlHost.dll;-:file|**\vcruntime*.dll;-:file|**\vcomp*.dll;-:file|**\vccorlib*.dll;-:file|**\vcamp*.dll;-:file|**\msvcp*.dll;-:file|**\concrt*.dll;-:file|**\TerminalThemeHelpers*.dll
|
||||
continueOnError: true
|
||||
|
||||
# Set XES_SERIALPOSTBUILDREADY to run Security and Compliance task once per build
|
||||
- powershell: Write-Host "##vso[task.setvariable variable=XES_SERIALPOSTBUILDREADY;]true"
|
||||
displayName: 'Set XES_SERIALPOSTBUILDREADY Vars'
|
||||
|
||||
# https://www.osgwiki.com/wiki/Package_ES_Security_and_Compliance
|
||||
# Does a few things:
|
||||
# - Ensures that Windows-required compliance tasks are run either inside this task
|
||||
# or were run as a previous step prior to this one
|
||||
# (PREfast, PoliCheck, Credscan)
|
||||
# - Runs Windows-specific compliance tasks inside the task
|
||||
# + CheckCFlags - ensures that compiler and linker flags meet Windows standards
|
||||
# + CFGCheck/XFGCheck - ensures that Control Flow Guard (CFG) or
|
||||
# eXtended Flow Guard (XFG) are enabled on binaries
|
||||
# NOTE: CFG is deprecated and XFG isn't fully ready yet.
|
||||
# NOTE2: CFG fails on an XFG'd binary
|
||||
# - Brokers all security/compliance task logs to "Trust Services Automation (TSA)" (https://aka.ms/tsa)
|
||||
# which is a system that maps all errors into the appropriate bug database
|
||||
# template for each organization since they all vary. It should also suppress
|
||||
# new bugs when one already exists for the product.
|
||||
# This one is set up to go to the OS repository and use the given parameters
|
||||
# to file bugs to our AzDO product path.
|
||||
# If we don't use PkgESSecComp to do this for us, we need to install the TSA task
|
||||
# ourselves in this pipeline to finalize data upload and bug creation.
|
||||
# !!! NOTE !!! This task goes *LAST* after any other compliance tasks so it catches their logs
|
||||
- task: PkgESSecComp@10
|
||||
displayName: 'Security and Compliance tasks'
|
||||
inputs:
|
||||
fileNewBugs: false
|
||||
areaPath: 'OS\WDX\DXP\WinDev\Terminal'
|
||||
teamProject: 'OS'
|
||||
iterationPath: 'OS\Future'
|
||||
bugTags: 'TerminalReleaseCompliance'
|
||||
scanAll: true
|
||||
errOnBugs: false
|
||||
failOnStdErr: true
|
||||
taskLogVerbosity: Diagnostic
|
||||
secCompConfigFromTask: |
|
||||
# Overrides default build sources directory
|
||||
sourceTargetOverrideAll: $(Build.SourcesDirectory)
|
||||
# Overrides default build binaries directory when "Scan all" option is specified
|
||||
binariesTargetOverrideAll: $(Build.SourcesDirectory)\bin
|
||||
|
||||
# Set the tools to false if they should not run in the build
|
||||
tools:
|
||||
- toolName: CheckCFlags
|
||||
enable: true
|
||||
- toolName: CFGCheck
|
||||
enable: true
|
||||
- toolName: Policheck
|
||||
enable: false
|
||||
- toolName: CredScan
|
||||
enable: false
|
||||
- toolName: XFGCheck
|
||||
enable: false
|
||||
90
build/pipelines/templates/build-console-fuzzing.yml
Normal file
@@ -0,0 +1,90 @@
|
||||
parameters:
|
||||
configuration: 'Fuzzing'
|
||||
platform: ''
|
||||
additionalBuildArguments: ''
|
||||
|
||||
jobs:
|
||||
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||
displayName: Build ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||
variables:
|
||||
BuildConfiguration: ${{ parameters.configuration }}
|
||||
BuildPlatform: ${{ parameters.platform }}
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPoolOSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPool-L
|
||||
demands: ImageOverride -equals WinDevVS17-latest
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: true
|
||||
clean: true
|
||||
|
||||
- template: restore-nuget-steps.yml
|
||||
|
||||
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
|
||||
- script: |
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
|
||||
set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt
|
||||
del %TEMP%\vsinstalldir.txt
|
||||
call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat"
|
||||
echo VCToolsInstallDir = %VCToolsInstallDir%
|
||||
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
|
||||
displayName: 'Retrieve VC tools directory'
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build solution **\OpenConsole.sln'
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: "${{ parameters.additionalBuildArguments }}"
|
||||
clean: true
|
||||
maximumCpuCount: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Rationalize build platform'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
$Arch = "$(BuildPlatform)"
|
||||
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
||||
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy result logs to Artifacts'
|
||||
inputs:
|
||||
Contents: |
|
||||
**/*.wtl
|
||||
**/*onBuildMachineResults.xml
|
||||
${{ parameters.testLogPath }}
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test'
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy outputs needed for test runs to Artifacts'
|
||||
inputs:
|
||||
Contents: |
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.exe
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.dll
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.xml
|
||||
**/Microsoft.VCLibs.*.appx
|
||||
**/TestHostApp/*.exe
|
||||
**/TestHostApp/*.dll
|
||||
**/TestHostApp/*.xml
|
||||
!**/*.pdb
|
||||
!**/*.ipdb
|
||||
!**/*.obj
|
||||
!**/*.pch
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test'
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
condition: succeeded()
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish All Build Artifacts'
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
ArtifactName: 'fuzzingBuildOutput'
|
||||
55
build/pipelines/templates/build-console-pgo.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
parameters:
|
||||
configuration: 'Release'
|
||||
platform: ''
|
||||
additionalBuildArguments: ''
|
||||
minimumExpectedTestsExecutedCount: 1 # Sanity check for minimum expected tests to be reported
|
||||
rerunPassesRequiredToAvoidFailure: 5
|
||||
|
||||
jobs:
|
||||
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||
displayName: Build ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||
variables:
|
||||
BuildConfiguration: ${{ parameters.configuration }}
|
||||
BuildPlatform: ${{ parameters.platform }}
|
||||
PGOBuildMode: 'Instrument'
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPoolOSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
name: WinDevPool-L
|
||||
demands: ImageOverride -equals WinDevVS17-latest
|
||||
|
||||
steps:
|
||||
- template: build-console-steps.yml
|
||||
parameters:
|
||||
additionalBuildArguments: '${{ parameters.additionalBuildArguments }}'
|
||||
|
||||
- template: helix-runtests-job.yml
|
||||
parameters:
|
||||
name: 'RunTestsInHelix'
|
||||
dependsOn: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||
condition: succeeded()
|
||||
testSuite: 'PgoInstrumentationSuite'
|
||||
taefQuery: '@IsPgo=true'
|
||||
configuration: ${{ parameters.configuration }}
|
||||
platform: ${{ parameters.platform }}
|
||||
rerunPassesRequiredToAvoidFailure: ${{ parameters.rerunPassesRequiredToAvoidFailure }}
|
||||
|
||||
- template: helix-processtestresults-job.yml
|
||||
parameters:
|
||||
name: 'ProcessTestResults'
|
||||
pgoArtifact: 'PGO'
|
||||
dependsOn:
|
||||
- RunTestsInHelix
|
||||
condition: succeededOrFailed()
|
||||
rerunPassesRequiredToAvoidFailure: ${{ parameters.rerunPassesRequiredToAvoidFailure }}
|
||||
minimumExpectedTestsExecutedCount: ${{ parameters.minimumExpectedTestsExecutedCount }}
|
||||
|
||||
- template: pgo-merge-pgd-job.yml
|
||||
parameters:
|
||||
name: 'MergePGD'
|
||||
dependsOn:
|
||||
- ProcessTestResults
|
||||
pgoArtifact: 'PGO'
|
||||
platform: ${{ parameters.platform }}
|
||||
configuration: ${{ parameters.configuration }}
|
||||
137
build/pipelines/templates/build-console-steps.yml
Normal file
@@ -0,0 +1,137 @@
|
||||
parameters:
|
||||
additionalBuildArguments: ''
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: true
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
|
||||
- template: restore-nuget-steps.yml
|
||||
|
||||
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
|
||||
- script: |
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
|
||||
set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt
|
||||
del %TEMP%\vsinstalldir.txt
|
||||
call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat"
|
||||
echo VCToolsInstallDir = %VCToolsInstallDir%
|
||||
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
|
||||
displayName: 'Retrieve VC tools directory'
|
||||
|
||||
- task: CmdLine@1
|
||||
displayName: 'Display build machine environment variables'
|
||||
inputs:
|
||||
filename: 'set'
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build solution **\OpenConsole.sln'
|
||||
inputs:
|
||||
solution: '**\OpenConsole.sln'
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: "${{ parameters.additionalBuildArguments }} /p:PGOBuildMode=$(PGOBuildMode) /bl:$(Build.SourcesDirectory)\\msbuild.binlog"
|
||||
clean: true
|
||||
maximumCpuCount: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Check MSIX for common regressions'
|
||||
# PGO runtime needs its own CRT and it's in the package for convenience.
|
||||
# That will make this script mad so skip since we're not shipping the PGO Instrumentation one anyway.
|
||||
condition: ne(variables['PGOBuildMode'], 'Instrument')
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
$Package = Get-ChildItem -Recurse -Filter "CascadiaPackage_*.msix"
|
||||
.\build\scripts\Test-WindowsTerminalPackage.ps1 -Verbose -Path $Package.FullName
|
||||
|
||||
- task: powershell@2
|
||||
displayName: 'Source Index PDBs'
|
||||
condition: ne(variables['PGOBuildMode'], 'Instrument')
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\scripts\Index-Pdbs.ps1
|
||||
arguments: -SearchDir '$(Build.SourcesDirectory)' -SourceRoot '$(Build.SourcesDirectory)' -recursive -Verbose -CommitId $(Build.SourceVersion)
|
||||
errorActionPreference: silentlyContinue
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Rationalize build platform'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
$Arch = "$(BuildPlatform)"
|
||||
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
||||
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy *.msix to Artifacts'
|
||||
inputs:
|
||||
Contents: |
|
||||
**/*.msix
|
||||
**/*.appxsym
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/appx'
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
|
||||
- pwsh: |-
|
||||
$TerminalMsixPath = (Get-Item "$(Build.ArtifactStagingDirectory)\appx\Cascadia*.msix").FullName
|
||||
$XamlAppxPath = (Get-Item "src\cascadia\CascadiaPackage\AppPackages\*\Dependencies\$(BuildPlatform)\Microsoft.UI.Xaml*.appx").FullName
|
||||
& .\build\scripts\New-UnpackagedTerminalDistribution.ps1 -TerminalAppX $TerminalMsixPath -XamlAppX $XamlAppxPath -Destination "$(Build.ArtifactStagingDirectory)/unpackaged"
|
||||
displayName: Build Unpackaged Distribution
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)/unpackaged
|
||||
artifact: unpackaged-$(BuildPlatform)-$(BuildConfiguration)
|
||||
displayName: Publish Artifact (unpackaged)
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy outputs needed for test runs to Artifacts'
|
||||
inputs:
|
||||
Contents: |
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.exe
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.dll
|
||||
$(Build.SourcesDirectory)/bin/$(RationalizedBuildPlatform)/$(BuildConfiguration)/*.xml
|
||||
**/Microsoft.VCLibs.*.appx
|
||||
**/*unit.test*.dll
|
||||
**/*unit.test*.manifest
|
||||
**/TestHostApp/*.exe
|
||||
**/TestHostApp/*.dll
|
||||
**/TestHostApp/*.xml
|
||||
!**/*.pdb
|
||||
!**/*.ipdb
|
||||
!**/*.obj
|
||||
!**/*.pch
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test'
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
condition: succeeded()
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish All Build Artifacts'
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
ArtifactName: 'drop'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy PGO databases needed for PGO instrumentation run'
|
||||
inputs:
|
||||
Contents: |
|
||||
**/*.pgd
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/PGO/$(BuildPlatform)'
|
||||
OverWrite: true
|
||||
flattenFolders: true
|
||||
condition: and(succeeded(), eq(variables['PGOBuildMode'], 'Instrument'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish All PGO Artifacts'
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/PGO'
|
||||
ArtifactName: 'PGO'
|
||||
condition: and(succeeded(), eq(variables['PGOBuildMode'], 'Instrument'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: binlog'
|
||||
condition: always()
|
||||
continueOnError: True
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)\msbuild.binlog
|
||||
ArtifactName: binlog-$(BuildPlatform)
|
||||
17
build/pipelines/templates/check-formatting.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
jobs:
|
||||
- job: CodeFormatCheck
|
||||
displayName: Proper Code Formatting Check
|
||||
pool: { vmImage: windows-2022 }
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: 1
|
||||
submodules: false
|
||||
clean: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Code Formatting Check'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: '.\build\scripts\Invoke-FormattingCheck.ps1'
|
||||
@@ -1,15 +1,21 @@
|
||||
parameters:
|
||||
artifactName: 'drop'
|
||||
|
||||
jobs:
|
||||
- job: CodeNavIndexer
|
||||
displayName: Run Github CodeNav Indexer
|
||||
pool: { vmImage: windows-2022 }
|
||||
pool: { vmImage: windows-2019 }
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: 1
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
submodules: false
|
||||
clean: true
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
inputs:
|
||||
artifactName: ${{ parameters.artifactName }}
|
||||
|
||||
- task: RichCodeNavIndexer@0
|
||||
inputs:
|
||||
languages: 'cpp,csharp'
|
||||
25
build/pipelines/templates/console-ci-helix-job.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
parameters:
|
||||
configuration: 'Release'
|
||||
platform: ''
|
||||
minimumExpectedTestsExecutedCount: 10 # Sanity check for minimum expected tests to be reported
|
||||
rerunPassesRequiredToAvoidFailure: 5
|
||||
|
||||
jobs:
|
||||
- template: helix-runtests-job.yml
|
||||
parameters:
|
||||
name: 'RunTestsInHelix'
|
||||
# We're not setting dependsOn as we want to rely on the "stage" dependency above us
|
||||
testSuite: 'DevTestSuite'
|
||||
platform: ${{ parameters.platform }}
|
||||
configuration: ${{ parameters.configuration }}
|
||||
rerunPassesRequiredToAvoidFailure: ${{ parameters.rerunPassesRequiredToAvoidFailure }}
|
||||
|
||||
- template: helix-processtestresults-job.yml
|
||||
parameters:
|
||||
dependsOn:
|
||||
- RunTestsInHelix
|
||||
# the default condition is succeededOrFailed(), and the "stage" condition ensures we only run as needed
|
||||
platform: ${{ parameters.platform }}
|
||||
configuration: ${{ parameters.configuration }}
|
||||
rerunPassesRequiredToAvoidFailure: ${{ parameters.rerunPassesRequiredToAvoidFailure }}
|
||||
minimumExpectedTestsExecutedCount: ${{ parameters.minimumExpectedTestsExecutedCount }}
|
||||
15
build/pipelines/templates/helix-createprojfile-steps.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
parameters:
|
||||
condition: ''
|
||||
testFilePath: ''
|
||||
outputProjFileName: ''
|
||||
testSuite: ''
|
||||
taefQuery: ''
|
||||
|
||||
steps:
|
||||
- task: powershell@2
|
||||
displayName: 'Create ${{ parameters.outputProjFileName }}'
|
||||
condition: ${{ parameters.condition }}
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\Helix\GenerateTestProjFile.ps1
|
||||
arguments: -TestFile '${{ parameters.testFilePath }}' -OutputProjFile '$(Build.ArtifactStagingDirectory)\$(BuildConfiguration)\$(BuildPlatform)\${{ parameters.outputProjFileName }}' -JobTestSuiteName '${{ parameters.testSuite }}' -TaefPath '$(Build.SourcesDirectory)\build\Helix\packages\Microsoft.Taef.10.60.210621002\build\Binaries\x86' -TaefQuery '${{ parameters.taefQuery }}'
|
||||
71
build/pipelines/templates/helix-processtestresults-job.yml
Normal file
@@ -0,0 +1,71 @@
|
||||
parameters:
|
||||
condition: 'succeededOrFailed()'
|
||||
dependsOn: ''
|
||||
rerunPassesRequiredToAvoidFailure: 5
|
||||
minimumExpectedTestsExecutedCount: 10
|
||||
checkJobAttempt: false
|
||||
pgoArtifact: ''
|
||||
|
||||
jobs:
|
||||
- job: ProcessTestResults
|
||||
displayName: Process Helix Results ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||
condition: ${{ parameters.condition }}
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
timeoutInMinutes: 120
|
||||
variables:
|
||||
helixOutputFolder: $(Build.SourcesDirectory)\HelixOutput
|
||||
|
||||
steps:
|
||||
- task: powershell@2
|
||||
displayName: 'UpdateUnreliableTests.ps1'
|
||||
condition: succeededOrFailed()
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
HelixAccessToken: $(HelixApiAccessToken)
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\Helix\UpdateUnreliableTests.ps1
|
||||
arguments: -RerunPassesRequiredToAvoidFailure '${{ parameters.rerunPassesRequiredToAvoidFailure }}'
|
||||
|
||||
- task: powershell@2
|
||||
displayName: 'OutputTestResults.ps1'
|
||||
condition: succeededOrFailed()
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
HelixAccessToken: $(HelixApiAccessToken)
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\Helix\OutputTestResults.ps1
|
||||
arguments: -MinimumExpectedTestsExecutedCount '${{ parameters.minimumExpectedTestsExecutedCount }}' -CheckJobAttempt $${{ parameters.checkJobAttempt }}
|
||||
|
||||
- task: powershell@2
|
||||
displayName: 'ProcessHelixFiles.ps1'
|
||||
condition: succeededOrFailed()
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
HelixAccessToken: $(HelixApiAccessToken)
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\Helix\ProcessHelixFiles.ps1
|
||||
arguments: -OutputFolder '$(helixOutputFolder)'
|
||||
|
||||
- ${{if ne(parameters.pgoArtifact, '') }}:
|
||||
- script: move /y $(helixOutputFolder)\PGO $(Build.ArtifactStagingDirectory)
|
||||
displayName: 'Move pgc files to PGO artifact'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Helix files'
|
||||
condition: succeededOrFailed()
|
||||
inputs:
|
||||
PathtoPublish: $(helixOutputFolder)
|
||||
artifactName: drop
|
||||
|
||||
- ${{if ne(parameters.pgoArtifact, '') }}:
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish pgc files'
|
||||
condition: succeededOrFailed()
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)\PGO\Release
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
164
build/pipelines/templates/helix-runtests-job.yml
Normal file
@@ -0,0 +1,164 @@
|
||||
parameters:
|
||||
name: 'RunTestsInHelix'
|
||||
dependsOn: ''
|
||||
condition: ''
|
||||
testSuite: ''
|
||||
# If a Pipeline runs this template more than once, this parameter should be unique per build flavor to differentiate the
|
||||
# the different test runs:
|
||||
helixType: 'test/devtest'
|
||||
artifactName: 'drop'
|
||||
maxParallel: 4
|
||||
rerunPassesRequiredToAvoidFailure: 5
|
||||
taefQuery: ''
|
||||
configuration: ''
|
||||
platform: ''
|
||||
# if 'useBuildOutputFromBuildId' is set, we will default to using a build from this pipeline:
|
||||
useBuildOutputFromPipeline: $(System.DefinitionId)
|
||||
openHelixTargetQueues: 'windows.11.amd64.client.open.reunion'
|
||||
closedHelixTargetQueues: 'windows.11.amd64.client.reunion'
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.name }}
|
||||
displayName: Submit Helix ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
condition: ${{ parameters.condition }}
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
timeoutInMinutes: 120
|
||||
strategy:
|
||||
maxParallel: ${{ parameters.maxParallel }}
|
||||
variables:
|
||||
buildConfiguration: ${{ parameters.configuration }}
|
||||
buildPlatform: ${{ parameters.platform }}
|
||||
openHelixTargetQueues: ${{ parameters.openHelixTargetQueues }}
|
||||
closedHelixTargetQueues: ${{ parameters.closedHelixTargetQueues }}
|
||||
artifactsDir: $(Build.SourcesDirectory)\Artifacts
|
||||
taefPath: $(Build.SourcesDirectory)\build\Helix\packages\Microsoft.Taef.10.60.210621002\build\Binaries\$(buildPlatform)
|
||||
helixCommonArgs: '/binaryLogger:$(Build.SourcesDirectory)/${{parameters.name}}.$(buildPlatform).$(buildConfiguration).binlog /p:HelixBuild=$(Build.BuildId).$(buildPlatform).$(buildConfiguration) /p:Platform=$(buildPlatform) /p:Configuration=$(buildConfiguration) /p:HelixType=${{parameters.helixType}} /p:TestSuite=${{parameters.testSuite}} /p:ProjFilesPath=$(Build.ArtifactStagingDirectory) /p:rerunPassesRequiredToAvoidFailure=${{parameters.rerunPassesRequiredToAvoidFailure}}'
|
||||
|
||||
steps:
|
||||
- task: CmdLine@1
|
||||
displayName: 'Display build machine environment variables'
|
||||
inputs:
|
||||
filename: 'set'
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet 6.3.0'
|
||||
inputs:
|
||||
versionSpec: 6.3.0
|
||||
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: 'NuGet restore build/Helix/packages.config'
|
||||
inputs:
|
||||
restoreSolution: build/Helix/packages.config
|
||||
feedsToUse: config
|
||||
nugetConfigPath: nuget.config
|
||||
restoreDirectory: packages
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
condition:
|
||||
and(succeeded(),eq(variables['useBuildOutputFromBuildId'],''))
|
||||
inputs:
|
||||
artifactName: ${{ parameters.artifactName }}
|
||||
downloadPath: '$(artifactsDir)'
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
condition:
|
||||
and(succeeded(),ne(variables['useBuildOutputFromBuildId'],''))
|
||||
inputs:
|
||||
buildType: specific
|
||||
buildVersionToDownload: specific
|
||||
project: $(System.TeamProjectId)
|
||||
pipeline: ${{ parameters.useBuildOutputFromPipeline }}
|
||||
buildId: $(useBuildOutputFromBuildId)
|
||||
artifactName: ${{ parameters.artifactName }}
|
||||
downloadPath: '$(artifactsDir)'
|
||||
|
||||
- task: CmdLine@1
|
||||
displayName: 'Display Artifact Directory payload contents'
|
||||
inputs:
|
||||
filename: 'dir'
|
||||
arguments: '/s $(artifactsDir)'
|
||||
|
||||
- task: powershell@2
|
||||
displayName: 'PrepareHelixPayload.ps1'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\Helix\PrepareHelixPayload.ps1
|
||||
arguments: -Platform '$(buildPlatform)' -Configuration '$(buildConfiguration)' -ArtifactName '${{ parameters.artifactName }}'
|
||||
|
||||
- task: CmdLine@1
|
||||
displayName: 'Display Helix payload contents'
|
||||
inputs:
|
||||
filename: 'dir'
|
||||
arguments: '/s $(Build.SourcesDirectory)\HelixPayload'
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Make artifact directories'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
New-Item -ItemType Directory -Force -Path "$(Build.ArtifactStagingDirectory)\$(BuildConfiguration)\"
|
||||
New-Item -ItemType Directory -Force -Path "$(Build.ArtifactStagingDirectory)\$(BuildConfiguration)\$(BuildPlatform)\"
|
||||
|
||||
- template: helix-createprojfile-steps.yml
|
||||
parameters:
|
||||
condition: and(succeeded(),eq('${{ parameters.testSuite }}','DevTestSuite'))
|
||||
testFilePath: '$(artifactsDir)\${{ parameters.artifactName }}\$(buildConfiguration)\$(buildPlatform)\Test\TerminalApp.LocalTests.dll'
|
||||
outputProjFileName: 'RunTestsInHelix-TerminalAppLocalTests.proj'
|
||||
testSuite: '${{ parameters.testSuite }}'
|
||||
taefQuery: ${{ parameters.taefQuery }}
|
||||
|
||||
- template: helix-createprojfile-steps.yml
|
||||
parameters:
|
||||
condition: and(succeeded(),eq('${{ parameters.testSuite }}','DevTestSuite'))
|
||||
testFilePath: '$(artifactsDir)\${{ parameters.artifactName }}\$(buildConfiguration)\$(buildPlatform)\Test\SettingsModel.LocalTests.dll'
|
||||
outputProjFileName: 'RunTestsInHelix-SettingsModelLocalTests.proj'
|
||||
testSuite: '${{ parameters.testSuite }}'
|
||||
taefQuery: ${{ parameters.taefQuery }}
|
||||
|
||||
|
||||
- template: helix-createprojfile-steps.yml
|
||||
parameters:
|
||||
condition: and(succeeded(),eq('${{ parameters.testSuite }}','DevTestSuite'))
|
||||
testFilePath: '$(artifactsDir)\${{ parameters.artifactName }}\$(buildConfiguration)\$(buildPlatform)\Test\Conhost.UIA.Tests.dll'
|
||||
outputProjFileName: 'RunTestsInHelix-HostTestsUIA.proj'
|
||||
testSuite: '${{ parameters.testSuite }}'
|
||||
taefQuery: ${{ parameters.taefQuery }}
|
||||
|
||||
- template: helix-createprojfile-steps.yml
|
||||
parameters:
|
||||
condition: and(succeeded(),or(eq('${{ parameters.testSuite }}','PgoInstrumentationSuite'),eq('${{ parameters.testSuite }}','DevTestSuite')))
|
||||
testFilePath: '$(artifactsDir)\${{ parameters.artifactName }}\$(buildConfiguration)\$(buildPlatform)\Test\WindowsTerminal.UIA.Tests.dll'
|
||||
outputProjFileName: 'RunTestsInHelix-WindowsTerminalUIATests.proj'
|
||||
testSuite: '${{ parameters.testSuite }}'
|
||||
taefQuery: ${{ parameters.taefQuery }}
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish generated .proj files'
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: ${{ parameters.artifactName }}
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Run tests in Helix (open queues)'
|
||||
condition: and(succeeded(),eq(variables['System.CollectionUri'],'https://dev.azure.com/ms/'))
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
inputs:
|
||||
command: custom
|
||||
projects: build\Helix\RunTestsInHelix.proj
|
||||
custom: msbuild
|
||||
arguments: '$(helixCommonArgs) /p:IsExternal=true /p:Creator=Terminal /p:HelixTargetQueues=$(openHelixTargetQueues)'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Run tests in Helix (closed queues)'
|
||||
condition: and(succeeded(),ne(variables['System.CollectionUri'],'https://dev.azure.com/ms/'))
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
HelixAccessToken: $(HelixApiAccessToken)
|
||||
inputs:
|
||||
command: custom
|
||||
projects: build\Helix\RunTestsInHelix.proj
|
||||
custom: msbuild
|
||||
arguments: '$(helixCommonArgs) /p:HelixTargetQueues=$(closedHelixTargetQueues)'
|
||||
@@ -1,26 +1,14 @@
|
||||
# From our friends at MUX: https://github.com/microsoft/microsoft-ui-xaml/blob/main/build/AzurePipelinesTemplates/MUX-BuildAndPublishPGONuGet-Job.yml
|
||||
|
||||
parameters:
|
||||
- name: buildConfiguration
|
||||
type: string
|
||||
- name: pool
|
||||
type: object
|
||||
default: []
|
||||
- name: dependsOn
|
||||
type: object
|
||||
default: null
|
||||
- name: artifactStem
|
||||
type: string
|
||||
default: ''
|
||||
- name: jobName
|
||||
type: string
|
||||
default: BuildAndPublishPGONuget
|
||||
dependsOn: ''
|
||||
pgoArtifact: PGO
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobName }}
|
||||
${{ if ne(length(parameters.pool), 0) }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
- job: BuildAndPublishPGONuGet
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
displayName: Package and Publish PGO Databases
|
||||
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
variables:
|
||||
artifactsPath: $(Build.SourcesDirectory)\Artifacts
|
||||
pgoToolsPath: $(Build.SourcesDirectory)\build\PGO
|
||||
@@ -28,25 +16,20 @@ jobs:
|
||||
nuspecFilename: PGO.nuspec
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
# It is important that this be 0, otherwise git will not fetch the branch ref names that the PGO rules require.
|
||||
fetchDepth: 0
|
||||
submodules: false
|
||||
persistCredentials: false
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download Final PGO Databases
|
||||
- task: DownloadBuildArtifacts@0
|
||||
inputs:
|
||||
artifact: pgd-merged-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
downloadPath: $(artifactsPath)
|
||||
|
||||
- template: steps-ensure-nuget-version.yml
|
||||
|
||||
- task: NuGetAuthenticate@0
|
||||
inputs:
|
||||
nuGetServiceConnections: 'Terminal Public Artifact Feed'
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet 5.8.0'
|
||||
inputs:
|
||||
versionSpec: 5.8.0
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
@@ -62,11 +45,12 @@ jobs:
|
||||
displayName: 'Create PGO Nuget'
|
||||
inputs:
|
||||
solution: $(pgoToolsPath)\PGO.DB.proj
|
||||
msbuildArguments: '/t:CreatePGONuGet /p:PGOBuildMode=Instrument /p:PGDPathForAllArch=$(artifactsPath) /p:PGOOutputPath=$(Build.ArtifactStagingDirectory)'
|
||||
msbuildArguments: '/t:CreatePGONuGet /p:PGOBuildMode=Instrument /p:PGDPathForAllArch=$(artifactsPath)\${{ parameters.pgoArtifact }} /p:PGOOutputPath=$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)
|
||||
artifact: pgo-nupkg-${{ parameters.buildConfiguration }}${{ parameters.artifactStem }}
|
||||
displayName: "Publish Pipeline Artifact"
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
pathToPublish: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: 'NuGet push'
|
||||
70
build/pipelines/templates/pgo-merge-pgd-job.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
parameters:
|
||||
dependsOn: ''
|
||||
pgoArtifact: PGO
|
||||
platform: ''
|
||||
configuration: ''
|
||||
|
||||
jobs:
|
||||
- job: MergePGD
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
variables:
|
||||
artifactsPath: $(Build.SourcesDirectory)\Artifacts
|
||||
pgoArtifactsPath: $(artifactsPath)\${{ parameters.pgoArtifact }}
|
||||
buildPlatform: ${{ parameters.platform }}
|
||||
buildConfiguration: ${{ parameters.configuration }}
|
||||
|
||||
steps:
|
||||
# The environment variable VCToolsInstallDir isn't defined on lab machines, so we need to retrieve it ourselves.
|
||||
- script: |
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath > %TEMP%\vsinstalldir.txt
|
||||
set /p _VSINSTALLDIR15=<%TEMP%\vsinstalldir.txt
|
||||
del %TEMP%\vsinstalldir.txt
|
||||
call "%_VSINSTALLDIR15%\Common7\Tools\VsDevCmd.bat"
|
||||
echo VCToolsInstallDir = %VCToolsInstallDir%
|
||||
echo ##vso[task.setvariable variable=VCToolsInstallDir]%VCToolsInstallDir%
|
||||
displayName: 'Retrieve VC tools directory'
|
||||
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet 6.3.0'
|
||||
inputs:
|
||||
versionSpec: 6.3.0
|
||||
|
||||
- task: NuGetAuthenticate@0
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||
displayName: Restore NuGet packages for extraneous build actions
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: NuGet.config
|
||||
restoreSolution: build/packages.config
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
inputs:
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
downloadPath: $(artifactsPath)
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: Merge counts into PGD
|
||||
inputs:
|
||||
solution: $(Build.SourcesDirectory)\OpenConsole.sln
|
||||
platform: $(buildPlatform)
|
||||
configuration: $(buildConfiguration)
|
||||
msbuildArguments: '/t:MergePGOCounts /p:PGOBuildMode=Instrument /p:PGDPath=$(pgoArtifactsPath)\$(buildPlatform) /p:PGCRootPath=$(pgoArtifactsPath)\$(buildPlatform)'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy merged pgd to artifact staging'
|
||||
inputs:
|
||||
sourceFolder: $(pgoArtifactsPath)
|
||||
contents: '**\$(buildPlatform)\*.pgd'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
pathToPublish: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: ${{ parameters.pgoArtifact }}
|
||||
@@ -1,12 +1,14 @@
|
||||
steps:
|
||||
- template: steps-ensure-nuget-version.yml
|
||||
- task: NuGetToolInstaller@0
|
||||
displayName: 'Use NuGet 6.3.0'
|
||||
inputs:
|
||||
versionSpec: 6.3.0
|
||||
|
||||
- task: NuGetAuthenticate@0
|
||||
|
||||
- script: |-
|
||||
echo ##vso[task.setvariable variable=NUGET_RESTORE_MSBUILD_ARGS]/p:Platform=$(BuildPlatform)
|
||||
displayName: Ensure NuGet restores for $(BuildPlatform)
|
||||
condition: and(succeeded(), ne(variables['BuildPlatform'], 'Any CPU'))
|
||||
|
||||
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||
# This should be `task: NuGetCommand@2`
|
||||
@@ -1,9 +1,9 @@
|
||||
parameters:
|
||||
configuration: 'Release'
|
||||
platform: ''
|
||||
additionalBuildArguments: ''
|
||||
artifactName: 'drop'
|
||||
testLogPath: '$(Build.BinariesDirectory)\$(BuildPlatform)\$(BuildConfiguration)\testsOnBuildMachine.wtl'
|
||||
inputArtifactStem: ''
|
||||
outputArtifactStem: ''
|
||||
|
||||
jobs:
|
||||
- job: Test${{ parameters.platform }}${{ parameters.configuration }}
|
||||
@@ -11,80 +11,72 @@ jobs:
|
||||
variables:
|
||||
BuildConfiguration: ${{ parameters.configuration }}
|
||||
BuildPlatform: ${{ parameters.platform }}
|
||||
${{ if eq(parameters.platform, 'x86') }}:
|
||||
OutputBuildPlatform: Win32
|
||||
${{ else }}:
|
||||
OutputBuildPlatform: ${{ parameters.platform }}
|
||||
Terminal.BinDir: $(Build.SourcesDirectory)/bin/$(OutputBuildPlatform)/$(BuildConfiguration)
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
${{ if ne(parameters.platform, 'ARM64') }}:
|
||||
name: SHINE-OSS-Testing-x64
|
||||
${{ else }}:
|
||||
name: SHINE-OSS-Testing-arm64
|
||||
name: WinDevPoolOSS-L
|
||||
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/ms/') }}:
|
||||
${{ if ne(parameters.platform, 'ARM64') }}:
|
||||
name: SHINE-INT-Testing-x64
|
||||
${{ else }}:
|
||||
name: SHINE-INT-Testing-arm64
|
||||
name: WinDevPool-L
|
||||
demands: ImageOverride -equals WinDevVS17-latest
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: false
|
||||
submodules: true
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
fetchTags: false # Tags still result in depth > 1 fetch; we don't need them here
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download artifacts
|
||||
- task: DownloadBuildArtifacts@0
|
||||
inputs:
|
||||
artifactName: build-${{ parameters.platform }}-$(BuildConfiguration)${{ parameters.inputArtifactStem }}
|
||||
downloadPath: $(Terminal.BinDir)
|
||||
artifactName: ${{ parameters.artifactName }}
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Rationalize build platform'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
$Arch = "$(BuildPlatform)"
|
||||
If ($Arch -Eq "x86") { $Arch = "Win32" }
|
||||
Write-Host "##vso[task.setvariable variable=RationalizedBuildPlatform]${Arch}"
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Run Unit Tests'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\scripts\Run-Tests.ps1
|
||||
arguments: -MatchPattern '*unit.test*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)"
|
||||
arguments: -MatchPattern '*unit.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(System.ArtifactsDirectory)\\${{ parameters.artifactName }}\\$(BuildConfiguration)\\$(BuildPlatform)\\test"
|
||||
condition: and(and(succeeded(), ne(variables['PGOBuildMode'], 'Instrument')), or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
||||
|
||||
- ${{ if or(eq(parameters.platform, 'x64'), eq(parameters.platform, 'arm64')) }}:
|
||||
- task: PowerShell@2
|
||||
displayName: 'Run Feature Tests'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\scripts\Run-Tests.ps1
|
||||
arguments: -MatchPattern '*feature.test*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)"
|
||||
- task: PowerShell@2
|
||||
displayName: 'Run Feature Tests (x64 only)'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\scripts\Run-Tests.ps1
|
||||
arguments: -MatchPattern '*feature.test*.dll' -Platform '$(RationalizedBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(System.ArtifactsDirectory)\\${{ parameters.artifactName }}\\$(BuildConfiguration)\\$(BuildPlatform)\\test"
|
||||
condition: and(and(succeeded(), ne(variables['PGOBuildMode'], 'Instrument')), eq(variables['BuildPlatform'], 'x64'))
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Convert Test Logs from WTL to xUnit format'
|
||||
condition: always()
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\Helix\ConvertWttLogToXUnit.ps1
|
||||
arguments: -WttInputPath '${{ parameters.testLogPath }}' -WttSingleRerunInputPath 'unused.wtl' -WttMultipleRerunInputPath 'unused2.wtl' -XUnitOutputPath 'onBuildMachineResults.xml' -TestNamePrefix '$(BuildConfiguration).$(BuildPlatform)'
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Manually log test failures'
|
||||
condition: always()
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: build\Helix\OutputTestErrorsForAzureDevops.ps1
|
||||
arguments: -XUnitOutputPath 'onBuildMachineResults.xml'
|
||||
condition: and(ne(variables['PGOBuildMode'], 'Instrument'),or(eq(variables['BuildPlatform'], 'x64'), eq(variables['BuildPlatform'], 'x86')))
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Upload converted test logs'
|
||||
condition: always()
|
||||
condition: ne(variables['PGOBuildMode'], 'Instrument')
|
||||
inputs:
|
||||
testResultsFormat: 'xUnit' # Options: JUnit, NUnit, VSTest, xUnit, cTest
|
||||
testResultsFiles: '**/onBuildMachineResults.xml'
|
||||
#searchFolder: '$(System.DefaultWorkingDirectory)' # Optional
|
||||
#mergeTestResults: false # Optional
|
||||
#failTaskOnFailedTests: false # Optional
|
||||
testRunTitle: 'On Build Machine Tests' # Optional
|
||||
buildPlatform: $(BuildPlatform) # Optional
|
||||
buildConfiguration: $(BuildConfiguration) # Optional
|
||||
#publishRunAttachments: true # Optional
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy result logs to Artifacts'
|
||||
condition: always()
|
||||
inputs:
|
||||
Contents: |
|
||||
**/*.wtl
|
||||
@@ -95,5 +87,4 @@ jobs:
|
||||
flattenFolders: true
|
||||
|
||||
- publish: '$(Build.ArtifactStagingDirectory)/$(BuildConfiguration)/$(BuildPlatform)/test-logs'
|
||||
artifact: test-logs-$(BuildPlatform)-$(BuildConfiguration)${{ parameters.outputArtifactStem }}
|
||||
condition: always()
|
||||
artifact: TestLogs$(BuildPlatform)$(BuildConfiguration)
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Canary'">WT_BRANDING_CANARY</_WTBrandingPreprocessorToken>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Preview'">WT_BRANDING_PREVIEW</_WTBrandingPreprocessorToken>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(WindowsTerminalBranding)'=='Release'">WT_BRANDING_RELEASE</_WTBrandingPreprocessorToken>
|
||||
<_WTBrandingPreprocessorToken Condition="'$(_WTBrandingPreprocessorToken)'==''">WT_BRANDING_DEV</_WTBrandingPreprocessorToken>
|
||||
|
||||
@@ -9,8 +9,7 @@ Param(
|
||||
[Parameter(Mandatory=$false, Position=3)]
|
||||
[string]$LogPath,
|
||||
[Parameter(Mandatory=$false)]
|
||||
[string]$Root = ".\bin\$Platform\$Configuration",
|
||||
[string[]]$AdditionalTaefArguments
|
||||
[string]$Root = ".\bin\$Platform\$Configuration"
|
||||
)
|
||||
|
||||
# Find test DLLs based on the provided root, match pattern, and recursion
|
||||
@@ -27,7 +26,7 @@ if ($LogPath) {
|
||||
}
|
||||
|
||||
# Invoke the te.exe executable with arguments and test DLLs
|
||||
& "$Root\te.exe" $args $testDlls.FullName $AdditionalTaefArguments
|
||||
& "$Root\te.exe" $args $testDlls.FullName
|
||||
|
||||
# Check the exit code of the te.exe process and exit accordingly
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
|
||||
@@ -85,32 +85,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"BuiltinSuggestionSource": {
|
||||
"enum": [
|
||||
"commandHistory",
|
||||
"tasks",
|
||||
"all"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"SuggestionSource": {
|
||||
"default": "all",
|
||||
"description": "Either a single suggestion source, or an array of sources to concatenate. Built-in sources include `commandHistory`, `directoryHistory`, and `tasks`. The special value `all` indicates all suggestion sources should be included",
|
||||
"$comment": "`tasks` and `local` are sources that would be added by the Tasks feature, as a follow-up",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": [ "string", "null", "BuiltinSuggestionSource" ]
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": { "type": "BuiltinSuggestionSource" }
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
}
|
||||
]
|
||||
},
|
||||
"AppearanceConfig": {
|
||||
"properties": {
|
||||
"colorScheme": {
|
||||
@@ -286,8 +260,7 @@
|
||||
"description": "Name of the scheme to use when the app is using dark theme",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"FontConfig": {
|
||||
"properties": {
|
||||
@@ -424,7 +397,6 @@
|
||||
"sendInput",
|
||||
"setColorScheme",
|
||||
"setTabColor",
|
||||
"showSuggestions",
|
||||
"splitPane",
|
||||
"switchToTab",
|
||||
"tabSearch",
|
||||
@@ -1794,30 +1766,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"ShowSuggestionsAction": {
|
||||
"description": "Arguments corresponding to a Open Suggestions Action",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/$defs/ShortcutAction"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"action": {
|
||||
"type": "string",
|
||||
"const": "showSuggestions"
|
||||
},
|
||||
"source": {
|
||||
"$ref": "#/$defs/SuggestionSource",
|
||||
"description": "Which suggestion sources to filter."
|
||||
},
|
||||
"useCommandline": {
|
||||
"default": false,
|
||||
"description": "When set to `true`, the current commandline the user has typed will pre-populate the filter of the Suggestions UI. This requires that the user has enabled shell integration in their shell's config. When set to false, the filter will start empty."
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"ShowCloseButton": {
|
||||
"enum": [
|
||||
"always",
|
||||
@@ -2088,9 +2036,6 @@
|
||||
{
|
||||
"$ref": "#/$defs/SearchWebAction"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/ShowSuggestionsAction"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
|
||||
@@ -1,499 +0,0 @@
|
||||
---
|
||||
author: Mike Griese
|
||||
created on: 2022-03-28
|
||||
last updated: 2023-07-19
|
||||
issue id: 11000, 1527, 6232
|
||||
---
|
||||
|
||||
##### [Original issue: [#1527]] [experimental PR [#12948]] [remaining marks [#14341]]
|
||||
|
||||
# Windows Terminal - Shell Integration (Marks)
|
||||
|
||||
## Abstract
|
||||
|
||||
_"Shell integration" refers to a broad category of ways by which a commandline
|
||||
shell can drive richer integration with the terminal. This spec in particular is
|
||||
most concerned with "marks" and other semantic markup of the buffer._
|
||||
|
||||
Marks are a new buffer-side feature that allow the commandline application or
|
||||
user to add a bit of metadata to a range of text. This can be used for marking a
|
||||
region of text as a prompt, marking a command as succeeded or failed, quickly
|
||||
marking errors in the output. These marks can then be exposed to the user as
|
||||
pips on the scrollbar, or as icons in the margins. Additionally, the user can
|
||||
quickly scroll between different marks, to allow easy navigation between
|
||||
important information in the buffer.
|
||||
|
||||
Marks in the Windows Terminal are a combination of functionality from a variety
|
||||
of different terminal emulators. "Marks" attempts to unify these different, but
|
||||
related pieces of functionality.
|
||||
|
||||
## Background
|
||||
|
||||
There's a large amount of prior art on this subject. I've attempted to collect
|
||||
as much as possible in the ["Relevant external docs"](#Relevant-external-docs)
|
||||
section below. "Marks" have been used in different scenarios by different
|
||||
emulators for different purposes. The common thread running between them of
|
||||
marking a region of text in the buffer with a special meaning.
|
||||
|
||||
* iTerm2, ConEmu, FinalTerm et.al. support emitting a VT sequence to indicate
|
||||
that a line is a "prompt" line. This is often used for quick navigation
|
||||
between these prompts.
|
||||
* FinalTerm (and xterm.js) also support marking up more than just the prompt.
|
||||
They go so far as to differentiate the start/end of the prompt, the start of
|
||||
the commandline input, and the start/end of the command output.
|
||||
`FTCS_COMMAND_FINISHED` is even designed to include metadata indicating
|
||||
whether a command succeeded or failed.
|
||||
* Additionally, Terminal.app allows users to "bookmark" lines via the UI. That
|
||||
allows users to quickly come back to something they feel is important.
|
||||
* Consider also editors like Visual Studio. VS also uses little marks on the
|
||||
scrollbar to indicate where other matches are for whatever the given search
|
||||
term is.
|
||||
|
||||
### "Elevator" pitch
|
||||
|
||||
The Terminal provides a way for command line shells to semantically mark parts
|
||||
of the command-line output. By marking up parts of the output, the Terminal can
|
||||
provide richer experiences. The Terminal will know where each command starts and
|
||||
stops, what the actual command was and what the output of that command is. This
|
||||
allows the terminal to expose quick actions for:
|
||||
|
||||
* Quickly navigating the history by scrolling between commands
|
||||
* Re-running a previous command in the history
|
||||
* Copying all the output of a single command
|
||||
* A visual indicator to separate out one command-line from the next, for quicker
|
||||
mental parsing of the output of the command-line.
|
||||
* Collapsing the output of a command, as to reduce noise
|
||||
* Visual indicators that highlight commands that succeeded or failed.
|
||||
* Jumping to previously used directories
|
||||
|
||||
### User Stories
|
||||
|
||||
This is a bit of a unusual section, as this feature was already partially
|
||||
implemented when this spec was written.
|
||||
|
||||
Story | Size | Description
|
||||
--|-----------|--
|
||||
A | ✅ Done | The user can use mark each prompt and have a mark displayed on the scrollbar
|
||||
B | ✅ Done | The user can perform an action to scroll between marks
|
||||
C | ✅ Done | The user can manually add marks to the buffer
|
||||
D | ✅ Done | The shell can emit different marks to differentiate between prompt, command, and output
|
||||
E | ✅ Done | Clearing the buffer clears marks
|
||||
F | 🐣 Crawl | Marks stay in the same place you'd expect after resizing the buffer.
|
||||
G | ✅ Done | Users can perform an action to select the previous command's output
|
||||
H | 🚶 Walk | The find dialog can display marks on the scrollbar indicating the position of search matches
|
||||
I | 🏃♂️ Run | The terminal can display icons in the gutter, with quick actions for that command (re-run, copy output, etc)
|
||||
J | 🏃♂️ Run | The terminal can display a faint horizontal separator between commands in the buffer.
|
||||
K | 🚀 Sprint | The terminal can "collapse" content between two marks.
|
||||
L | 🚀 Sprint | The terminal can display a sticky header above the control which displays the most recent command
|
||||
M | 🚀 Sprint | The user can open a dialog to manually bookmark a line with a custom comment
|
||||
|
||||
## Solution Design
|
||||
|
||||
### Supported VT sequences
|
||||
|
||||
* [x] iTerm2's OSC `SetMark` (in [#12948])
|
||||
* [x] FinalTerm prompt markup sequences
|
||||
- [x] **FTCS_PROMPT** was added in [#13163]
|
||||
- [x] The rest in [#14341]
|
||||
* [ ] additionally, VsCode's FinalTerm prompt markup variant, `OSC 663`
|
||||
* [ ] [ConEmu's
|
||||
`OSC9;12`](https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC)
|
||||
* [ ] Any custom OSC we may want to author ourselves.
|
||||
|
||||
The FinalTerm prompt sequences are probably the most complicated version of all
|
||||
these, so it's important to give these a special callout. Almost all the other
|
||||
VT sequences are roughly equivalent to **FTCS_PROMPT**. The xterm.js / VsCode
|
||||
version has additional cases, that they ironically added to work around conpty
|
||||
not understanding these sequences originally.
|
||||
|
||||
#### FinalTerm sequences
|
||||
|
||||
The relevant FinalTerm sequences for marking up the prompt are as follows.
|
||||
|
||||
|
||||

|
||||
|
||||
* **FTCS_PROMPT**: `OSC 133 ; A ST`
|
||||
- The start of a prompt. Internally, this sets a marker in the buffer
|
||||
indicating we started a prompt at the current cursor position, and that
|
||||
marker will be used when we get a **FTCS_COMMAND_START**
|
||||
* **FTCS_COMMAND_START**: `OSC 133 ; B ST`
|
||||
- The start of a commandline (READ: the end of the prompt). When it follows a
|
||||
**FTCS_PROMPT**, it creates a mark in the buffer from the location of the
|
||||
**FTCS_PROMPT** to the current cursor position, with the category of
|
||||
`prompt`
|
||||
* **FTCS_COMMAND_EXECUTED**: `OSC 133 ; C ST`
|
||||
- The start of the command output / the end of the commandline.
|
||||
* **FTCS_COMMAND_FINISHED**: `OSC 133 ; D ; [Ps] ST`
|
||||
- the end of a command.
|
||||
|
||||
Same deal for the **FTCS_COMMAND_EXECUTED**/**FTCS_COMMAND_FINISHED** ones.
|
||||
**FTCS_COMMAND_EXECUTED** does nothing until we get a **FTCS_COMMAND_FINISHED**,
|
||||
and the `[Ps]` parameter determines the category.
|
||||
- `[Ps] == 0`: success
|
||||
- anything else: error
|
||||
|
||||
This whole sequence will get turned into a single mark.
|
||||
|
||||
When we get the **FTCS_COMMAND_FINISHED**, set the category of the prompt mark
|
||||
that preceded it, so that the `prompt` becomes an `error` or a `success`.
|
||||
|
||||
|
||||
### Buffer implementation
|
||||
|
||||
In the initial PR ([#12948]), marks were stored simply as a `vector<Mark>`,
|
||||
where a mark had a start and end point. These wouldn't reflow on resize, and
|
||||
didn't support all of the FTCS sequences.
|
||||
|
||||
There's ultimately three types of region here we need to mark:
|
||||
* The prompt (starting from A)
|
||||
* the command (starting from B)
|
||||
* the output (starting from C)
|
||||
|
||||
That intuitively feels a bit like a text attribute almost. Additionally, the
|
||||
prompt should be connected to its subsequent command and output, s.t. we can
|
||||
* Select command output
|
||||
* re-run command
|
||||
|
||||
easily. Supposedly, we could do this by iterating through the whole buffer to
|
||||
find the previous/next {whatever}[[1](#footnote-1)]. Additionally, the prompt
|
||||
needs to be able to contain the status / category, and a `133;D` needs to be
|
||||
able to change the category of the previous prompt/command.
|
||||
|
||||
If we instead do a single mark for each command, from `133;A` to `133;A`, and
|
||||
have sub-points for elements within the command
|
||||
* `133;A` starts a mark on the current line, at the current position.
|
||||
* `133;B` sets the end of the mark to the current position.
|
||||
* `133;C` updates the mark's `commandStart` to the current end, then sets the
|
||||
end of the mark to the current position.
|
||||
* `133;D` updates the mark's `outputStart` to the current end, then sets the end
|
||||
of the mark to the current position. It also updates the category of the mark,
|
||||
if needed.
|
||||
|
||||
Each command then only shows up as a single mark on the scrollbar. Jumping
|
||||
between commands is easy, `scrollToMark` operates on `mark.start`, which is
|
||||
where the prompt started. "Bookmarks", i.e. things started by the user wouldn't
|
||||
have `commandStart` or `outputStart` in them. Getting the text of the command,
|
||||
of the output is easy - it's just the text between sub-points.
|
||||
|
||||
Reflow still sucks though - we'd need to basically iterate over all the marks as
|
||||
we're reflowing, to make sure we put them into the right place in the new
|
||||
buffer. This is annoying and tedious, but shouldn't realistically be a
|
||||
performance problem.
|
||||
|
||||
#### Cmd.exe considerations
|
||||
|
||||
`cmd.exe` is generally a pretty bad shell, and doesn't have a lot of the same
|
||||
hooks that other shells do, that might allow for us to emit the
|
||||
**FTCS_COMMAND_EXECUTED** sequence. However, cmd.exe also doesn't allow
|
||||
multiline prompts, so we can be relatively certain that when the user presses
|
||||
<kbd>enter</kbd>, that's the end of the prompt. We will treat the
|
||||
`autoMarkPrompts` setting (which auto-marks <kbd>enter</kbd>) as the _end of the
|
||||
prompt_. That would at least allow cmd.exe to emit a {command finished}{prompt
|
||||
start}{prompt...}{command start} in the prompt, and have us add the command
|
||||
executed. It is not perfect (we wouldn't be able to get error information), but
|
||||
it does work well enough.
|
||||
|
||||
```cmd
|
||||
PROMPT $e]133;D$e\$e]133;A$e\$e]9;9;$P$e\%PROMPT%$e]133;B$e\
|
||||
```
|
||||
|
||||
## Settings proposals
|
||||
|
||||
The below are the proposed additions to the settings for supporting marks and
|
||||
interacting with them. Some of these have already been added as experimental
|
||||
settings - these would be promoted to no longer be experimental.
|
||||
|
||||
Many of the sub-points on these settings are definitely "Future Consideration"
|
||||
level settings. For example, the `scrollToMark` `"highlight"` property. That one
|
||||
is certainly not something we need to ship with.
|
||||
|
||||
### Actions
|
||||
|
||||
In addition to driving marks via the output, we will also want to support adding
|
||||
marks manually. These can be thought of like "bookmarks" - a user indicated
|
||||
region that means something to the user.
|
||||
|
||||
* [ ] `addMark`: add a mark to the buffer. If there's a selection, place the
|
||||
mark covering at the selection. Otherwise, place the mark on the cursor row.
|
||||
- [x] `color`: a color for the scrollbar mark. (in [#12948])
|
||||
- [ ] `category`: one of `{"prompt", "error", "warning", "success", "info"}`
|
||||
* [ ] `scrollToMark`
|
||||
- [x] `direction`: `["first", "previous", "next", "last"]` (in [#12948])
|
||||
- [ ] `category`: `flags({categories}...)`, default `"all"`. Only scroll to
|
||||
one of the categories specified (e.g. only scroll to the previous error,
|
||||
only the previous prompt, or just any mark)
|
||||
- [ ] [#13449] - `center` or some other setting that controls how the mark is scrolled in.
|
||||
- Maybe `top` (current) /`center` (as proposed) /`nearestEdge` (when
|
||||
scrolling down, put the mark at the bottom line of viewport , up -> top
|
||||
line)?
|
||||
- [ ] [#13455] - `highlight`: `bool`, default true. Display a temporary
|
||||
highlight around the mark when scrolling to it. ("Highlight" != "select")
|
||||
- If the mark has prompt/command/output sections, only select the prompt and command.
|
||||
- If the mark has zero width (i.e. the user just wanted to bookmark a line),
|
||||
then highlight the entire row.
|
||||
* [x] `clearMark`: Remove any marks in the selected region (or at the cursor
|
||||
position) (in [#12948])
|
||||
* [x] `clearAllMarks`: Remove all the marks from the buffer. (in [#12948])
|
||||
|
||||
|
||||
#### Selecting commands & output
|
||||
|
||||
_Inspired by a long weekend of manually copying .csv output from the Terminal to
|
||||
a spreadsheet, only to discover that we rejected [#4588] some years ago._
|
||||
|
||||
* [x] `selectCommand(direction=[prev, next])`: Starting at the active selection
|
||||
anchor, (or the cursor if there's no selection), select the command that
|
||||
starts before/after this point (exclusive). Probably shouldn't wrap around
|
||||
the buffer.
|
||||
* Since this will create a selection including the start of the command,
|
||||
performing this again will select the _next_ command (in whatever
|
||||
direction).
|
||||
* [x] `selectOutput(direction=[prev, next])`: same as above, but with command outputs.
|
||||
|
||||
A convenient workflow might be a `multipleActions([selectOutput(prev),
|
||||
copy()])`, to quickly select the previous commands output.
|
||||
|
||||
### Per-profile settings
|
||||
|
||||
* [x] `autoMarkPrompts`: `bool`, default `false`. (in [#12948])
|
||||
* [ ] `showFindMatchesOnScrollbar`: `bool`, default `true`.
|
||||
* [ ] `showMarksOnScrollbar`: `bool` or `flags({categories}...)`
|
||||
* As an example: `"showMarksOnScrollbar": ["error", "success"]`).
|
||||
* Controls if marks should be displayed on the scrollbar.
|
||||
* If `true`/`"all"`, then all marks are displayed.
|
||||
* If `false`/`"none"`, then no marks are displayed.
|
||||
* If a set of categories are provided, only display marks from those categories.
|
||||
* [x] the bool version is (in [#12948])
|
||||
* [ ] The `flags({categories}...)` version is not done yet.
|
||||
* [ ] `showGutterIcons`, for displaying gutter icons.
|
||||
|
||||
## UX Design
|
||||
|
||||
An example of what colored marks look like:
|
||||
|
||||

|
||||
|
||||
This gif demos both prompt marks and marks for search results:
|
||||
|
||||

|
||||
|
||||
|
||||
### Gutter icons
|
||||
|
||||

|
||||
_An example of what the icons in the VsCode gutter look like_
|
||||
|
||||
### Multiple marks on the same line
|
||||
|
||||
When it comes to displaying marks on the scrollbar, or in the margins, the
|
||||
relative priority of these marks matters. Marks are given the following
|
||||
priority, with errors being the highest priority.
|
||||
* Error
|
||||
* Warning
|
||||
* Success
|
||||
* Prompt
|
||||
* Info (default)
|
||||
|
||||
## Work needed to get marks to v1
|
||||
|
||||
* [x] Clearing the screen leaves marks behind
|
||||
* [x] Make sure `ED2` works to clear/move marks
|
||||
* [x] Same with `ED3`
|
||||
* [x] Same with `cls` / `Clear-Host`
|
||||
* [x] Clear Buffer action too.
|
||||
* [X] Circling doesn't update scrollbar
|
||||
* I think this was fixed in [#14341], or in [#14045]
|
||||
* [ ] Resizing / reflowing marks
|
||||
* [x] marks should be stored in the `TextBuffer`
|
||||
|
||||
## Future Considerations
|
||||
* adding a timestamp for when a line was marked?
|
||||
* adding a comment to the mark. How do we display that comment? a TeachingTip on
|
||||
the scrollbar maybe (actually that's a cool idea)
|
||||
* adding a shape to the mark? Terminal.app marks prompt lines with brackets in
|
||||
the margins
|
||||
* Marks are currently just displayed as "last one in wins", they should have a
|
||||
real sort order
|
||||
* Should the height of a mark on the scrollbar be dependent on font size &
|
||||
buffer height? I think I've got it set to like, a static 2dip, but maybe it
|
||||
should represent the actual height of the row (down to a min 1dip)
|
||||
* [#13455] - highlight a mark when scrolled to with the `scrollToMark` action.
|
||||
This is left as a future consideration to figure out what kind of UI we want
|
||||
here. Do we want to highlight
|
||||
- the prompt?
|
||||
- the whole row of the prompt?
|
||||
- the prompt and the command?
|
||||
- The whole prompt & command & output?
|
||||
* an `addBookmark` action: This one's basically just `addMark`, but opens a prompt
|
||||
(like the window renamer) to add some text as a comment. Automatically
|
||||
populated with the selected text (if there was some).
|
||||
- A dedicated transient pane for displaying non-terminal content might be
|
||||
useful for such a thing.
|
||||
- This might just make more sense as a parameter to `addMark`.
|
||||
* Other ideas for `addMark` parameters:
|
||||
- `icon`: This would require us to better figure out how we display gutter
|
||||
icons. This would probably be like, a _shape_ rather than an arbitrary
|
||||
image.
|
||||
- `note`: a note to stick on the mark, as a comment. Might be more valuable
|
||||
with something like `addBookmark`.
|
||||
|
||||
### Gutter icons
|
||||
|
||||
VsCode implements a set of gutter icons to the left of the buffer lines, to
|
||||
provide a UI element for exposing some quick actions to perform, powered by
|
||||
shell integration.
|
||||
|
||||
Gutter icons don't need to implement app-level actions at all. They _should_ be
|
||||
part of the control. At least, part of the UWP `TermControl`. These are some
|
||||
basic "actions" we could add to that menu. Since these are all attached to a
|
||||
mark anyways, we already know what mark the user interacted with, and where the
|
||||
start/end already is.
|
||||
* Copy command
|
||||
* Copy output
|
||||
* Re-run command
|
||||
* Save as task
|
||||
* Explain this (for errors)
|
||||
|
||||
To allow comments in marks (ala "bookmarks"), we can use
|
||||
the gutter flyout to display the comment, and have the tooltip display that
|
||||
comment.
|
||||
|
||||
This is being left as a future consideration for now. We need to really sit and
|
||||
consider what the UX is like for this.
|
||||
* Do we just stick the gutter icons in the margin/padding?
|
||||
* Have it be a separate space in the "buffer"
|
||||
- If it's in the buffer itself, we can render it with the renderer, which by
|
||||
all accounts, we probably should.
|
||||
|
||||
### Edge cases where these might not work as expected
|
||||
|
||||
Much of the benefits of shell integration come from literal buffer text parsing.
|
||||
This can lead to some rough edge cases, such as:
|
||||
|
||||
* the user presses <kbd>Ctrl+V</kbd><kbd>Escape</kbd> to input an ESC character
|
||||
and the shell displays it as `^[`
|
||||
* the user presses <kbd>Ctrl+V</kbd><kbd>Ctrl+J</kbd> to input an LF character
|
||||
and the shell displays it as a line break
|
||||
* the user presses <kbd>Enter</kbd> within a quoted string and the shell
|
||||
displays a continuation prompt
|
||||
* the user types a command including an exclamation point, and the shell invokes
|
||||
history expansion and echoes the result of expansion before it runs the
|
||||
command
|
||||
* The user has a prompt with a right-aligned status, ala
|
||||

|
||||
|
||||
In these cases, the effects of shell integration will likely not work as
|
||||
intended. There are various possible solutions that are being explored. We might
|
||||
want to in the future also use [VsCode's extension to the FTCS sequences] to
|
||||
enable the shell to tell the terminal the literal resulting commandline.
|
||||
|
||||
There's been [other proposals] to extend shell integration features as well.
|
||||
|
||||
### Rejected ideas
|
||||
|
||||
There was originally some discussion as to whether this is a design that should
|
||||
be unified with generic pattern matchers. Something like the URL detection,
|
||||
which identifies part of the buffer and then "marks" it. Prototypes for both of
|
||||
these features are going in very different directions, however. Likely best to
|
||||
leave them separate.
|
||||
|
||||
## Resources
|
||||
|
||||
### Other related issues
|
||||
|
||||
Not necessarily marks related, but could happily leverage this functionality.
|
||||
|
||||
* [#5916] and [#12366], which are likely to be combined into a single thread
|
||||
- Imagine a trigger that automatically detects `error:.*` and then marks the line
|
||||
* [#9583]
|
||||
- Imagine selecting some text, colorizing & marking it all at once
|
||||
- `addMark(selection:false)`, above, was inspired by this.
|
||||
* [#7561] (and broadly, [#3920])
|
||||
- Search results should maybe show up here on the scrollbar too.
|
||||
* [#13455]
|
||||
* [#13449]
|
||||
* [#4588]
|
||||
* [#14754] - A "sticky header" for the `TermControl` that could display the
|
||||
previous command at the top of the buffer.
|
||||
* [#2226] - a scrollable "minimap" in te scrollbar, as opposed to marks
|
||||
|
||||
### Relevant external docs
|
||||
* **GREAT** summary of the state of the ecosystem: https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/28
|
||||
* https://iterm2.com/documentation-escape-codes.html
|
||||
- `OSC 1337 ; SetMark ST` under "Set Mark"
|
||||
- under "Shell Integration/FinalTerm
|
||||
* https://support.apple.com/en-ca/guide/terminal/trml135fbc26/mac
|
||||
- discusses auto-marked lines on `enter`/`^C`/`^D`
|
||||
- allows bookmarking lines with selection
|
||||
- bookmarks can have a name (maybe not super important)
|
||||
* [How to Use Marks in OS X’s Terminal for Easier Navigation](https://www.howtogeek.com/256548/how-to-use-marks-in-os-xs-terminal-for-easier-navigation/)
|
||||
* [Terminal: The ‘\[‘ Marks the Spot](https://scriptingosx.com/2017/03/terminal-the-marks-the-spot/)
|
||||
* Thread with VsCode (xterm.js) implementation notes: https://github.com/microsoft/terminal/issues/1527#issuecomment-1076455642
|
||||
* [xterm.js prompt markup sequences](https://github.com/microsoft/vscode/blob/39cc1e1c42b2e53e83b1846c2857ca194848cc1d/src/vs/workbench/contrib/terminal/browser/xterm/shellIntegrationAddon.ts#L50-L52)
|
||||
* [VsCode command tracking release notes](https://code.visualstudio.com/updates/v1_22#_command-tracking), also [Terminal shell integration](https://code.visualstudio.com/updates/v1_65#_terminal-shell-integration)
|
||||
* ConEMU:
|
||||
Sequence | Description
|
||||
-- | --
|
||||
ESC ] 9 ; 12 ST | Let ConEmu treat current cursor position as prompt start. Useful with PS1.
|
||||
|
||||
* https://iterm2.com/documentation-one-page.html#documentation-triggers.html"
|
||||
|
||||
### Footnotes
|
||||
|
||||
<a name="footnote-1"><a>[1]: Intuitively, this feels prohibitively expensive,
|
||||
but you'd be mistaken.
|
||||
|
||||
An average device right now (I mean something that was alright about 5 years
|
||||
ago, like an 8700k with regular DDR4) does about 4GB/s of random, un-cached
|
||||
memory access. While low-end devices are probably a bit slower, I think 4GB/s is
|
||||
a good estimate regardless. That's because non-random memory access is way way
|
||||
faster than that at around 20GB/s (DDR4 2400 - what most laptops had for the
|
||||
last decade).
|
||||
|
||||
Assuming a 120 column * 32k line buffer (our current maximum), the buffer would
|
||||
be about 21MB large. Going through the entire buffer linearly at 20GB/s would
|
||||
take just 1ms (including all text and metadata). If we assume that each row has
|
||||
a mark, that marks are 36 byte large and assuming the worst case of random
|
||||
access, we can go through all 32k within about 0.3ms.
|
||||
|
||||
|
||||
|
||||
_(Thanks lhecker for these notes)_
|
||||
|
||||
|
||||
[#1527]: https://github.com/microsoft/terminal/issues/1527
|
||||
[#12948]: https://github.com/microsoft/terminal/issues/12948
|
||||
[#1527]: https://github.com/microsoft/terminal/issues/1527
|
||||
[#6232]: https://github.com/microsoft/terminal/issues/6232
|
||||
[#2226]: https://github.com/microsoft/terminal/issues/2226
|
||||
[#12948]: https://github.com/microsoft/terminal/issues/12948
|
||||
[#13163]: https://github.com/microsoft/terminal/issues/13163
|
||||
[#12948]: https://github.com/microsoft/terminal/issues/12948
|
||||
[#12948]: https://github.com/microsoft/terminal/issues/12948
|
||||
[#12948]: https://github.com/microsoft/terminal/issues/12948
|
||||
[#13455]: https://github.com/microsoft/terminal/issues/13455
|
||||
[#13449]: https://github.com/microsoft/terminal/issues/13449
|
||||
[#12948]: https://github.com/microsoft/terminal/issues/12948
|
||||
[#12948]: https://github.com/microsoft/terminal/issues/12948
|
||||
[#4588]: https://github.com/microsoft/terminal/issues/4588
|
||||
[#5804]: https://github.com/microsoft/terminal/issues/5804
|
||||
[#12948]: https://github.com/microsoft/terminal/issues/12948
|
||||
[#12948]: https://github.com/microsoft/terminal/issues/12948
|
||||
[#13455]: https://github.com/microsoft/terminal/issues/13455
|
||||
[#5916]: https://github.com/microsoft/terminal/issues/5916
|
||||
[#12366]: https://github.com/microsoft/terminal/issues/12366
|
||||
[#9583]: https://github.com/microsoft/terminal/issues/9583
|
||||
[#7561]: https://github.com/microsoft/terminal/issues/7561
|
||||
[#3920]: https://github.com/microsoft/terminal/issues/3920
|
||||
[#13455]: https://github.com/microsoft/terminal/issues/13455
|
||||
[#13449]: https://github.com/microsoft/terminal/issues/13449
|
||||
[#4588]: https://github.com/microsoft/terminal/issues/4588
|
||||
[#14341]: https://github.com/microsoft/terminal/issues/14341
|
||||
[#14045]: https://github.com/microsoft/terminal/issues/14045
|
||||
[#14754]: https://github.com/microsoft/terminal/issues/14754
|
||||
[#14341]: https://github.com/microsoft/terminal/issues/14341
|
||||
|
||||
[VsCode's extension to the FTCS sequences]: https://code.visualstudio.com/docs/terminal/shell-integration#_vs-code-custom-sequences-osc-633-st
|
||||
|
||||
[other proposals]: https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/6#f6de1e5703f5806d0821d92b0274e895c4b6d850
|
||||
|
Before Width: | Height: | Size: 201 KiB |
|
Before Width: | Height: | Size: 38 KiB |
601
doc/specs/drafts/#5916 - Triggers/#5916 - Triggers.md
Normal file
@@ -0,0 +1,601 @@
|
||||
---
|
||||
author: Mike Griese @zadjii-msft
|
||||
created on: 2022-09-07
|
||||
last updated: 2023-07-12
|
||||
issue id: 5916
|
||||
---
|
||||
|
||||
# Triggers and Custom Clickable Links
|
||||
|
||||
## Abstract
|
||||
|
||||
This spec outlines a mechanism by which users can define custom actions to run
|
||||
when a string of text is written to the Terminal. This lets users create
|
||||
powerful ways of automating their Terminal to match their own workflows. This
|
||||
same mechanism can be used by third-party applications to customize the way the
|
||||
terminal control automatically identifies links or other clickable regions of
|
||||
the buffer, and handle it in their own way.
|
||||
|
||||
## Background
|
||||
|
||||
### Inspiration
|
||||
|
||||
Much of this was heavily inspired by the [VsCode "auto replies"], as well as the
|
||||
[triggers in iTerm2]. VsCode is also working on a draft "[Quick Fix API]", from
|
||||
which a lot of inspiration was taken as far as crafting the `match` syntax. You
|
||||
can seen a sample of their syntax
|
||||
[here](https://github.com/microsoft/vscode/blob/4c6e0b5eee419550e31e386a0a5ca9840ac3280b/extensions/npm/package.json#L342-L354).
|
||||
|
||||
### User Stories
|
||||
|
||||
This is a collection of all the possible issues I found on this topic.
|
||||
|
||||
* [x] [#5916] Triggers(Including Text Strings) and Actions (internal or external calls)
|
||||
* [x] [#8849] Allow "hyperlink" matching for arbitrary patterns and adding custom handlers
|
||||
* [x] [#7562] Allow more URI schemes
|
||||
* [x] [#2671] Feature Request: link generation for files + other data types
|
||||
- This is a dupe of some of the above, honestly. Either [#5916] or [#8849]
|
||||
* [x] [#6969] Let terminal consumers provide click handlers and pattern recognizers for buffer text
|
||||
* [x] [#11901] IPv6 links can not be Ctrl+Clicked
|
||||
* [x] Probably don't do this for the alt buffer? Make it per-trigger if they work in the alt buffer?
|
||||
|
||||
Not addressed as a part of this spec:
|
||||
|
||||
* [ ] [#8294] Add a setting to configure display of auto detected links, normally and on hover
|
||||
|
||||
We'll probably want to come back and separately spec how users can control the
|
||||
appearance of both auto-detected clickable text, and links that are manually
|
||||
emitted to the Terminal (via OSC 8). This may be increasingly relevant, as this
|
||||
spec will introduce new ways for users to make text clickable.
|
||||
|
||||
## UX / UI Design
|
||||
|
||||
These are some prototypes from initial investigations in the space. The settings
|
||||
in these are not up to the current spec.
|
||||
|
||||

|
||||
|
||||
_fig 1: a `sendInput` trigger that sends "y" any time that "Terminate batch job" is written to the Terminal_
|
||||
|
||||
|
||||

|
||||
|
||||
_fig 2: A trigger that adds a red error mark whenever an app writes "error" to the Terminal_
|
||||
|
||||
|
||||

|
||||
|
||||
_fig 3: A sendInput trigger which sends some of the matched text_
|
||||
|
||||
|
||||
## Solution Design
|
||||
|
||||
To support "triggers", we'll add a new object to the profile settings called
|
||||
`triggers`. This is an array of objects that describe
|
||||
|
||||
1. What string to match on for running the trigger
|
||||
2. What to do when that match is found.
|
||||
|
||||
Let's start with an example blob of JSON:
|
||||
|
||||
```jsonc
|
||||
"triggers":[
|
||||
{
|
||||
"match": "[Ee][Rr][Rr][Oo][Rr]",
|
||||
"action": "addMark",
|
||||
"color": "#ff0000"
|
||||
},
|
||||
{
|
||||
"match": "Terminate batch job \\(Y/N\\)",
|
||||
"action": "sendInput",
|
||||
"input": "y\r\n"
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
"anchor": "bottom",
|
||||
"offset": 4,
|
||||
"length": 5,
|
||||
"pattern": " git push --set-upstream origin ([^\\w]*)",
|
||||
"runOn": "mark"
|
||||
},
|
||||
"action": "sendInput",
|
||||
"input": "git push --set-upstream origin ${match[1]}\r"
|
||||
},
|
||||
{
|
||||
"match": "'(.*)' is not recognized as an internal or external command,",
|
||||
"action": "checkWinGet",
|
||||
"commandline": "${match[1]}"
|
||||
},
|
||||
{
|
||||
"match": "This will open a new Terminal tab",
|
||||
"action": "newTab"
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
`triggers` is an array of `Trigger` objects, which are a combination of an
|
||||
`ActionAndArgs`, a `Control.Matcher`, and a `Control.TriggerAction`.
|
||||
|
||||
> **Note**
|
||||
> Interface and other types here are shown in C#, since that's fairly close to
|
||||
> MIDL3, which would be used for cross-component interfaces.
|
||||
|
||||
```c#
|
||||
runtimeclass Terminal.Settings.Model.Trigger
|
||||
{
|
||||
String Id;
|
||||
|
||||
Control.Matcher Matcher;
|
||||
Control.TriggerAction ControlAction;
|
||||
|
||||
Terminal.Settings.Model.ActionAndArgs ParseMatches(String[] matches);
|
||||
|
||||
private String _actionJson;
|
||||
}
|
||||
```
|
||||
|
||||
### Trigger matchers
|
||||
|
||||
The `match` property is parsed as a `Control.Matcher`. This includes the
|
||||
following properties, which are heavily inspired by the matchers in VsCode.
|
||||
|
||||
```jsonc
|
||||
"match": {
|
||||
"anchor": "bottom",
|
||||
"offset": 0, // starting how many rows from the bottom
|
||||
"length": 5, // how many lines to match against
|
||||
"pattern": " git push --set-upstream origin ([^\\w]*)",
|
||||
"runOn": "everything|newline|mark",
|
||||
"buffer": "main|alt|any"
|
||||
}
|
||||
```
|
||||
|
||||
* `"anchor"` (_default: `"bottom"`_) : Which part of the viewport to run the match against.
|
||||
- VsCode has this, but I don't think we really do. I think we can just always say bottom.
|
||||
* `"offset"` (_default: `0`_) : Run the match starting how many rows from the anchor
|
||||
* `"length"` (_default: `1`_) : How many rows to include in the match
|
||||
* `"pattern"` (_required_) : The regex to run. If omitted / empty, this entire
|
||||
trigger is ignored.
|
||||
* `"runOn"` (_default: `"newline"`_) : When to run this match.
|
||||
* `"everything"`: On every print from the connection. High performance impact.
|
||||
* `"newline"`: On every newline character from the connection. Medium
|
||||
performance impact, depending on the workload.
|
||||
* `"mark"`: Whenever a mark ([#11000]) is emitted to the terminal. With
|
||||
`autoMarkPrompts`, this includes when the user presses <kbd>enter</kbd>.
|
||||
This has a much smaller performance impact, assuming the user isn't marking
|
||||
every line.
|
||||
* `"buffer"` (_default_: `"any"`): Configure which terminal buffer this trigger runs on.
|
||||
* `main`: only run in the main buffer (e.g., most shells)
|
||||
* `alt`: only run in the alternate screen buffer (e.g., `vim`, `tmux`, any full-screen application)
|
||||
* `any`: Run in either buffer.
|
||||
|
||||
`match` also accepts just a single string, to automatically assume default
|
||||
values for the other properties. For example, the JSON `"match":
|
||||
"[Ee][Rr][Rr][Oo][Rr]"` is evaluated as
|
||||
|
||||
```jsonc
|
||||
"match": {
|
||||
"anchor": "bottom",
|
||||
"offset": 0,
|
||||
"length": 1,
|
||||
"pattern": "[Ee][Rr][Rr][Oo][Rr]",
|
||||
"runOn": "newline"
|
||||
}
|
||||
```
|
||||
|
||||
VsCode only runs matchers on prompt sequences, for performance reasons. We'll
|
||||
need to be VERY explicit that anything else is highly detrimental to
|
||||
performance. We really don't want these to necessarily be running on every
|
||||
single character the connection emits.
|
||||
|
||||
Marks are preferable, because with shell integration, they'll be emitted on
|
||||
every prompt from the shell. Prompts are probably close enough to frequent
|
||||
enough, and the anchor/offset/length give a subset of the buffer that can be
|
||||
used to run matches on.
|
||||
|
||||
### Trigger actions
|
||||
|
||||
Triggers also contain the action that should be performed when a match is found.
|
||||
These actions are used internally by the control as a `Control.TriggerAction`.
|
||||
This allows the control to perform the action itself without going out to the
|
||||
app every time a match is found.
|
||||
|
||||
```c#
|
||||
enum Terminal.Control.TriggerType {
|
||||
CustomAction,
|
||||
|
||||
AddMark,
|
||||
SendInput,
|
||||
ColorSelection,
|
||||
ClickableLink,
|
||||
ClickableSendInput,
|
||||
}
|
||||
|
||||
runtimeclass Terminal.Control.TriggerAction
|
||||
{
|
||||
TriggerType Type;
|
||||
TriggerArgs Args;
|
||||
internal void Execute(ControlCore core, String[] matches);
|
||||
}
|
||||
|
||||
runtimeclass Terminal.Control.TriggerAndMatch
|
||||
{
|
||||
Control.Matcher Matcher;
|
||||
Control.TriggerAction Action;
|
||||
}
|
||||
|
||||
runtimeclass Terminal.Control.CustomActionArgs
|
||||
{
|
||||
UInt32 Index;
|
||||
String[] matches;
|
||||
}
|
||||
```
|
||||
|
||||
There are some built-in `Control.TriggerAction`s (which largely align with
|
||||
existing `ShortcutAction`s). The supported types of `Control.TriggerAction` the
|
||||
user can specify are:
|
||||
|
||||
* `addMark`: Basically the same as the `addMark` action
|
||||
* `sendInput`: Basically the same as the `sendInput` action
|
||||
* `experimental.colorSelection`: Basically the same as the `sendInput` action
|
||||
* `clickableLink`: Turn the matched text into a clickable link. When the user
|
||||
clicks that text, we'll attempt to `ShellExecute` that link, much like a URL.
|
||||
* `clickableSendInput`: Similarly, turn the matched text into a clickable region
|
||||
which, when clicked, sends that text to the connection as input.
|
||||
|
||||
However, if the JSON of the trigger doesn't evaluate as a
|
||||
`Control.TriggerAction`, we'll instead try to parse the json as a
|
||||
`ActionAndArgs`. If we find that, then we'll use a special
|
||||
`Control.TriggerAction` type:
|
||||
|
||||
* `customAction`: This is an internal `TriggerAction` type. This is used to
|
||||
allow the app to provide its own action handler. The control will raise a
|
||||
`CustomAction` event, with args containing the index of the trigger that
|
||||
matched, and the matching groups of the regex.
|
||||
|
||||
`Control.Trigger`'s, when they are hit by the control, will be able to string
|
||||
replace their args themselves. For example:
|
||||
* The `git push` trigger above - when matched, the Core will call
|
||||
`Control.SendInputTrigger.Execute(ControlCore core, String[] matches)` (or
|
||||
something like that). `Execute` will be responsible for string-replacing
|
||||
anything it needs to.
|
||||
|
||||
For custom actions (READ: settings model `ShortcutAction`s, like `newTab`),
|
||||
we'll hang on to the JSON. When the trigger is hit by the control, it'll raise
|
||||
an event. The app will receive the event, match it up to the trigger, and call
|
||||
`Model.Trigger.Parse(String[] matches) -> ActionAndArgs`. That will do the
|
||||
string replace in the JSON itself (similar to how we do iterable `Command`
|
||||
expansion). We'll then just take the _whole json_, and try to parse it literally
|
||||
as an `ActionAndArgs`. This does mean that we couldn't use `match` as a property
|
||||
for any other future actions.
|
||||
|
||||
We can reuse some of the macros in `ActionArgs.h` to make
|
||||
deserializing to a `Control.Trigger` easy.
|
||||
|
||||
#### Alternative JSON for consideration
|
||||
|
||||
This one encapsulates the actions into the `command` property of the
|
||||
`Terminal.Settings.Model.Trigger`. In this version, we don't need to try and
|
||||
re-parse the entire JSON object as a `ActionAndArgs`. This will let future
|
||||
actions use the `match` property.
|
||||
|
||||
```jsonc
|
||||
"triggers":[
|
||||
{
|
||||
"match": "[Ee][Rr][Rr][Oo][Rr]",
|
||||
"command": {
|
||||
"action": "addMark",
|
||||
"color": "#ff0000"
|
||||
},
|
||||
},
|
||||
{
|
||||
"match": "Terminate batch job \\(Y/N\\)",
|
||||
"command": {
|
||||
"action": "sendInput",
|
||||
"input": "y\r\n"
|
||||
},
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
"anchor": "bottom",
|
||||
"offset": 4,
|
||||
"length": 5,
|
||||
"pattern": " git push --set-upstream origin ([^\\w]*)",
|
||||
"runOn": "mark"
|
||||
},
|
||||
"command": {
|
||||
"action": "sendInput",
|
||||
"input": "git push --set-upstream origin ${match[1]}\r"
|
||||
},
|
||||
},
|
||||
{
|
||||
"match": "'(.*)' is not recognized as an internal or external command,",
|
||||
"command": {
|
||||
"action": "checkWinGet",
|
||||
"commandline": "${match[1]}"
|
||||
},
|
||||
},
|
||||
{
|
||||
"match": "This will open a new Terminal tab",
|
||||
"command": "newTab"
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
### Turn text into clickable links
|
||||
|
||||
A similar request from [#8849] that should also be captured. People want the
|
||||
ability to configure the regexes that are used for turning text into clickable
|
||||
links. Currently, we only match on a predefined set<sup>[[1](#footnote-1)]</sup>
|
||||
into clickable text.
|
||||
|
||||
```jsonc
|
||||
// I did not test these regexes
|
||||
{
|
||||
"match": "(^(.+)\\/([^\\/]+)$):(\\d):(\\d)",
|
||||
"action": "clickableLink",
|
||||
"target": "code.exe --goto \"${match[1]}:${match[2]}\""
|
||||
},
|
||||
{
|
||||
"match": "git push --set-upstream origin ([^\\w]*)",
|
||||
"action": "clickableLink",
|
||||
"target": "vi \"${match[1]}\" +${match[2]}\""
|
||||
},
|
||||
{
|
||||
"match": "\\b(T\\d+)\\b",
|
||||
"action": "clickableLink",
|
||||
"target": "https://example.com/tasks/${match[1]}"
|
||||
},
|
||||
```
|
||||
|
||||
Challenges:
|
||||
* with hyperlink matching, we always assume that the cells themselves contain
|
||||
the payload to turn into a URL. We'd have to instead find that the text
|
||||
matched a trigger, then run it back through the regex to split into matched
|
||||
parts, then parse what the target is.
|
||||
|
||||
#### Clickable `sendInput`
|
||||
|
||||
This is the same idea as above. We want users to be able to magically turn
|
||||
regions of the buffer into interactive content. When clicking on that content,
|
||||
the text will get written to the input, rather than `ShellExecute`d.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"match": " git push --set-upstream origin ([^\\w]*)",
|
||||
"action": "clickableSendInput",
|
||||
"input": "git push --set-upstream origin ${match[1]}"
|
||||
},
|
||||
````
|
||||
|
||||
### Layering & Disabling triggers
|
||||
|
||||
Three main cases:
|
||||
* If we define a trigger in `defaults.json`, users should be able to disable it.
|
||||
* If a user puts a trigger into `profiles.defaults`, but doesn't want it to show
|
||||
up in a specific profile
|
||||
* If a fragment decides to add a trigger to a specific profile
|
||||
|
||||
We actually _can't_ put triggers into `defaults.json`. For complicated reasons,
|
||||
we can't have a `profiles.defaults` block in `defaults.json`. This has caused
|
||||
issues in the past. So there's no way for the Terminal to pre-define triggers
|
||||
for all profiles in `defaults.json`. We could entertain the idea of a
|
||||
`defaults.json`-only global `triggers` property, that would work as the
|
||||
"default" triggers. I don't want to commit to that until we have more use cases
|
||||
for default triggers than just the URL detection one.
|
||||
|
||||
We'll just use `"id"` as a key in a map of triggers. Users can unbind them with
|
||||
`"id": "Terminal.builtInThing", match:""`. Just like global actions. So a user can have:
|
||||
|
||||
```json
|
||||
"profiles": {
|
||||
"defaults": {
|
||||
|
||||
"triggers": [
|
||||
{
|
||||
"id": "my winget thing",
|
||||
"match": "'(.*)' is not recognized as an internal or external command,",
|
||||
"command": {
|
||||
"action": "checkWinGet",
|
||||
"commandline": "${match[1]}"
|
||||
},
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
"list": [
|
||||
{
|
||||
"name": "my profile",
|
||||
"commandline": "wsl.exe",
|
||||
"triggers": [
|
||||
{ "id": "my winget thing", "match":"" }
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Triggers do not support partial layering. In the previous example, doing something like:
|
||||
|
||||
```json
|
||||
{ "id": "my winget thing", "command": "newTab" }
|
||||
```
|
||||
|
||||
would not have created a trigger with the same regex match to perform a `newTab`
|
||||
action instead. That json in the profile would be treated as not having a
|
||||
`match`, and would then "unbind" the action from the defaults.
|
||||
|
||||
### Triggers for Terminal Control consumers
|
||||
|
||||
Case in point: [#6969]. Visual Studio would like to supply their own trigger,
|
||||
and receive an event with the ID of the trigger.
|
||||
|
||||
> * Consumers of the terminal must be able to provide a pattern that will identify regions of clickable text
|
||||
> * Consumers will provide a callback that is called with the clicked text as a parameter
|
||||
|
||||
These are addressed generally by the rest of the spec. They could provide
|
||||
`Control.TriggerAndMatch` via `ICoreSettings`. They can use the built-in control
|
||||
actions, or similar to the Windows Terminal, handle custom actions on the
|
||||
control's `CustomAction` event handler.
|
||||
|
||||
## Potential Issues
|
||||
|
||||
<table>
|
||||
|
||||
<tr><td><strong>Compatibility</strong></td><td>
|
||||
|
||||
How does someone turn off the built-in hyperlink detector? Currently, the
|
||||
Terminal has a global setting `experimental.detectURLs` to enable auto-detection
|
||||
of URLs. That should theoretically be replaced with an equivalent setting:
|
||||
|
||||
```json
|
||||
"triggers": [
|
||||
{
|
||||
"match": "(\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|$!:,.;]*[A-Za-z0-9+&@#/%=~_|$])",
|
||||
"action": "clickableLink",
|
||||
"target": "https://example.com/tasks/${match[1]}"
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
However, as mentioned before, this _can't_ go in
|
||||
`defaults.json@profiles.defaults`. We could:
|
||||
|
||||
* Promote the global `experimental.detectURLs` to a fully fledged setting
|
||||
`detectURLs`. This would automatically insert this trigger into the list of
|
||||
triggers whenever it is enabled. We could make it a per-profile setting. We'll
|
||||
just always add it at the end of their list of triggers when creating settings
|
||||
for the profile.
|
||||
* Alternatively, implicitly have a "hardcoded default" trigger with the id of
|
||||
`"Microsoft.Terminal.DetectUrls"`. That would let folks opt-out with
|
||||
```json
|
||||
{ "id": "Microsoft.Terminal.DetectUrls", "match":"" }
|
||||
```
|
||||
|
||||
|
||||
</td></tr>
|
||||
|
||||
<tr><td><strong>Accessibility</strong></td><td>
|
||||
|
||||
Clickable links and sendInput will get the same appearance treatment as
|
||||
auto-detected links (but not as manually emitted ones). They'll have the same
|
||||
accessibility properties as clickable text does today.
|
||||
|
||||
Otherwise, no accessibility changes expected.
|
||||
|
||||
</td></tr>
|
||||
|
||||
<tr><td><strong>Sustainability</strong></td><td>
|
||||
|
||||
No sustainability changes expected.
|
||||
|
||||
</td></tr>
|
||||
|
||||
<tr><td><strong>Localization</strong></td><td>
|
||||
|
||||
No localization concerns here.
|
||||
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
* Q: What happens if multiple regexes match the same text
|
||||
- A: We'll apply the regexes in the order they're defined in the JSON.
|
||||
|
||||
|
||||
### Future Considerations
|
||||
|
||||
* The "iTerm2 trigger actions" listed below are a great list of potential
|
||||
follow-up ways these could be used.
|
||||
|
||||
<!-- This was originally in this doc, but I think that should be moved to it's own spec -->
|
||||
<!--
|
||||
#### Clickable sendInput
|
||||
|
||||
There's already an existing standard for "this text is a hyperlink" - [OSC8].
|
||||
That already accepts a list of arbitrary parameters. Without even really
|
||||
_extending_ that sequence, we could accept a `input={some string of input}`
|
||||
parameter. When we see a URL that was output by a client app with that
|
||||
parameter, we could make clicking that text write that input to the terminal, as
|
||||
input, rather than using the text as a URL.
|
||||
|
||||
We wouldn't need to worry about people sneaking tabs, enters, backspaces into
|
||||
the input via this - control characters aren't accepted as part of these params.
|
||||
We would need to figure out how `:` and `;` should be escaped. Those are
|
||||
delimiters of the sequence itself, so they would need to be escaped / translated
|
||||
somehow.
|
||||
|
||||
We'd need to be wary of things like some of the extended unicode characters - we
|
||||
don't really want folks clicking links and having commands that do something
|
||||
like `echo foo ; rm -rf`.
|
||||
|
||||
This seems like something that could get roped in with triggers. The [iTerm2
|
||||
docs] have a *Make Hyperlink* action, which can be used to turn regex-matched
|
||||
text into a hyperlink. We could always author our equivalent to allow for *Make
|
||||
Clickable* with a string of input instead. -->
|
||||
|
||||
## Resources
|
||||
|
||||
### iTerm2 trigger actions
|
||||
|
||||
The following list was taken from the [iTerm2 docs]. I've added notes on ways we
|
||||
could implement similar functionality. Where there's room for us to easily add
|
||||
new Control-level actions, I've added the enum name as a sub-point.
|
||||
|
||||
* *Annotate*: Add a bookmark? ✅
|
||||
* *Bounce Dock Icon*: Visual, window bell? We don't have a manual action for something like this
|
||||
* `Control.TriggerType.RaiseBell`
|
||||
* *Capture Output*: Not really a good analog. Maybe "add a bookmark", with a bookmark list pane.
|
||||
* *Highlight Text*: `experimental.colorSelection` above ✅
|
||||
* *Inject Data*: "Injects a string as though it had been received". This isn't `sendInput`, it's like `sendOutput`. Dangerous for the same reasons that `experimental.colorSelection` is - modifications only to the terminal-side of the conpty buffer.
|
||||
* *Invoke Script Function*: We have nothing like this. I suppose the general-purpose actions are vaguely like this?
|
||||
* *Make Hyperlink*: `clickableLink` above ✅
|
||||
* *Open Password Manager*: Nothing similar.
|
||||
* *Post Notification*: Consider [#7718] - could absolutely be done.
|
||||
* `Control.TriggerType.SendNotification`
|
||||
* *Prompt Detected*: `addMark(prompt)`, basically. ✅
|
||||
* *Report Directory*: "Tells iTerm2 what your current directory is". Kinda like `sendOutput`, but not that dangerous in my opinion.
|
||||
* `Control.TriggerType.SetWorkingDirectory`
|
||||
* *Report User & Host*: Kinda the same as the above. We don't use these currently, but we may want to consider in the future.
|
||||
* *Ring Bell*: Plays the standard system bell sound once.
|
||||
* `Control.TriggerType.RaiseBell`
|
||||
* *Run Command*: This seems dangerous if misused. Basically just `ShellExecute()` the command.
|
||||
* *Run Co-process*: Definitely no precedent we have for this, and might require its own spec.
|
||||
* *Run Silent Co-process*: same deal.
|
||||
* *Send Text*: `sendInput` ✅
|
||||
* *Set Mark*: `addMark` ✅
|
||||
* *Set Title*: Similar to the "Report Directory" above.
|
||||
* `Control.TriggerType.SetTitle`
|
||||
* *Set User Variable*: Specifically tied to scripting, which we don't have.
|
||||
* *Show Alert*: Show a toast? [#8592]
|
||||
* `Control.TriggerType.SendInAppToast`
|
||||
* *Stop Processing Triggers*: Definitely an interesting idea. Stop processing more triggers.
|
||||
|
||||
Almost all these could be control-level actions that don't _need_ to cross out
|
||||
of the ControlCore (outside of existing conceived notions for crossing the
|
||||
boundary, like a visual bell or a notification).
|
||||
|
||||
|
||||
### Footnotes
|
||||
|
||||
<a name="footnote-1"><a>[1]: The regex we currently use for URLs is `(\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|$!:,.;]*[A-Za-z0-9+&@#/%=~_|$])`.
|
||||
|
||||
|
||||
[#5916]: https://github.com/microsoft/terminal/issues/5916
|
||||
[#8849]: https://github.com/microsoft/terminal/issues/8849
|
||||
[#7718]: https://github.com/microsoft/terminal/issues/7718
|
||||
[#8592]: https://github.com/microsoft/terminal/issues/8592
|
||||
[#7562]: https://github.com/microsoft/terminal/issues/7562
|
||||
[#8294]: https://github.com/microsoft/terminal/issues/8294
|
||||
[#2671]: https://github.com/microsoft/terminal/issues/2671
|
||||
[#6969]: https://github.com/microsoft/terminal/issues/6969
|
||||
[#11901]: https://github.com/microsoft/terminal/issues/11901
|
||||
[#11000]: https://github.com/microsoft/terminal/issues/11000
|
||||
|
||||
[OSC8]: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
|
||||
[triggers in iTerm2]: https://iterm2.com/documentation-one-page.html#documentation-triggers.html
|
||||
[iTerm2 docs]: https://iterm2.com/documentation-one-page.html#documentation-triggers.html
|
||||
[VsCode "auto replies"]: https://code.visualstudio.com/docs/terminal/advanced#_auto-replies
|
||||
[Quick Fix API]: https://github.com/microsoft/vscode/blob/4c6e0b5eee419550e31e386a0a5ca9840ac3280b/src/vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixService.ts#L80-L146
|
||||
|
After Width: | Height: | Size: 28 KiB |
@@ -1,407 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="48"
|
||||
height="48"
|
||||
viewBox="0 0 48 48"
|
||||
fill="none"
|
||||
version="1.1"
|
||||
id="svg284"
|
||||
sodipodi:docname="Terminal_Can_Pill.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
|
||||
<metadata
|
||||
id="metadata288">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="922"
|
||||
inkscape:window-height="816"
|
||||
id="namedview286"
|
||||
showgrid="false"
|
||||
inkscape:zoom="8.8541667"
|
||||
inkscape:cx="-17.429862"
|
||||
inkscape:cy="31.710582"
|
||||
inkscape:window-x="3142"
|
||||
inkscape:window-y="60"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg284" />
|
||||
<g
|
||||
id="g4007"
|
||||
transform="matrix(0.9375,0,0,0.9375,0,1.5)">
|
||||
<path
|
||||
id="path150"
|
||||
d="M 0,13 H 16 V 6 H 2 C 0.9,6 0,6.9 0,8 Z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#cccccc" />
|
||||
<path
|
||||
id="path152"
|
||||
d="M 32,6 H 16 v 7 h 16 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#999999" />
|
||||
<path
|
||||
id="path154"
|
||||
d="M 48,13 H 32 V 6 h 14 c 1.1,0 2,0.9 2,2 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#666666" />
|
||||
<path
|
||||
id="path156"
|
||||
d="M 46,42 H 2 C 0.9,42 0,41.1 0,40 V 12 h 48 v 28 c 0,1.1 -0.9,2 -2,2 z"
|
||||
style="fill:url(#paint0_linear)"
|
||||
inkscape:connector-curvature="0" />
|
||||
<g
|
||||
id="g171"
|
||||
style="filter:url(#filter0_dd)">
|
||||
<path
|
||||
id="path158"
|
||||
d="m 15.2,24.3 -8.80001,8.8 c -0.5,0.5 -0.5,1.2 0,1.6 l 1.8,1.8 C 8.69999,37 9.4,37 9.8,36.5 l 8.8,-8.8 c 0.5,-0.5 0.5,-1.2 0,-1.6 l -1.8,-1.8 c -0.4,-0.4 -1.2,-0.4 -1.6,0 z"
|
||||
style="fill:url(#paint1_linear)"
|
||||
inkscape:connector-curvature="0" />
|
||||
<mask
|
||||
height="13"
|
||||
width="13"
|
||||
y="24"
|
||||
x="6"
|
||||
maskUnits="userSpaceOnUse"
|
||||
mask-type="alpha"
|
||||
id="mask0">
|
||||
<path
|
||||
id="path160"
|
||||
d="m 15.2,24.3 -8.80001,8.8 c -0.5,0.5 -0.5,1.2 0,1.6 l 1.8,1.8 C 8.69999,37 9.4,37 9.8,36.5 l 8.8,-8.8 c 0.5,-0.5 0.5,-1.2 0,-1.6 l -1.8,-1.8 c -0.4,-0.4 -1.2,-0.4 -1.6,0 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#paint2_linear)" />
|
||||
</mask>
|
||||
<g
|
||||
id="g167"
|
||||
mask="url(#mask0)">
|
||||
<g
|
||||
id="g165"
|
||||
style="filter:url(#filter1_dd)">
|
||||
<path
|
||||
id="path163"
|
||||
d="m 9.8,17.3 8.8,8.8 c 0.5,0.5 0.5,1.2 0,1.6 l -1.8,1.8 c -0.5,0.5 -1.2,0.5 -1.6,0 L 6.39999,20.7 c -0.5,-0.5 -0.5,-1.2 0,-1.6 l 1.8,-1.8 C 8.59999,16.9 9.4,16.9 9.8,17.3 Z"
|
||||
style="fill:url(#paint3_linear)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
<path
|
||||
id="path169"
|
||||
d="m 9.8,17.3 8.8,8.8 c 0.5,0.5 0.5,1.2 0,1.6 l -1.8,1.8 c -0.5,0.5 -1.2,0.5 -1.6,0 L 6.39999,20.7 c -0.5,-0.5 -0.5,-1.2 0,-1.6 l 1.8,-1.8 C 8.59999,16.9 9.4,16.9 9.8,17.3 Z"
|
||||
style="fill:url(#paint4_linear)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
id="g175"
|
||||
style="filter:url(#filter2_dd)">
|
||||
<path
|
||||
id="path173"
|
||||
d="M 40,32 H 24 c -0.6,0 -1,0.4 -1,1 v 3 c 0,0.6 0.4,1 1,1 h 16 c 0.6,0 1,-0.4 1,-1 v -3 c 0,-0.6 -0.4,-1 -1,-1 z"
|
||||
style="fill:url(#paint5_linear)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
<defs
|
||||
id="defs282">
|
||||
<filter
|
||||
id="filter0_dd"
|
||||
x="3.02499"
|
||||
y="15"
|
||||
width="18.95"
|
||||
height="25.875"
|
||||
filterUnits="userSpaceOnUse"
|
||||
color-interpolation-filters="sRGB">
|
||||
<feFlood
|
||||
flood-opacity="0"
|
||||
result="BackgroundImageFix"
|
||||
id="feFlood177" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
id="feColorMatrix179" />
|
||||
<feOffset
|
||||
dy="0.5"
|
||||
id="feOffset181" />
|
||||
<feGaussianBlur
|
||||
stdDeviation="0.5"
|
||||
id="feGaussianBlur183" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"
|
||||
id="feColorMatrix185" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="BackgroundImageFix"
|
||||
result="effect1_dropShadow"
|
||||
id="feBlend187" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
id="feColorMatrix189" />
|
||||
<feOffset
|
||||
dy="1"
|
||||
id="feOffset191" />
|
||||
<feGaussianBlur
|
||||
stdDeviation="1.5"
|
||||
id="feGaussianBlur193" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"
|
||||
id="feColorMatrix195" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="effect1_dropShadow"
|
||||
result="effect2_dropShadow"
|
||||
id="feBlend197" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect2_dropShadow"
|
||||
result="shape"
|
||||
id="feBlend199" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter1_dd"
|
||||
x="3.02499"
|
||||
y="15"
|
||||
width="18.95"
|
||||
height="18.875"
|
||||
filterUnits="userSpaceOnUse"
|
||||
color-interpolation-filters="sRGB">
|
||||
<feFlood
|
||||
flood-opacity="0"
|
||||
result="BackgroundImageFix"
|
||||
id="feFlood202" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
id="feColorMatrix204" />
|
||||
<feOffset
|
||||
dy="0.5"
|
||||
id="feOffset206" />
|
||||
<feGaussianBlur
|
||||
stdDeviation="0.5"
|
||||
id="feGaussianBlur208" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"
|
||||
id="feColorMatrix210" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="BackgroundImageFix"
|
||||
result="effect1_dropShadow"
|
||||
id="feBlend212" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
id="feColorMatrix214" />
|
||||
<feOffset
|
||||
dy="1"
|
||||
id="feOffset216" />
|
||||
<feGaussianBlur
|
||||
stdDeviation="1.5"
|
||||
id="feGaussianBlur218" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"
|
||||
id="feColorMatrix220" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="effect1_dropShadow"
|
||||
result="effect2_dropShadow"
|
||||
id="feBlend222" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect2_dropShadow"
|
||||
result="shape"
|
||||
id="feBlend224" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter2_dd"
|
||||
x="20"
|
||||
y="30"
|
||||
width="24"
|
||||
height="11"
|
||||
filterUnits="userSpaceOnUse"
|
||||
color-interpolation-filters="sRGB">
|
||||
<feFlood
|
||||
flood-opacity="0"
|
||||
result="BackgroundImageFix"
|
||||
id="feFlood227" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
id="feColorMatrix229" />
|
||||
<feOffset
|
||||
dy="0.5"
|
||||
id="feOffset231" />
|
||||
<feGaussianBlur
|
||||
stdDeviation="0.5"
|
||||
id="feGaussianBlur233" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"
|
||||
id="feColorMatrix235" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="BackgroundImageFix"
|
||||
result="effect1_dropShadow"
|
||||
id="feBlend237" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
id="feColorMatrix239" />
|
||||
<feOffset
|
||||
dy="1"
|
||||
id="feOffset241" />
|
||||
<feGaussianBlur
|
||||
stdDeviation="1.5"
|
||||
id="feGaussianBlur243" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"
|
||||
id="feColorMatrix245" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="effect1_dropShadow"
|
||||
result="effect2_dropShadow"
|
||||
id="feBlend247" />
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect2_dropShadow"
|
||||
result="shape"
|
||||
id="feBlend249" />
|
||||
</filter>
|
||||
<linearGradient
|
||||
id="paint0_linear"
|
||||
x1="36.4462"
|
||||
y1="47.8257"
|
||||
x2="11.8217"
|
||||
y2="5.1748"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#333333"
|
||||
id="stop252" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#4D4D4D"
|
||||
id="stop254" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint1_linear"
|
||||
x1="14.5276"
|
||||
y1="33.9959"
|
||||
x2="10.4841"
|
||||
y2="26.9924"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#999999"
|
||||
id="stop257" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#B3B3B3"
|
||||
id="stop259" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint2_linear"
|
||||
x1="14.5276"
|
||||
y1="33.9959"
|
||||
x2="10.4841"
|
||||
y2="26.9924"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#999999"
|
||||
id="stop262" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#B3B3B3"
|
||||
id="stop264" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint3_linear"
|
||||
x1="16.2747"
|
||||
y1="30.0336"
|
||||
x2="8.73699"
|
||||
y2="16.9781"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#CCCCCC"
|
||||
id="stop267" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#E6E6E6"
|
||||
id="stop269" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint4_linear"
|
||||
x1="16.2747"
|
||||
y1="30.0336"
|
||||
x2="8.73699"
|
||||
y2="16.9781"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#CCCCCC"
|
||||
id="stop272" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#E6E6E6"
|
||||
id="stop274" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="paint5_linear"
|
||||
x1="35.1496"
|
||||
y1="39.9553"
|
||||
x2="28.8504"
|
||||
y2="29.0447"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#CCCCCC"
|
||||
id="stop277" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#E6E6E6"
|
||||
id="stop279" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect
|
||||
x="19"
|
||||
y="31.053001"
|
||||
width="29"
|
||||
height="11.947"
|
||||
rx="1.8238994"
|
||||
id="rect29"
|
||||
style="fill:#fcc024;stroke-width:1;fill-opacity:1;stroke:none;stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<path
|
||||
d="M29.3999 39.7363C28.9253 39.9824 28.335 40.1055 27.6289 40.1055C26.7148 40.1055 25.9824 39.8169 25.4316 39.2397C24.8809 38.6626 24.6055 37.9053 24.6055 36.9678C24.6055 35.96 24.9146 35.1455 25.5327 34.5244C26.1538 33.9033 26.9375 33.5928 27.8838 33.5928C28.4932 33.5928 28.9985 33.6792 29.3999 33.8521V34.8892C28.9751 34.6372 28.5063 34.5112 27.9937 34.5112C27.311 34.5112 26.7573 34.7295 26.3325 35.166C25.9106 35.6025 25.6997 36.1855 25.6997 36.915C25.6997 37.6094 25.8975 38.1631 26.293 38.5762C26.6885 38.9863 27.2085 39.1914 27.853 39.1914C28.4478 39.1914 28.9634 39.0508 29.3999 38.7695V39.7363ZM35.772 40H34.625L34.0581 38.396H31.5796L31.0347 40H29.8921L32.252 33.6982H33.4297L35.772 40ZM33.7812 37.5435L32.9067 35.0298C32.8804 34.9478 32.8525 34.8159 32.8232 34.6343H32.8057C32.7793 34.8013 32.75 34.9331 32.7178 35.0298L31.8521 37.5435H33.7812ZM41.9858 40H40.8433L37.833 35.3682C37.7568 35.251 37.6938 35.1294 37.644 35.0034H37.6177C37.6411 35.1382 37.6528 35.4268 37.6528 35.8691V40H36.6421V33.6982H37.8594L40.7686 38.2202C40.8916 38.4077 40.9707 38.5366 41.0059 38.6069H41.0234C40.9941 38.4399 40.9795 38.1572 40.9795 37.7588V33.6982H41.9858V40Z"
|
||||
id="pill_text"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;stroke-width:1;stroke:none;stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 12 KiB |
@@ -1,17 +0,0 @@
|
||||
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient id="foreground"><stop stop-color="#000000"/></linearGradient>
|
||||
<linearGradient id="background"><stop stop-color="#ffffff"/></linearGradient>
|
||||
</defs>
|
||||
<!-- background rounded rectangle -->
|
||||
<path d="M2 6C0.9 6 0 6.9 0 8L0 12L0 13L0 40C0 41.1 0.9 42 2 42L46 42C47.1 42 48 41.1 48 40L48 13L48 12L48 8C48 6.9 47.1 6 46 6L32 6L16 6L2 6Z" fill="url(#background)"/>
|
||||
<!-- tab outlines -->
|
||||
<rect y="12" x="0" height="1" width="48" fill="url(#foreground)"/>
|
||||
<rect y="6" x="15.33" height="7" width="1" fill="url(#foreground)"/>
|
||||
<rect y="6" x="31.66" height="7" width="1" fill="url(#foreground)"/>
|
||||
<!-- > -->
|
||||
<path d="M15.2 24.3L6.4 33.1C5.9 33.6 5.9 34.3 6.4 34.7L8.2 36.5C8.7 37 9.4 37 9.8 36.5L18.6 27.7C19.1 27.2 19.1 26.5 18.6 26.1L16.8 24.3C16.4 23.9 15.6 23.9 15.2 24.3Z" fill="url(#foreground)"/>
|
||||
<path d="M9.8 17.3L18.6 26.1C19.1 26.6 19.1 27.3 18.6 27.7L16.8 29.5C16.3 30 15.6 30 15.2 29.5L6.4 20.7C5.9 20.2 5.9 19.5 6.4 19.1L8.2 17.3C8.6 16.9 9.4 16.9 9.8 17.3Z" fill="url(#foreground)"/>
|
||||
<!-- "PRE" -->
|
||||
<path d="m 27.279297,33.324219 c 0,2.468099 0,4.936198 0,7.404297 0.513672,0 1.027343,0 1.541015,0 0,-0.848958 0,-1.697917 0,-2.546875 0.917549,0.01484 1.927453,0.03299 2.65875,-0.616892 1.172278,-0.927905 1.176118,-3.073122 -0.17547,-3.840777 -0.981472,-0.568217 -2.13908,-0.358412 -3.218649,-0.399753 -0.268549,0 -0.537097,0 -0.805646,0 z m 5.869141,0 c 0,2.468099 0,4.936198 0,7.404297 0.513021,0 1.026041,0 1.539062,0 0,-0.950521 0,-1.901042 0,-2.851563 0.431639,-0.03621 0.908827,0.05394 1.148438,0.458985 0.525553,0.771736 0.970414,1.596546 1.458984,2.392578 0.604167,0 1.208333,0 1.8125,0 -0.638695,-0.976785 -1.211177,-1.999445 -1.914561,-2.931671 -0.241051,-0.276681 -0.636923,-0.466649 -0.07177,-0.574189 1.274395,-0.677377 1.378019,-2.774051 0.102268,-3.504493 -0.922467,-0.560429 -2.029423,-0.352936 -3.053526,-0.393944 -0.340466,0 -0.680932,0 -1.021398,0 z m 6.25,0 c 0,2.468099 0,4.936198 0,7.404297 1.440755,0 2.88151,0 4.322265,0 0,-0.454427 0,-0.908855 0,-1.363282 -0.925781,0 -1.851563,0 -2.777344,0 0,-0.566406 0,-1.132812 0,-1.699218 0.804688,0 1.609375,0 2.414063,0 0,-0.454427 0,-0.908855 0,-1.363282 -0.804688,0 -1.609375,0 -2.414063,0 0,-0.536458 0,-1.072917 0,-1.609375 0.873047,0 1.746094,0 2.619141,0 0,-0.45638 0,-0.91276 0,-1.36914 -1.388021,0 -2.776041,0 -4.164062,0 z M 34.6875,34.648438 c 0.570781,0.0371 1.28319,-0.150767 1.691507,0.358943 0.370833,0.564952 0.02331,1.464787 -0.684396,1.526855 -0.334157,0.03512 -0.67147,0.0117 -1.007111,0.0185 0,-0.634765 0,-1.269531 0,-1.904296 z m -5.867188,0.01562 c 0.61736,0.02299 1.42501,-0.135196 1.79395,0.492096 0.333428,0.657753 -0.0252,1.619083 -0.829192,1.664678 -0.319151,0.05007 -0.643164,0.0243 -0.964758,0.03073 0,-0.729167 0,-1.458333 0,-2.1875 z" fill="url(#foreground)"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 834 B |
|
Before Width: | Height: | Size: 595 B |
|
Before Width: | Height: | Size: 586 B |