所以我有一個名為“text1.txt”的檔案,它只有一行 -
version.build=846
我想做這樣的事情-
def svntag = ccsmp_v_ {version.build}
println $svntag
ccsmp_v_846
有沒有辦法做到這一點?
uj5u.com熱心網友回復:
您可以使用管道實用程式步驟插件中的方法從作業區讀取檔案。
對于您的情況,最好使用readProperties方法,例如:
def properties = readProperties file: '<your properties file in the workspace>'
然后您可以通過以下方式訪問該值:
def svntag = "ccsmp_v_${properties['version.build']}"
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/459133.html
