toolchain support
This commit is contained in:
14
README.md
14
README.md
@@ -18,7 +18,7 @@ Next you should register this library in Jenkins -> System settings -> Global Pi
|
||||
* `get()` - download and parse `platforms.json` file from `PLATFORMS_GIT`
|
||||
* `root()` - returns root JSON object of `platforms.json`
|
||||
* `forEach(func, ...)` - iterate over platforms, `func` is only mandatory parameter:
|
||||
* `func` - method to execute for each enabled platform, pass JSON element of current platform
|
||||
* `func` - method to execute for each enabled platform, pass JSON element of current platform and optional CMake toolchain argument
|
||||
* `stagePrefix` - prefix string for `stage`
|
||||
* `stageSuffix` - suffix string for `stage`
|
||||
* `whiteList` - array of permitted names, ignored if empty
|
||||
@@ -40,6 +40,18 @@ node {
|
||||
}
|
||||
```
|
||||
|
||||
With toolchain:
|
||||
```
|
||||
@Library('SHS.Platforms') _
|
||||
node {
|
||||
def pl = new org.SHS.Platforms(this)
|
||||
pl.get()
|
||||
pl.forEach ({ dist, cmake_toolchain ->
|
||||
print("compile in ${dist.docker_image} with arg ${cmake_toolchain}")
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
With filter:
|
||||
```
|
||||
@Library('SHS.Platforms') _
|
||||
|
||||
@@ -22,9 +22,10 @@ class Platforms {
|
||||
def prefix = args.stagePrefix ?: ""
|
||||
def suffix = args.stageSuffix ?: ""
|
||||
filterJSON(args.whiteList ?: [], args.blackList ?: []).each { key, dist ->
|
||||
//steps.print("final ${key}${suffix}")
|
||||
def toolchain = dist.cmake_toolchain ?: ""
|
||||
if (toolchain != "") toolchain = "-DCMAKE_TOOLCHAIN_FILE=${toolchain}"
|
||||
steps.stage ("${prefix}${key}${suffix}") {
|
||||
functor(dist)
|
||||
functor(dist, toolchain)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user