Try adding defaults
This commit is contained in:
parent
5509dad0cd
commit
c716586e0d
@ -1,9 +1,19 @@
|
|||||||
#!/usr/bin/env groovy
|
#!/usr/bin/env groovy
|
||||||
|
|
||||||
|
import groovy.transform.Field
|
||||||
|
|
||||||
|
@Field
|
||||||
|
Map defaults = [
|
||||||
|
buildCmd: 'make all'
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def call(Map config = [:]) {
|
def call(Map config = [:]) {
|
||||||
echo "Hello, ${config.name}"
|
assert config.artifacts : 'must specify artifacts!'
|
||||||
if ( fileExists('Makefile')) {
|
|
||||||
|
config = defaults + config
|
||||||
|
if ( fileExists(config.buildCmd)) {
|
||||||
sh 'make'
|
sh 'make'
|
||||||
}
|
}
|
||||||
echo 'Done'
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user