23 lines
854 B
Groovy
23 lines
854 B
Groovy
|
|
def stamp(convertdetails) {
|
|
for (convertdetail in convertdetails) {
|
|
def filetoconvert = convertdetail[0]
|
|
def pattern = convertdetail[1]
|
|
def replacement = convertdetail[2]
|
|
echo "Converting any instances of pattern: ${pattern} with replacement: ${replacement} in file: ${filetoconvert}"
|
|
def stampscript = "${autobuilder.commonscripts()}/versionstamping/versionstamper.py"
|
|
echo "Using python: ${PYTHON} and script: ${stampscript}"
|
|
if (isUnix()) {
|
|
sh """
|
|
"${PYTHON}" -u "${stampscript}" -f "${filetoconvert}" -p "${pattern}" -s "${replacement}"
|
|
"""
|
|
}
|
|
else {
|
|
powershell """
|
|
& "${PYTHON}" -u "${stampscript}" -f "${filetoconvert}" -p "${pattern}" -s "${replacement}"
|
|
"""
|
|
}
|
|
}
|
|
}
|
|
|
|
return this;
|