-
-
Notifications
You must be signed in to change notification settings - Fork 424
AppendingTransformer blocks use of configuration cache (field data cannot be serialized) #763
Copy link
Copy link
Closed
Description
Shadow Version
7.1.2
Gradle Version
7.4
Expected Behavior
The configuration cache is supported. Sample invocation that fails:
./gradlew foo:shadowJar -m --configuration-cache
Actual Behavior
Attempting to use the configuration cache fails with the following:
// console output
$ ./gradlew bundle-aar:shadowJar -m --configuration-cache
3 problems were found storing the configuration cache, 1 of which seems unique.
- Task `:bundle-aar:shadowJar` of type `com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar`: cannot serialize object of type 'java.io.ByteArrayOutputStream', a subtype of 'java.io.OutputStream', as these are not supported with the configuration cache.
See https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
// and the configuration cache error report:
cannot serialize object of type java.io.ByteArrayOutputStream a subtype of java.io.OutputStream, as these are not supported with the configuration cache (https://docs.gradle.org/7.4/userguide/configuration_cache.html#config_cache:requirements:disallowed_types)
field data of com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
bean of type com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
fieldtransformers of com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
task:bundle-aar:shadowJar of type com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
Note that this is only a dry run. It fails in the configuration phase, before it gets to the task action.
Gradle Build Script(s)
configurations {
androidTools {
// sdklib brings in a lot of unused code paths that can cause trouble with classpath conflicts.
// Excluding for sanity.
exclude group: 'com.android.tools', module: 'repository'
exclude group: 'com.android.tools.analytics-library'
}
}
// bundle and shade androidTools to avoid conflicting with AGP versions.
shadowJar {
configurations = [project.configurations.androidTools]
relocate 'com.android', 'bundle.aar.com.android'
append 'META-INF/LICENSE.txt'
append 'META-INF/LICENSE.md'
append 'META-INF/NOTICE.md'
mergeServiceFiles()
minimize()
dependencies {
// don't fat jar kotlin
exclude(dependency('org.jetbrains.kotlin:.*'))
}
}Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)
n/a
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels