Skip to content

'ConfigureShadowRelocation' task does not support Gradle configuration cache #687

@Tapchicoma

Description

@Tapchicoma

com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation Gradle tasks does not support configuration cache:

- Task `:relocateShadowJar` of type `com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation`: cannot serialize object of type 'com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.1.1/userguide/configuration_cache.html#config_cache:requirements:task_access

Seems this part in current task implementation:

    @Input
    ShadowJar target

    @InputFiles @Optional
    List<Configuration> getConfigurations() {
        return target.configurations
    }

should be reworked into something like this:

    public setTarget(task: ShadowJar) {
        targetConfigurations = task.configurations
    }

    private List<Configurations> targetConfigurations = null

    @InputFiles @Optional
    List<Configuration> getConfigurations() {
        return targetConfigurations
    }

Shadow Version: 7.0.0
Gradle Version: 7.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions