diff --git a/jvm/src/main/groovy/org/asciidoctor/gradle/jvm/AbstractAsciidoctorTask.groovy b/jvm/src/main/groovy/org/asciidoctor/gradle/jvm/AbstractAsciidoctorTask.groovy index 011172dd..6fd3caaf 100644 --- a/jvm/src/main/groovy/org/asciidoctor/gradle/jvm/AbstractAsciidoctorTask.groovy +++ b/jvm/src/main/groovy/org/asciidoctor/gradle/jvm/AbstractAsciidoctorTask.groovy @@ -38,10 +38,12 @@ import org.asciidoctor.gradle.internal.ExecutorUtils import org.asciidoctor.gradle.internal.JavaExecUtils import org.asciidoctor.gradle.remote.AsciidoctorJavaExec import org.gradle.api.Action +import org.gradle.api.GradleException import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.ConfigurationContainer import org.gradle.api.artifacts.Dependency import org.gradle.api.file.FileCollection +import org.gradle.api.provider.MapProperty import org.gradle.api.provider.Property import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath @@ -103,6 +105,9 @@ class AbstractAsciidoctorTask extends AbstractJvmModelExecTask jvmClasspath private final List> gemJarProviders = [] + private final MapProperty optionsProperty = project.objects.mapProperty(String, Object) + private final MapProperty attributesProperty = project.objects.mapProperty(String, Object) + @Delegate private final DefaultAsciidoctorFileOperations asciidoctorTaskFileOperations @@ -221,7 +226,7 @@ class AbstractAsciidoctorTask extends AbstractJvmModelExecTask getOptions() { - resolveAsCacheable(asciidoctorj.options, projectOperations) + resolveAsCacheable(optionsProperty.get(), projectOperations) } /** Apply a new set of Asciidoctor options, clearing any options previously set. @@ -233,7 +238,7 @@ class AbstractAsciidoctorTask extends AbstractJvmModelExecTask getAttributes() { - resolveAsCacheable(asciidoctorj.attributes, projectOperations) + resolveAsCacheable(attributesProperty.get(), projectOperations) } /** Apply a new set of Asciidoctor options, clearing any options previously set. @@ -267,7 +279,7 @@ class AbstractAsciidoctorTask extends AbstractJvmModelExecTask, Configuration> - inputs.files(this.asciidoctorj.configuration) + inputs.files(asciidoctorj.configuration) inputs.files { gemJarProviders }.withPathSensitivity(RELATIVE) inputs.property 'backends', { -> backends() } inputs.property 'asciidoctorj-version', { -> asciidoctorj.version }