Klasse MessageFormatExtension
messageFormat for configuring the messageFormatPack task.
This extension allows configuring the pack filename, compression, duplicate message handling strategy, template validation, source sets to scan and include/exclude filters for message codes.
- Seit:
- 0.8.0
- Siehe auch:
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidExclude messages that match the given regular expressions.abstract org.gradle.api.provider.Property<@NotNull Boolean> Compress property stating whether the message pack must be compressed or not.abstract org.gradle.api.provider.Property<@NotNull Object> Property containing the strategy to use in case a duplicate message code or template name (with different message definition) is found.Return a list of regular expressions which will be matched against each message code.Return a list of regular expressions which will be matched against each message code.abstract org.gradle.api.provider.Property<@NotNull String> Return the pack filename property.abstract org.gradle.api.file.ConfigurableFileCollectionReturns a collection of source files to scan for message and template annotations.abstract org.gradle.api.provider.Property<@NotNull Boolean> Property containing a boolean stating whether to validate referenced templates.voidInclude messages that match the given regular expressions.voidsourceSet(org.gradle.api.tasks.SourceSet sourceSet) Add all outputs for the givensourceSetto the collection of sources.
-
Konstruktordetails
-
MessageFormatExtension
public MessageFormatExtension()
-
-
Methodendetails
-
getIncludeRegexFilters
Return a list of regular expressions which will be matched against each message code. If it matches, the message will be included in the packed message file. If it doesn't match the message is skipped.If the list is empty, all messages are included, unless they're explicitly excluded.
- Gibt zurück:
- list of regular expressions for message inclusion, never
null - Seit:
- 0.8.0 (renamed in 0.9.1)
- Siehe auch:
-
getExcludeRegexFilters
Return a list of regular expressions which will be matched against each message code. If it matches, the message will be excluded from the packed message file. If it doesn't match the message is included.- Gibt zurück:
- list of regular expressions for message exclusion, never
null - Seit:
- 0.8.0 (renamed in 0.9.1)
- Siehe auch:
-
getPackFilename
Return the pack filename property. The default value ismessages.mfp.- Gibt zurück:
- pack filename property, never
null - Seit:
- 0.8.0
-
getCompress
Compress property stating whether the message pack must be compressed or not. The default value isfalse.- Gibt zurück:
- compress property, never
null
-
getSources
public abstract org.gradle.api.file.ConfigurableFileCollection getSources()Returns a collection of source files to scan for message and template annotations.There's no restriction on what kind of files are in the collection. Only class (
*.class) files will be used for annotation scanning.The default value is the output of the
main/javasource set, which contains all compiled java classes.- Gibt zurück:
- class files to be scanned for messages and templates, never
null - Siehe auch:
-
getDuplicateMsgStrategy
Property containing the strategy to use in case a duplicate message code or template name (with different message definition) is found. The default strategy isIGNORE_AND_WARN.This property accepts various formats:
-
DuplicateMsgStrategyenum value (e.g.FAIL) -
Duplicate strategy string. The string is converted to uppercase, dashes are translated to underscores and the
resulting strategy name is matched against
DuplicateMsgStrategy(e.g.'override-and-warn'matchesOVERRIDE_AND_WARN)
A duplicate is either a message with an already known message code or a template with an already known template name and a different message definition. This means that if the same message or template is encountered twice, it is not considered a duplicate.
- Gibt zurück:
- duplicate message strategy property, never
null - Siehe auch:
-
-
getValidateReferencedTemplates
Property containing a boolean stating whether to validate referenced templates. The default value resolves totrue.If the property resolves to
truethe task will check whether all referenced templates (including nested templates) are available and included in the packed message file.If the property resolves to
falseno checks are performed. This may lead to a situation where a message cannot be formatted if the referenced template is missing from the message support.- Gibt zurück:
- validate referenced templates property, never
null
-
include
Include messages that match the given regular expressions.- Parameter:
regex- array of regular expressions, notnull- Seit:
- 0.8.0
- Siehe auch:
-
exclude
Exclude messages that match the given regular expressions.- Parameter:
regex- array of regular expressions, notnull- Seit:
- 0.8.0
- Siehe auch:
-
sourceSet
public void sourceSet(org.gradle.api.tasks.SourceSet sourceSet) Add all outputs for the givensourceSetto the collection of sources.- Parameter:
sourceSet- source set to include in message/template scanning- Siehe auch:
-