I’m writing a task to execute OpenCover.Console.exe, and I know the general area that the file will be in, but I don’t definitely know the path. Because it’s a package downloaded into the source tree by Nuget, the version could get updated and the build script might not be updated to match. For example, the location is currently “packages/OpenCover.4.5.3207/OpenCover.Console.exe”. But if a new version comes out, and the package version is updated, the build script won’t be pointing to the correct location any more.
If I could specify
"packages/OpenCover.*/OpenCover.Console.exe"
, I’d be set, but that isn’t working. As a workaround, I think it would work if I did something like this:
FileTree tree = fileTree(dir: 'packages').matching {
include '**/OpenCover.Console.exe'
}
and then used the only element of the FileTree, but that feels like I’m misusing what FileTrees are intended for.
Thanks.