regex - Calling Ant ReplaceRegexp from TeamCity with strings including quotes and equalsigns -
regex - Calling Ant ReplaceRegexp from TeamCity with strings including quotes and equalsigns -
i have ant file contains targets used teamcity configs. have target defined uses replaceregexp:
<replaceregexp file="${targetfile}" match="${originalstring}" replace="${updatedstring}" byline="true" />
i need replace string in targetfile includes set of doublequotes; specifically, need replace minlevel="trace" minlevel="warn". in teamcity phone call antfile following:
-doriginalstring=minlevel="trace" -dupdatedstring=minlevel="warn"
but ignores doublequotes. i'm sure there's combination of escape characters i'm not understanding. right way phone call teamcity? thanks-
try enclosing property values in double quotes, , escape literal quotes backslashes.
-doriginalstring="minlevel=\"trace\"" -dupdatedstring="minlevel=\"warn\""
similarly values spaces in them:
-doriginalstring="minlevel=\"trace\" db=\"m1auth\"" -dupdatedstring="minlevel=\"warn\" db=\"m1auth\""
another solution save properties in file , pass ant
command via -propertyfile <filename>
(see propertyfile task , running apache ant).
regex ant teamcity
Comments
Post a Comment