Note - To make what Colin did work, you must be using declarative pipeline
1.2 or higher which has its own list of dependencies. I didn't realize this
right away.
On Monday, October 16, 2017 at 12:03:26 PM UTC-5, Colin Bennett wrote:
>
> 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/b8abf5f8-b2e2-4acf-9333-4d18d29f2c74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.