Class EnhancedProblems
java.lang.Object
net.minecraftforge.gradleutils.shared.EnhancedProblems
- All Implemented Interfaces:
Serializable,Predicate<String>
The enhanced problems contain several base helper members to help reduce duplicate code between Gradle plugins.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringThe common message to send inProblemSpec.solution(String)when reporting problems. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnhancedProblems(String name, String displayName) Creates a new enhanced problems instance using the given name and display name. -
Method Summary
Modifier and TypeMethodDescriptionfinal <T extends FileSystemLocation>
Transformer<T, T> A utility method to ensure that aFileSystemLocationProviderhas (its parent) directory created.final ProblemsGets the problems instance used by this enhanced problems.protected final LoggerGets the logger to be used by this enhanced problems.final ProblemGroupGets the problem group used by this enhanced problems.protected abstract ProblemsDeprecated.Does not handle if Problems API cannot be accessed.protected abstract ProviderFactoryThe provider factory provided by Gradle services.protected final ProblemReporterGets the problem reporter used by the delegate problems instance.protected final ProblemIdCreates a problem ID to be used when reporting problems.final booleanChecks if the given property exists and equalstrue.final booleanChecks if the given property exists and equalsfalse.
-
Field Details
-
HELP_MESSAGE
The common message to send inProblemSpec.solution(String)when reporting problems.- See Also:
-
-
Constructor Details
-
EnhancedProblems
Creates a new enhanced problems instance using the given name and display name. These names are passed into a problem group that will be used by this instance.- Parameters:
name- The name for this enhanced problems instancedisplayName- The display name for this enhanced problems instance- Implementation Requirements:
- The implementing subclass must make their constructor public, annotated with
Inject, and have no parameters, passing in static strings to this base constructor.
-
-
Method Details
-
getProblems
Deprecated.Does not handle if Problems API cannot be accessed. UsegetDelegate().The problems instance provided by Gradle services.- Returns:
- The problems instance
- See Also:
-
getProviders
The provider factory provided by Gradle services.- Returns:
- The provider factory
- See Also:
-
getDelegate
Gets the problems instance used by this enhanced problems.- Returns:
- The delegate problems instance
-
getReporter
Gets the problem reporter used by the delegate problems instance.- Returns:
- The problem reporter
-
getProblemGroup
Gets the problem group used by this enhanced problems. It is unique for the plugin.- Returns:
- The problem group
-
getLogger
Gets the logger to be used by this enhanced problems.- Returns:
- The logger
-
id
Creates a problem ID to be used when reporting problems. The name must be unique so as to not potentially override other reported problems in the report.- Parameters:
name- The name for this problemdisplayName- The display name for this problem- Returns:
- The problem ID
-
test
Checks if the given property exists and equals
true.This checks both Gradle and System properties, giving the former higher priority. If for some reason a provider factory is not available in the current environment,
Boolean.getBoolean(String)will be used instead. -
testFalse
Checks if the given property exists and equals
false.This checks both Gradle and System properties, giving the former higher priority. If for some reason a provider factory is not available in the current environment,
Boolean.getBoolean(String)will be used instead.- Parameters:
property- The property to test- Returns:
- If the property exists and is
false
-
ensureFileLocation
A utility method to ensure that aFileSystemLocationProviderhas (its parent) directory created. If the directory cannot be created, an exception will be thrown when the provider that consumes this is resolved.- Type Parameters:
T- The type of file system location (i.e.RegularFileorDirectory)- Returns:
- The transformer to apply onto a provider
-