@CacheableTask open class WriteProperties : DefaultTask
Writes a java.util.Properties in a way that the results can be expected to be reproducible.
There are a number of differences compared to how properties are stored:
Like with java.util.Properties, Unicode characters are escaped when using the default Latin-1 (ISO-8559-1) encoding.
See Also
java.util.Properties#store(OutputStream, String)
Since
3.3
WriteProperties()
Writes a java.util.Properties in a way that the results can be expected to be reproducible. There are a number of differences compared to how properties are stored:
Like with java.util.Properties, Unicode characters are escaped when using the default Latin-1 (ISO-8559-1) encoding. |
open fun getComment(): String
Returns the optional comment to add at the beginning of the properties file. |
|
open fun getEncoding(): String
Returns the encoding used to write the properties file. Defaults to ISO_8859_1. If set to anything different, unicode escaping is turned off. |
|
open fun getLineSeparator(): String
Returns the line separator to be used when creating the properties file. Defaults to `\n`. |
|
open fun getOutputFile(): File
Returns the output file to write the properties to. |
|
open fun getProperties(): MutableMap<String, String>
Returns an immutable view of properties to be written to the properties file. |
|
open fun properties(properties: MutableMap<String, Any>): Unit
Adds multiple properties to be written to the properties file. This is a convenience method for calling |
|
open fun property(name: String, value: Any): Unit
Adds a property to be written to the properties file. A property's value will be coerced to a Values are not allowed to be null. |
|
open fun setComment(comment: String): Unit
Sets the optional comment to add at the beginning of the properties file. |
|
open fun setEncoding(encoding: String): Unit
Sets the encoding used to write the properties file. Defaults to ISO_8859_1. If set to anything different, unicode escaping is turned off. |
|
open fun setLineSeparator(lineSeparator: String): Unit
Sets the line separator to be used when creating the properties file. |
|
open fun setOutputFile(outputFile: File): Unit open fun setOutputFile(outputFile: Any): Unit
Sets the output file to write the properties to. |
|
open fun setProperties(properties: MutableMap<String, Any>): Unit
Sets all properties to be written to the properties file replacing any existing properties. |
|
open fun writeProperties(): Unit |