Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task installShadowDist does not work with Gradle Configuration Cache enabled #775

Closed
jvmusin opened this issue Jun 23, 2022 · 1 comment · Fixed by #824
Closed

Task installShadowDist does not work with Gradle Configuration Cache enabled #775

jvmusin opened this issue Jun 23, 2022 · 1 comment · Fixed by #824

Comments

@jvmusin
Copy link

jvmusin commented Jun 23, 2022

Shadow Version

7.1.2

Gradle Version

7.4.2

Expected Behavior

runShadow task runs with the gradle configuration cache enabled

Actual Behavior

Gradle produces an error saying the configuration cache requirements are not met by the task installShadowDist

  • Task :installShadowDist of type org.gradle.api.tasks.Sync: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.

Gradle Build Script(s)

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    application
    kotlin("jvm") version "1.7.0"
    id("com.github.johnrengelman.shadow") version "7.1.2"
}

application.mainClass.set("MainKt")
repositories.mavenCentral()

tasks.withType<KotlinCompile> {
    kotlinOptions.jvmTarget = "11"
}

Sample project is here:
untitled.zip

@jvmusin
Copy link
Author

jvmusin commented Jun 23, 2022

Class JavaJarExec with the task runShadow are also not compatible:

- Task `:samples:ktor-fatjar-sample:installShadowDist` of type `org.gradle.api.tasks.Sync`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:samples:ktor-fatjar-sample:runShadow` of type `com.github.jengelman.gradle.plugins.shadow.internal.JavaJarExec`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:samples:ktor-fatjar-sample:runShadow` of type `com.github.jengelman.gradle.plugins.shadow.internal.JavaJarExec`: cannot serialize object of type 'org.gradle.api.internal.tasks.DefaultSourceSetContainer', a subtype of 'org.gradle.api.tasks.SourceSetContainer', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:samples:ktor-fatjar-sample:runShadow` of type `com.github.jengelman.gradle.plugins.shadow.internal.JavaJarExec`: cannot serialize object of type 'org.gradle.api.internal.tasks.DefaultTaskContainer', a subtype of 'org.gradle.api.tasks.TaskContainer', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.4.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:samples:ktor-fatjar-sample:runShadow` of type `com.github.jengelman.gradle.plugins.shadow.internal.JavaJarExec`: value 'map(map(org.gradle.api.file.Directory property 'buildDir' org.gradle.api.internal.file.DefaultFilePropertyFactory$PathToDirectoryTransformer@7a65f56d))' failed to unpack provider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant