I am trying to configure the following custom task:
task antecedeRelease(type: AntecedeReleaseTask) {
antecedeWithVersion = project.'antecede-with-version'
antecedeToVersion = project.'antecede-to-version'
}
The problem is that the properties antecede-with-versionand antecede-to-versionmust be set via the command line with the option -P. If they are not installed and are antecedeReleasenot called, this should not be the cause of the error:
$ ./gradlew tasks
org.gradle.api.GradleScriptException: A problem occurred evaluating project ...
Caused by: groovy.lang.MissingPropertyException: Could not find property 'antecede-with-version' on project ...
I could conditionally define a task antecedeReleaseso that it is defined only if these properties are defined, but I would like to keep the file build.gradleas clean as possible.
source
share