TFS Build how to specify multiple wildcard paths when a task uses searchPattern (Find-Files)

In TFS Build vNext, you can use build tasks. Many of them accept the searchPattern parameter as input for specifying wildcard patterns. For example, the VsTest task defines a Test Assembly parameter for it:

Check executable files to run tests. Wildcards can be used. For example, * test * .dll; -: \ obj ** for all dlls with a test by name, excluding files in any subdirectory named obj.

Thus, the pattern for the included paths is indicated, and the pattern for the excluded paths is indicated.

How can I specify multiple wildcard patterns to include.

Say I want foo.dll, but also test.dll, how can this be determined?

I tried

**\*foo*.dll;**\*test*.dll

but the main powershell Find-Files function also causes errors:

The path has no legal form

Can this be done?

+4
source share
2 answers

The following works well on my machine:

**\$(BuildConfiguration)\*test*.dll;**\$(BuildConfiguration)\*foo*.dll;-:**\obj\**
+2
source

Yes, it can be done. Depending on which build task you use, you may need to add $(build.sourcesDirectory)(or some other placeholder) to the inclusion expressions outside the first.

those. the following should work:

**\*foo*.dll;$(build.sourcesDirectory)**\*test*.dll

See this blog post for exact details of what is allowed in a wildcard expression.

+2
source

Source: https://habr.com/ru/post/1609739/


All Articles