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 cb05970c..de0cad66 100644 --- a/jvm/src/main/groovy/org/asciidoctor/gradle/jvm/AbstractAsciidoctorTask.groovy +++ b/jvm/src/main/groovy/org/asciidoctor/gradle/jvm/AbstractAsciidoctorTask.groovy @@ -106,7 +106,7 @@ class AbstractAsciidoctorTask extends AbstractJvmModelExecTask, Configuration> detachedConfigurationCreator +// private final Function, Configuration> detachedConfigurationCreator private final Property jvmClasspath private final List> gemJarProviders = [] @@ -130,9 +130,18 @@ class AbstractAsciidoctorTask extends AbstractJvmModelExecTask deps = this.docExtensionsProperty.get().findAll { it instanceof Dependency } as List + + def detachedConfigurationCreator = { ConfigurationContainer c, List d -> + final cfg = c.detachedConfiguration(d.toArray() as Dependency[]) + cfg.canBeConsumed = false + cfg.canBeResolved = true + cfg + }.curry(project.configurations) as Function, Configuration> + Configuration cfg = detachedConfigurationCreator.apply(deps) getAsciidoctorJExtension().loadJRubyResolutionStrategy(cfg) - } + cfg + } as Provider private final Provider>> attributesByLangProvider = project.provider { def attributesByLang = new HashMap>() @@ -531,12 +540,12 @@ class AbstractAsciidoctorTask extends AbstractJvmModelExecTask deps -> - final cfg = c.detachedConfiguration(deps.toArray() as Dependency[]) - cfg.canBeConsumed = false - cfg.canBeResolved = true - cfg - }.curry(project.configurations) as Function, Configuration> +// this.detachedConfigurationCreator = { ConfigurationContainer c, List deps -> +// final cfg = c.detachedConfiguration(deps.toArray() as Dependency[]) +// cfg.canBeConsumed = false +// cfg.canBeResolved = true +// cfg +// }.curry(project.configurations) as Function, Configuration> inputs.files { gemJarProviders }.withPathSensitivity(RELATIVE) inputs.property 'backends', { -> backends() } @@ -819,7 +828,7 @@ class AbstractAsciidoctorTask extends AbstractJvmModelExecTask, attributeProviders, lang