Package org.gradle.api.tasks
Klasse WriteProperties
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.tasks.WriteProperties
- Alle implementierten Schnittstellen:
Comparable<Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,Named,ExtensionAware,Task,Configurable<Task>
Writes a
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:
- no timestamp comment is generated at the beginning of the file
- the lines in the resulting files are separated by a pre-set separator (defaults to '\n') instead of the system default line separator
- the properties are sorted alphabetically
Like with Properties, Unicode characters are escaped when using the
default Latin-1 (ISO-8559-1) encoding.
- Seit:
- 3.3
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.gradle.api.Task
Task.Namer -
Feldübersicht
Von Schnittstelle geerbte Felder org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungReturns the optional comment to add at the beginning of the properties file.abstract RegularFilePropertyThe output properties file.Returns the encoding used to write the properties file.Returns the line separator to be used when creating the properties file.Veraltet.Returns an immutable view of properties to be written to the properties file.voidproperties(Map<String, Object> properties) Adds multiple properties to be written to the properties file.voidAdds a property to be written to the properties file.voidsetComment(String comment) Sets the optional comment to add at the beginning of the properties file.voidsetEncoding(String encoding) Sets the encoding used to write the properties file.voidsetLineSeparator(String lineSeparator) Sets the line separator to be used when creating the properties file.voidsetOutputFile(File outputFile) Veraltet.voidsetOutputFile(Object outputFile) Veraltet.UsegetDestinationFile()instead.voidsetProperties(Map<String, Object> properties) Sets all properties to be written to the properties file replacing any existing properties.voidVon Klasse geerbte Methoden org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceVon Klasse geerbte Methoden org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Konstruktordetails
-
WriteProperties
public WriteProperties()
-
-
Methodendetails
-
getProperties
Returns an immutable view of properties to be written to the properties file.- Seit:
- 3.3
-
setProperties
Sets all properties to be written to the properties file replacing any existing properties.- Siehe auch:
-
property
Adds a property to be written to the properties file.A property's value will be coerced to a
StringwithString#valueOf(Object)or aCallablereturning a value to be coerced into aString.Values are not allowed to be null.
- Parameter:
name- Name of the propertyvalue- Value of the property- Seit:
- 3.4
-
properties
Adds multiple properties to be written to the properties file.This is a convenience method for calling
property(String, Object)multiple times.- Parameter:
properties- Properties to be added- Seit:
- 3.4
- Siehe auch:
-
getLineSeparator
Returns the line separator to be used when creating the properties file. Defaults to `\n`. -
setLineSeparator
Sets the line separator to be used when creating the properties file. -
getComment
Returns the optional comment to add at the beginning of the properties file. -
setComment
Sets the optional comment to add at the beginning of the properties file. -
getEncoding
Returns the encoding used to write the properties file. Defaults to ISO_8859_1. If set to anything different, unicode escaping is turned off. -
setEncoding
Sets the encoding used to write the properties file. Defaults to ISO_8859_1. If set to anything different, unicode escaping is turned off. -
getOutputFile
Veraltet.Returns the output file to write the properties to. -
setOutputFile
Veraltet.UsegetDestinationFile()instead.Sets the output file to write the properties to.- Seit:
- 4.0
-
setOutputFile
Veraltet.UsegetDestinationFile()instead.Sets the output file to write the properties to. -
getDestinationFile
The output properties file.- Seit:
- 8.1
-
writeProperties
- Löst aus:
IOException
-
getDestinationFile()instead.