The workaround of use the 'tool' function in the environment PATH 
assignment is working for me.

Here is an example:

pipeline {
    agent { label "windows" }
    environment {
        PATH = """${
                [
                 tool('Ninja'),
                 [tool('CMake'), 'bin'].join(File.separator),
                 [tool('MSYS2'), 'mingw64', 'bin'].join(File.separator)
                ]
                .join(File.pathSeparator) +
                File.pathSeparator
            }$PATH"""
    }
    stages {
        stage("build") {
            steps {
                bat 'cmake -G Ninja .'
                bat 'cmake --build .'
            }
        }
    }
}

Some of the tools are of CustomTool type and one is CMake (but I'm not 
using the CMake command, just a batch/shell step to call cmake manually, so 
I must add it to the path).  Some have the executable in a subdirectory of 
the automatically-installed tool archive, e.g. CMake has cmake.exe in the 
'bin' subdirectory.

The multi-line groovy interpolated string produces a cross-platform path 
with semicolon (Windows) or colon (Linux/other) and slash/backslash as 
necessary.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d2b06b34-0744-43dd-849b-75839d454031%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to