resource-types/xml

Methods

(inner) getVersion(resource, cb)

Get version value from the XML resource's element (defined in dot-notation of element names).
Source:
Parameters:
Name Type Description
resource Object resource configuration
Name Type Description
path String path to the XML file
params.property String element names in dot-notation
cb function standard cb(err, result) callback, result is the version value

(inner) isReadyForRelease(resource, cb)

Check that the XML resource is ready for release, i.e. the file can be parsed and the element exists with a value.
Source:
Parameters:
Name Type Description
resource Object resource configuration
Name Type Description
path String path to the XML file
params.property String element names in dot-notation
cb function standard cb(err, result) callback, result is true when the resource is ready for release, an error is passed when the file is not configured, the file can't be parsed, or the element doesn't exist or has no value

(inner) setVersion(version, resource, opts, cb)

Set version value in the XML resource's element (defined in dot-notation of element names, e.g. project.version in a Maven pom.xml). Only the element's text is replaced, the rest of the file including its formatting and comments is kept as-is.
Source:
Parameters:
Name Type Description
version String version value to set
resource Object resource configuration
Name Type Description
path String path to the XML file
params.property String element names in dot-notation
opts Object optional settings
Name Type Attributes Description
dryRun Boolean <optional>
when true, XML file won't be modified
cb function standard cb(err, result) callback