Select specific MSVC version with cpp-application plugin

Hello, I have a project that uses cpp-application to build a wrapping EXE for my program.
The plugin is working pretty well!
I use the upx packing tool on the linked exe to compress it. I have a custom task for this.

The catch is that the upx packing tool does not work with MSVC 2019-built executables, but it does with MSVC 2017-built executables. I have both toolchains installed on my system.
I looked into the source code for a way to tell gradle to prefer the 2017 one without any luck.
Can someone point me in the right direction?